I need to solve this system
显示 更早的评论

I need to solve this system ... I'm having problems ... I appreciate if I can help ..
syms x1(t) x2(t) y(t) E(t) O(t) t Y s(y) h(E) p(E) p q v
Dx1 = diff(x1);
Dx2 = diff(x2);
Dy = diff(y);
DE = diff(E);
DO = diff(O);
n = 0.5;
q1=0.0002;
q2=0.0001;
c1 = 0.4;
c2 = 0.3;
r1 = 0.005;
r2 = 0.006;
r3 = 0.008;
%Q(E) = 0.04;
c = 1;
d1 = 0.5;
l = 0.0234;
m = 0.04;
%equation1 = Dx1 == x1*g1(x1)-q1*x1*x2-(y*p1(x1)+r1*O*x1)*(1/(1+n*sin((2*pi*t)/365)));
equation1 = Dx1 == x1*((1000-x1)/2000)-q1*x1*x2-(y*(x1/(x1+800))+r1*O*x1)*(1/(1+n*sin((2*pi*t)/365)));
equation2 = Dx2 == x2*((900-x1)/1800)-q2*x1*x2-(y*(x2/(x2+750))+r2*O*x2)*(1/(1+n*sin((2*pi*t)/365)));
equation3 = Dy == -s(y)*y+y* (c1*(x1/(x1+800))+c1*(x1/(x1+800))-r3*O)*(1/(1+n*sin((2*pi*t)/365)));
equation4 = DE == -E*h(E)+0.04;
%equation5 = DO == -d1*O+p(E);
%g1(x1)=(1000-x1)/2000;
%g2(x2)=(900-x1)/1800;
%p1(x1)=x1/(x1+800);
%p1(x2)=x1/(x1+800);
%p2(x2)=x2/(x2+750);
%s(y)=p*(q+y/v);
[VF,Sbs] = odeToVectorField(equation1, equation2, equation3, equation4, equation5)
odefcn = matlabFunction(VF, 'Vars',{x1,x2,y})
tv = linspace(0,30, 31);
ics = [81.8/132.8, -0.0255/83, 0.625, -0.255/16.6];
[T,Y] = ode45(odefcn, tv, ics);
figure
plot(T, Y)
grid
lgdstr = sprintfc('%s', Sbs);
legend(lgdstr, 'Location','W')
title('Graf1');
xlabel('Time [days]');
ylabel('graf2')
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Mathematics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!