MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Data fitting from coupled differential equations

  • To: mathgroup at
  • Subject: [mg93291] Data fitting from coupled differential equations
  • From: margeorias at
  • Date: Mon, 3 Nov 2008 05:25:11 -0500 (EST)


I'm working on a predator-prey model for 2-species:
n1'[t] == a1 n1[t] - b1 n1[t]^2 + c1 n1[t] n2[t]
n2'[t] == a2 n2[t] - b2 n2[t]^2 + c2 n1[t] n2[t]
n1[0] == n10,
n2[0] == n20

I have real data for (t,n1[t],n2[t]), i.e. data={t,n1[t],n2[t]} and my
objective is to estimate the coefficients a1,a2,b1,b2,c1,c2.

To do this, I generate synthetic data by solving the above equations
using {n10,n20,a1,a2,b1,b2,c1,c2}={0.01,0.001,2,3,1,1,1,2} and sample
the solutions,i.e.
data = Table[{t, n1[t], n2[t]} /. sol, {t, 0, 20, 0.25}];

I then set-up the function below:

n1'[t]==a1 n1[t]-b1 n1[t]-c1 n1[t] n2[t],
n2'[t]==a2 n2[t]-b2 n2[t]-c2 n1[t] n2[t],

and use FindMinimum to retrieve the coefficients:

My problem however is that the resulting coefficients are not the same
as the original one, ie:

I can improve the results by making starting points very close to the
actual value of the coefficients i.e. {a1,2}. Well this somehow
defeats the purpose and in reality, I don't know whats the actual
value of the coefficients - they range from -Infinity to Infinity.How
do I go about obtaining the correct coefficients? Is there something
wrong with the function above?

Another thing, wouldn't NMinimize be appropriate for this as well
since I want to find the global minimum of sse? I have tried it but it
gave the wrong values for the coefficients as well :(

I'm trying to make FindFit work on the coupled differential equations
but no luck yet. Any guidance on this?

Appreciate any feedback you have.

Thanks again.

  • Prev by Date: Re: Aborting a computation ...
  • Next by Date: Re: Expressions with ellipsis (...)
  • Previous by thread: Re: Re: Mathematica 6.0: How to collect data with Manipulate?
  • Next by thread: Re: Data fitting from coupled differential equations