Understanding fsolve() output when number of function evaluations is exceeded

2 views (last 30 days)
Turing Machine
Turing Machine on 12 Jul 2021
Solving a nonlinear squared system of equations using fsolve(), in a simplified manner my code looks like this:
options = ('Display', 'iter', 'TolX', 1e-6, 'TolFun', 1e-6,...
'MaxFunEvals',1e7,'MaxIter',1e7);
x1 = fsolve(@(x) num_ss_Al(x), x0, options)
Now, when the maximum number of function evaluations is reached (or the number of iterations) the variable "x1" actually gets assigned a non-zero complex part vector, i.e.:
x1 =
1.0e+02 *
Columns 1 through 9
0.0214 + 0.0003i 0.0026 - 0.0000i 0.0100 + 0.0000i 0.1005 + 0.0000i 0.0004 - 0.0003i 0.0000 - 0.0001i -0.0002 - 0.0000i 0.0026 + 0.0000i 0.6752 - 0.0000i
Columns 10 through 18
0.6720 - 0.0000i 0.0097 + 0.0005i 0.0028 - 0.0002i 0.0086 + 0.0003i 0.0000 - 0.0000i 0.0025 - 0.0001i 0.0006 + 0.0000i 0.0026 - 0.0002i 0.0020 + 0.0001i
Columns 19 through 27
-0.0010 + 0.0001i 0.0051 - 0.0001i -0.0030 - 0.0001i 0.0001 - 0.0000i -0.0028 - 0.0001i -0.0045 - 0.0003i -0.0104 - 0.0003i -0.0048 + 0.0010i -0.0030 + 0.0002i
Columns 28 through 36
0.0017 + 0.0001i -0.0315 - 0.0038i 0.0100 - 0.0000i 0.0100 + 0.0000i 0.0100 + 0.0000i 0.0100 + 0.0000i 1.2980 - 0.0000i 0.0094 + 0.0000i 0.0096 + 0.0000i
Columns 37 through 45
0.0100 + 0.0000i 0.0100 + 0.0000i 0.0100 - 0.0000i 0.0107 - 0.0001i 0.0107 - 0.0001i 0.0185 - 0.0001i 0.0151 - 0.0000i 0.0273 - 0.0003i 0.0225 - 0.0001i
Columns 46 through 54
0.0191 - 0.0001i 0.0270 - 0.0004i 0.0081 + 0.0009i 0.0081 + 0.0009i -0.0002 + 0.0000i -0.0001 - 0.0000i 0.0094 + 0.0001i 0.0122 - 0.0013i 0.0106 - 0.0001i
Columns 55 through 63
0.0081 + 0.0009i 0.0003 - 0.0004i 0.0082 + 0.0001i 0.0089 - 0.0001i 0.0113 + 0.0006i 0.0005 - 0.0005i 0.0108 + 0.0006i 0.0096 + 0.0000i 0.0004 - 0.0003i
Columns 64 through 68
0.0001 - 0.0001i 0.0100 + 0.0000i 0.0135 + 0.0000i 0.0168 + 0.0000i 0.0136 - 0.0006i
What do those values correspond to given that the solver stopped prematurely? I thought first that they might be last iteration's evaluated values, but as far as I know and as stated in documentation the solution is a real vector or array, then for me it'd not be obvious why would numbers with non-zero imaginary part be evalutated. I'd appreciate some help in understanding this, thanks!

Answers (0)

Tags

Products


Release

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!