cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

System of Differential Equations with Parameters

ptc-2540139
1-Newbie

System of Differential Equations with Parameters

Hi, I have a system of 6 differential equations with unknown paramters. This paramters and the initial values are to be estimate later by a least square method, for example by using "minimize", based on measurements. Is it possible to solve the system with parameter and initial conditions in the same way as I can solve single differential equation? I give an example for 2 equations. For example f1(t,x,y,p) and f2(t,x,y,p) define the right site of the differential equation. T = 10 sec is the endpoint Now the solve block Given x'(t)=f1(t,x(t),y(t),p) x(0)=a y'(t)=f2(t,x(t),y(t),p) y(0)=b (F(p,a,b), G(p,a,b))^T = odesolve(x,y,t,T) This works for a single differential equation but I get an error for a system of differential equation. If I define all parameters explicitly, for example a=1, b=2, p is a vector of known values, the following code works very well. a=1 b=2 p=(3,4,5)^T Given x'(t)=f1(t,x(t),y(t),p) x(0)=a y'(t)=f2(t,x(t),y(t),p) y(0)=b (F, G)^T = odesolve(x,y,t,T) best regards and thanks for your help Uli
2 REPLIES 2

Yes, but you need to define the function so that it returns a vector of functions (all of the results at once). You assign the individual functions to individual names when you evaluate the function for some value of the parameters.

Hi Tom, thanks for your fast answer. Now the program works. Best regards Uli
Top Tags