lsqnonlin parameter estimation performance

6 views (last 30 days)
Nath
Nath on 20 Jun 2014
Edited: Matt J on 21 Jun 2014
Hi There
I'm using lsqnonline to fit some data points to a chemical kinetic model (a set of differential equations). I'm testing the code based on the literature values already estimated and available. There are 7 parameters originaly which I cut down to 3 because of the lsqnonlin poor performance. So even by doing this and giving initial guess which is close to the true answer available, the solver fails. That means either it get stuck at the initial guess or if initial guess is a bit farther, it starts diverging giving complex numbers as the value for objective function. I've checked my objective function it returns reasonable values before hooking it to lsqnonlin.
I've tracked my objective function during the run and the progress is not good. The objective function is actually the scaled error (difference between data points and the prediction).
Also I test fmincon ,similar performance observed.I attached the code below any suggestion to make it faster and effective is appreciated:

Answers (1)

Matt J
Matt J on 21 Jun 2014
Edited: Matt J on 21 Jun 2014
You have expressions like pH2^2.5 = (f(5)*PT/FT)^2.5 in your differential equations. If there is nothing to prevent f(5) from going negative, this will give complex-valued results.
I tend to wonder whether the System Identification Toolbox would be more appropriate for this kind of thing. Guidelines in this thread might also be useful. I found that experimenting with DiffMinChange did yield some descent. I'm not a big fan of that approach, however.
  1 Comment
Matt J
Matt J on 21 Jun 2014
Edited: Matt J on 21 Jun 2014
Note that your lb,ub arguments are defined as scalars. Since your unknown vector is not a scalar, you should be getting warnings about this. I imagine you intended this instead,
lb(1:3)=0;
ub=[];

Sign in to comment.

Categories

Find more on Systems of Nonlinear Equations in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!