numal.highprecision.test
Class Test_marquardt
java.lang.Object
numal.highprecision.test.Test_marquardt
- All Implemented Interfaces:
- AP_marquardt_methods
public class Test_marquardt
- extends Object
- implements AP_marquardt_methods
Determine the parameters p[1], p[2], p[3] of the best fit of the function
g(x[i],p)=p[1]+p[2]*exp(p[3]*x[i]) to data readings
y[]={127.0, 151.0, 379.0, 421.0, 460.0, 426.0} where
x[]={-5, -3, -1, 1, 3, 5}.
The components of the residual vector are
p[1]+p[2]*exp(p[3]*x[i])-y[i].
The elements of the Jacobian matrix are
dg[i]/dp[1]=1, dg[i]/dp[2]=exp(p[3]*x[i]), dg[i]/dp[3]=p2[2]*x[i]*exp(p[3]*x[i]).
For a successful test the main() method must output the following values :
Parameters:
5.23225E2 -1.56839E2 -1.99778E-1
OUT:
7.22078E7
1.15716E2
1.72802E-3
1.65459E2
2.30000E1
2.20000E1
0.00000E0
Last residual vector:
-29.6 86.6 -47.3 -26.2 -22.9 39.5
Method Summary |
boolean |
funct(int m,
int n,
double[] par,
double[] rv)
|
void |
jacobian(int m,
int n,
double[] par,
double[] rv,
double[][] jac)
|
static void |
main(String[] args)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Test_marquardt
public Test_marquardt()
main
public static void main(String[] args)
funct
public boolean funct(int m,
int n,
double[] par,
double[] rv)
- Specified by:
funct
in interface AP_marquardt_methods
jacobian
public void jacobian(int m,
int n,
double[] par,
double[] rv,
double[][] jac)
- Specified by:
jacobian
in interface AP_marquardt_methods