Does anybody know of any tutorial material that explains how to use Mathematica to fit parameter values used in a set of ordinary differential equations to experimental values stored in a comma separated variable (CSV) file, and assumes very basic Mathematica programming experience?

The ordinary differential equations are required to provide a time course simulation of the variables that is fitted to experimental data, in order to use the parameter values to predict hypothesis on the behavior of the system.

Thanks for any assistance.

  • $\begingroup$ @Steve Welcome to the forum. Please search the forum before you post a question!! Its happens often that the problem you are facing is already addressed before. Please look at this question mathematica.stackexchange.com/questions/6751/…. I hope this helps you. $\endgroup$ Jul 27, 2012 at 17:27
  • $\begingroup$ Also, it seems to me that you are posting two unrelated questions there. Please, if that is the case, separate them into two postings $\endgroup$ Jul 27, 2012 at 18:03
  • $\begingroup$ Another issue: the etcs in your functions (they are not equations, are they?) are not clear enough for me $\endgroup$ Jul 27, 2012 at 18:04
  • $\begingroup$ etc is "etcetera" to simplify what I was inserting. Sorry for posting a question that had been investigated in another post, if you are a moderator please feel free to delete this. I will investigate the forum post linked above and attempt to adapt it to my work. $\endgroup$
    – Steve
    Jul 27, 2012 at 18:44
  • $\begingroup$ What does ODE stand for? $\endgroup$
    – FredrikD
    Jul 27, 2012 at 19:02

1 Answer 1


I am not sure if I am following your problem. Perhaps this is a partial answer.

For solving ODEs like yours for a variable number of functions, you could do something like:

dims = 3;
k = RandomInteger[{-2, 2}, {dims, dims}];
  D[f[i, x], x] == Table[f[j, x], {j, dims}].k[[i]] && 
                                                 (D[f[i, x], x] /. x -> 0) == 1, {i, dims}], 
      Table[f[j, x], {j, dims}], x]

which of course is solvable only in some cases

Plot[Table[f[i, x] /. sol[[1]], {i, dims}], {x, 0, 1},Evaluated -> True]

Mathematica graphics

Note that the system you are solving is something like:

$\left\{f^{(0,1)}(1,x)=f(1,x) p[[1,1]]+f(2,x) p[[1,2]]+f(3,x) p[[1,3]]\land f^{(0,1)}(1,0)=1,\\ f^{(0,1)}(2,x)=f(1,x) p[[2,1]]+f(2,x) p[[2,2]]+f(3,x) p[[2,3]]\land f^{(0,1)}(2,0)=1, \\f^{(0,1)}(3,x)=f(1,x) p[[3,1]]+f(2,x) p[[3,2]]+f(3,x) p[[3,3]]\land f^{(0,1)}(3,0)=1\right\}$


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.