Solving 3 simultaneous first order differential equations
2 次查看(过去 30 天)
显示 更早的评论
I need to solve the following set of differential equations using MATLAB.
Here, um,Ks,Kp,a,sm,yxs,K1,K2-constant values s,p,x- variables
I am using the function ode45 for this. This is my program :
function dydt=react(t,y)
dydt=zeros(3,1);
um=0.71;
ks=37.72;
sm=510;
kp=160.83;
a=0.81;
yxs=0.03;
ms=0.0011;
k1=33.04;
k2=0.0001;
y=zeros(3,1);
x=y(1);
s=y(2);
p=y(3);
dx=(um*(s/(s+ks))*((1-(s/sm))^a)*(kp/(kp+p)))*x;
ds=-1*((um/yxs)*(s/(s+ks))*((1-(s/sm))^a)*(kp/(kp+p)) + ms)*x;
dp=(k1*(um*(s/(s+ks))*((1-(s/sm))^a)*(kp/(kp+p)))+k2)*x;
dydt=[dx;ds;dp];
On giving this command :
[T,Y]=ode45('react',[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],[0.2 100 0.2]);
or this command :
[T,Y]=ode45('react',[0 15],[0.2 100 0.2]);
All I get is this :
Y =
0.200000000000000 100 0.200000000000000 0.200000000000000 100 0.200000000000000 0.200000000000000 100 0.200000000000000 0.200000000000000 100 0.200000000000000 0.200000000000000 100 0.200000000000000 0.200000000000000 100 0.200000000000000 0.200000000000000 100 0.200000000000000 0.200000000000000 100 0.200000000000000 0.200000000000000 100 0.200000000000000 0.200000000000000 100 0.200000000000000 0.200000000000000 100 0.200000000000000 0.200000000000000 100 0.200000000000000 0.200000000000000 100 0.200000000000000 0.200000000000000 100 0.200000000000000 0.200000000000000 100 0.200000000000000 0.200000000000000 100 0.200000000000000 0.200000000000000 100 0.200000000000000 0.200000000000000 100 0.200000000000000 0.200000000000000 100 0.200000000000000 0.200000000000000 100 0.200000000000000 0.200000000000000 100 0.200000000000000 0.200000000000000 100 0.200000000000000 0.200000000000000 100 0.200000000000000 0.200000000000000 100 0.200000000000000 0.200000000000000 100 0.200000000000000 0.200000000000000 100 0.200000000000000 0.200000000000000 100 0.200000000000000 0.200000000000000 100 0.200000000000000 0.200000000000000 100 0.200000000000000 0.200000000000000 100 0.200000000000000 0.200000000000000 100 0.200000000000000 0.200000000000000 100 0.200000000000000 0.200000000000000 100 0.200000000000000 0.200000000000000 100 0.200000000000000 0.200000000000000 100 0.200000000000000 0.200000000000000 100 0.200000000000000 0.200000000000000 100 0.200000000000000 0.200000000000000 100 0.200000000000000 0.200000000000000 100 0.200000000000000 0.200000000000000 100 0.200000000000000 0.200000000000000 100 0.200000000000000
i.e the equations are not being solved. I am just getting the initial values of my inputs (i.e x,s,p) as the output.
Any help is appreciated.
1 个评论
Walter Roberson
2013-12-29
Should be merged with duplicate http://www.mathworks.co.uk/matlabcentral/answers/110772-solving-3-simultaneous-first-order-differential-equations
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Ordinary Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!