# Strange behaviour with ode45 in matlab, probably some numerical error.

I'm having a problem with a parameter estimation in a non-linear model. I think the culprit is that ode45 (an ode solver in matlab) is not properly solving my ode. It's the in red highlighted part, which very quickly drops and by this seems to ruin the fit.

Also interesting, this happens in all my data (10 patients) so it doesn't seem to be data dependant. I think this is stopping the optimum-fit algorithms from doing their job.

Anyone familiar with this behaviour?

EDIT: I'm working with 94 data points, and it drops between the first and the second point.

EDIT 2: It's solving the following, if this helps anyone:

$$\frac{d}{dt} y_{1}(t) = -p_{1}\cdot y_{1}(t)\; + \;p_{1}\cdot p_{2}\cdot Input(t)$$ $$\frac{d}{dt} y_2(t) = -\left(p_3+y_{1}(t)\right) \cdot y_2(t)\; +\; p_4 \;+\; R_A(t)$$

with $R(t)$ a well behaved function of time. • I don't think it's possible to tell what's going on from looking at this picture. What is the ode you're trying to solve? Are you expecting a curve that goes through the circles? – Robert Israel Jan 22 '12 at 20:32
• Actually, maybe it is possible to make a guess at the trouble: your ode may be singular at the initial point. In that case, no ODE solver is likely to do very well. – Robert Israel Jan 22 '12 at 20:35
• Sorry if I didn't make that clear. I'm trying to minimize the sum squared error between the data (dots) and the model prediction (line) by varying the parameters of the model. I'm using the Levenberg-Marquardt algorithm to do this for a system of 2 differential equations. – BallzofFury Jan 22 '12 at 20:36
• @Robert: Any ideas, if that is the case, how I might be able to get around this? It doesn't seem to be depending on the parameters, or the initial conditions of the ode. I also just tried starting it at a later time and that doesn't seem to help either. – BallzofFury Jan 22 '12 at 20:40
• You seem to be right. I've interpolated the data to intervals of 1, and the jump then happens in the first minute. – BallzofFury Jan 22 '12 at 21:03

• Have you looked at Eureqa Formulize at nutonian.com. It can help you with complex data fits. – ja72 Apr 24 '12 at 18:37