Get Jacobian when using problem-based approach in Optimization Toolbox
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Philipp Glira
am 19 Feb. 2021
Kommentiert: Alan Weiss
am 21 Feb. 2021
When using lsqnonlin to solve a least squares problem, the jacobian gets returned as last argument:
[x,resnorm,residual,exitflag,output,lambda,jacobian] = lsqnonlin(___)
However, when using the problem-based approach, the jacobian isn't returned:
[sol,fval,exitflag,output,lambda] = solve(___)
Is there any way to get the jacobian also in this case?
0 Kommentare
Akzeptierte Antwort
Alan Weiss
am 21 Feb. 2021
Unfortunately, you cannot get the Jacobian output when using the problem-based approach. If you need it, then convert your problem using prob2struct and sove using lsqnonlin.
Alan Weiss
MATLAB mathematical toolbox documentation
2 Kommentare
Alan Weiss
am 21 Feb. 2021
You are quite right, AD does not apply to the lsqnonlin version. The only thing that I can think to try sounds terrible: run using solve first, then feed that solution as a starting point into lsqnonlin in order to get a Jacobian estimate.
By the way, if you are showing me results from your real problem, then the first-order optimality output shows that the Jacobian is either zero or you have some bound constraints.
Alan Weiss
MATLAB mathematical toolbox documentation
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Systems of Nonlinear Equations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!