Package org.apache.commons.math3.analysis.differentiation

Examples of org.apache.commons.math3.analysis.differentiation.DerivativeStructure


      super(3, startParams, 0.0, new double[] { 1.0, 0.0, 0.0 });
    }

    @Override
    public DerivativeStructure[] value(DerivativeStructure[] variables) {
        DerivativeStructure x1 = variables[0];
        DerivativeStructure x2 = variables[1];
        DerivativeStructure x3 = variables[2];
        DerivativeStructure tmp1 = variables[0].getField().getZero();
        if (x1.getValue() == 0) {
            tmp1 = tmp1.add((x2.getValue() >= 0) ? 0.25 : -0.25);
        } else {
            tmp1 = x2.divide(x1).atan().divide(twoPi);
            if (x1.getValue() < 0) {
                tmp1 = tmp1.add(0.5);
            }
        }
        DerivativeStructure tmp2 = x1.multiply(x1).add(x2.multiply(x2)).sqrt();
        return new DerivativeStructure[] {
            x3.subtract(tmp1.multiply(10)).multiply(10),
            tmp2.subtract(1).multiply(10),
            x3
        };
    }
View Full Code Here


      super(4, startParams, 0.0, buildArray(4, 0.0));
    }

    @Override
    public DerivativeStructure[] value(DerivativeStructure[] variables) {
        DerivativeStructure x1 = variables[0];
        DerivativeStructure x2 = variables[1];
        DerivativeStructure x3 = variables[2];
        DerivativeStructure x4 = variables[3];
      return new DerivativeStructure[] {
        x1.add(x2.multiply(10)),
        x3.subtract(x4).multiply(sqrt5),
        x2.subtract(x3.multiply(2)).multiply(x2.subtract(x3.multiply(2))),
        x1.subtract(x4).multiply(x1.subtract(x4)).multiply(sqrt10)
View Full Code Here

            theoreticalMinParams);
    }

    @Override
    public DerivativeStructure[] value(DerivativeStructure[] variables) {
        DerivativeStructure x1 = variables[0];
        DerivativeStructure x2 = variables[1];
        return new DerivativeStructure[] {
            x1.subtract(13.0).add(x2.negate().add(5.0).multiply(x2).subtract(2).multiply(x2)),
            x1.subtract(29.0).add(x2.add(1).multiply(x2).subtract(14).multiply(x2))
        };
    }
View Full Code Here

            theoreticalMinParams);
    }

    @Override
    public DerivativeStructure[] value(DerivativeStructure[] variables) {
        DerivativeStructure   x1 = variables[0];
        DerivativeStructure   x2 = variables[1];
        DerivativeStructure   x3 = variables[2];
        DerivativeStructure[] f = new DerivativeStructure[m];
      for (int i = 0; i < m; ++i) {
        double tmp1 = i + 1;
        double tmp2 = 15 - i;
        double tmp3 = (i <= 7) ? tmp1 : tmp2;
        f[i] = x1.add(x2.multiply(tmp2).add(x3.multiply(tmp3)).reciprocal().multiply(tmp1)).negate().add(y[i]);
      }
      return f;
    }
View Full Code Here

      }
    }

    @Override
    public DerivativeStructure[] value(DerivativeStructure[] variables) {
        DerivativeStructure x1 = variables[0];
        DerivativeStructure x2 = variables[1];
        DerivativeStructure x3 = variables[2];
        DerivativeStructure x4 = variables[3];
        DerivativeStructure[] f = new DerivativeStructure[m];
        for (int i = 0; i < m; ++i) {
            f[i] = x1.multiply(x2.add(v[i]).multiply(v[i])).divide(x4.add(x3.add(v[i]).multiply(v[i]))).negate().add(y[i]);
        }
        return f;
    }
View Full Code Here

      }
    }

    @Override
    public DerivativeStructure[] value(DerivativeStructure[] variables) {
        DerivativeStructure x1 = variables[0];
        DerivativeStructure x2 = variables[1];
        DerivativeStructure x3 = variables[2];
        DerivativeStructure[] f = new DerivativeStructure[m];
      for (int i = 0; i < m; ++i) {
        f[i] = x1.multiply(x2.divide(x3.add(5.0 * (i + 1) + 45.0)).exp()).subtract(y[i]);
      }
     return f;
    }
View Full Code Here

    @Override
    public DerivativeStructure[] value(DerivativeStructure[] variables) {
        DerivativeStructure[] f = new DerivativeStructure[m];
        for (int i = 0; i < (m - 2); ++i) {
            double div = (i + 1) / 29.0;
            DerivativeStructure s1 = variables[0].getField().getZero();
            DerivativeStructure dx = variables[0].getField().getOne();
            for (int j = 1; j < n; ++j) {
                s1 = s1.add(dx.multiply(j).multiply(variables[j]));
                dx = dx.multiply(div);
            }
            DerivativeStructure s2 = variables[0].getField().getZero();
            dx = variables[0].getField().getOne();
            for (int j = 0; j < n; ++j) {
                s2 = s2.add(dx.multiply(variables[j]));
                dx = dx.multiply(div);
            }
            f[i] = s1.subtract(s2.multiply(s2)).subtract(1);
        }

        DerivativeStructure x1 = variables[0];
        DerivativeStructure x2 = variables[1];
        f[m - 2] = x1;
        f[m - 1] = x2.subtract(x1.multiply(x1)).subtract(1);

        return f;

    }
View Full Code Here

            new double[] { 1.0, 10.0, 1.0 });
   }

    @Override
    public DerivativeStructure[] value(DerivativeStructure[] variables) {
        DerivativeStructure x1 = variables[0];
        DerivativeStructure x2 = variables[1];
        DerivativeStructure x3 = variables[2];
        DerivativeStructure[] f = new DerivativeStructure[m];
      for (int i = 0; i < m; ++i) {
        double tmp = (i + 1) / 10.0;
        f[i] = x1.multiply(-tmp).exp().subtract(x2.multiply(-tmp).exp()).add(
                  x3.multiply(FastMath.exp(-i - 1) - FastMath.exp(-tmp)));
      }
      return f;
    }
View Full Code Here

            theoreticalMinParams);
    }

    @Override
    public DerivativeStructure[] value(DerivativeStructure[] variables) {
        DerivativeStructure x1 = variables[0];
        DerivativeStructure x2 = variables[1];
        DerivativeStructure[] f = new DerivativeStructure[m];
        for (int i = 0; i < m; ++i) {
            double temp = i + 1;
            f[i] = x1.multiply(temp).exp().add(x2.multiply(temp).exp()).subtract(2 + 2 * temp).negate();
        }
        return f;
    }
View Full Code Here

      setCostAccuracy(2.5e-8);
    }

    @Override
    public DerivativeStructure[] value(DerivativeStructure[] variables) {
        DerivativeStructure x1 = variables[0];
        DerivativeStructure x2 = variables[1];
        DerivativeStructure x3 = variables[2];
        DerivativeStructure x4 = variables[3];
        DerivativeStructure[] f = new DerivativeStructure[m];
        for (int i = 0; i < m; ++i) {
            double temp = (i + 1) / 5.0;
            DerivativeStructure tmp1 = x1.add(x2.multiply(temp)).subtract(FastMath.exp(temp));
            DerivativeStructure tmp2 = x3.add(x4.multiply(FastMath.sin(temp))).subtract(FastMath.cos(temp));
            f[i] = tmp1.multiply(tmp1).add(tmp2.multiply(tmp2));
        }
        return f;
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.math3.analysis.differentiation.DerivativeStructure

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.