Hi,
i am solving the system of equations with fsolve and i wanted to see if passing the Jacobian in the parameters would speed up the calculation or give me better precision. However when i pass Jacobian solver gets stuck, function value doesnt get updated and solver finds no solution.
The following output without passing Jacobian
options.Algorithm = 'trustregionreflective';
options.Jacobian = 'off';
Norm of Firstorder
Iteration Funccount f(x) step optimality CGiterations
0 4 0.163213 0.0728
1 8 0.163213 10 0.0728 0
2 12 0.138438 2.5 0.014 0
3 16 0.0566581 5 0.231 0
4 20 0.0167072 5.80274 0.158 0
5 24 0.000309366 2.19373 0.0191 0
6 28 3.74928e07 0.474266 0.000655 0
7 32 5.99238e13 0.0168359 8.27e07 0
Equation solved.
The following output is when i pass Jacobian to fsolve
options.Algorithm = 'trustregionreflective';
options.Jacobian = 'on';
Norm of Firstorder
Iteration Funccount f(x) step optimality CGiterations
0 1 0.163213 0.0728
1 2 0.163213 10 0.0728 0
2 3 0.163213 2.5 0.0728 0
3 4 0.163213 0.625 0.0728 0
4 5 0.163213 0.15625 0.0728 0
5 6 0.163213 0.0390625 0.0728 0
6 7 0.163213 0.00976562 0.0728 0
7 8 0.163213 0.00244141 0.0728 0
8 9 0.163213 0.000610352 0.0728 0
9 10 0.163213 0.000152588 0.0728 0
10 11 0.163213 3.8147e05 0.0728 0
11 12 0.163213 9.53674e06 0.0728 0
12 13 0.163213 2.38419e06 0.0728 0
13 14 0.163213 5.96046e07 0.0728 0
No solution found.
fsolve stopped because the size of the current step is less than the
selected value of the step size tolerance, but the vector of function values
is not near zero as measured by the selected value of the function tolerance.
Can you kindly suggest what could i be possibly be doing wrong?
Im confident that Jacobian function i pass is correct. Is it some setting that i missed out?
Thank you
