- The algorithm has a notable effect on how the solver moves and stops. Levenberg-Marquardt is more effective in this case.
- The finite-difference derivative estimates from "lsqnonlin" are not reliable. I'm fairly sure it's because there is non-smoothness in the function. The finite-difference options I changed were an attempt to "smooth" out the estimation process.
- This page is a very useful resource for optimization of ODE simulations that covers this topic and more: https://www.mathworks.com/help/optim/ug/optimizing-a-simulation-or-ordinary-differential-equation.html
Why does "lsqnonlin" generates the result for 'x' that is equal to initial value 'x0'?
1 view (last 30 days)
In my MATLAB code, I use "lsqnonlin" to find the three parameters that would match the experimental curve. Using the “ode45” version in MATLAB, "lsqnonlin" generates the values for "x" that are equal to the initial values from "x0" and therefore it is not able to match the experimental data. Why using ode45 it is not able to match the experimental curve?
Regarding a better fit result, I was able to get a better match by changing a few solver parameters as follows:
options = optimoptions('lsqnonlin','Algorithm','Levenberg-Marquardt','FiniteDifferenceType','central','FiniteDifferenceStepSize',1e-2);
The main point is: