用matlab来解有5个变量的微分方程组
试了好多次都是Errorusing==>dsolve啊求大神求教!!!!!!!!!其中k=0.2,q=1/14,r1=10,r2=5,p=0.6,S(0)=9000','...
试了好多次都是 Error using ==> dsolve啊求大神求教!!!!!!!!!
其中
k=0.2,q=1/14, r1=10,r2=5,p=0.6,S(0)=9000','E(0)=500','I(0)=500','d(0)=2000 展开
其中
k=0.2,q=1/14, r1=10,r2=5,p=0.6,S(0)=9000','E(0)=500','I(0)=500','d(0)=2000 展开
展开全部
R(0)=? 这里取200
N=? 这里取1000
function dy = odefun(t,y)
dy = zeros(5,1);
S=y(1);
E=y(2);
I=y(3);
R=y(4);
D=y(5);
k=0.2;
q=1/14;
r1=10;
r2=5;
p=0.6;
N=1000;
h=(r1*E+r2*(1-p)*I)/(N-E-p*I-R-D);
dy(1) = -h*S;
dy(2) = h*S-k*E;
dy(3) = k*E-q*I;
dy(4) = q*I;
dy(5) = (1-q)*I;
clear;
clc;
[T,Y] = ode45(@odefun,[0 12],[9000 500 500 200 2000]);
N=? 这里取1000
function dy = odefun(t,y)
dy = zeros(5,1);
S=y(1);
E=y(2);
I=y(3);
R=y(4);
D=y(5);
k=0.2;
q=1/14;
r1=10;
r2=5;
p=0.6;
N=1000;
h=(r1*E+r2*(1-p)*I)/(N-E-p*I-R-D);
dy(1) = -h*S;
dy(2) = h*S-k*E;
dy(3) = k*E-q*I;
dy(4) = q*I;
dy(5) = (1-q)*I;
clear;
clc;
[T,Y] = ode45(@odefun,[0 12],[9000 500 500 200 2000]);
追答
晕。odefun是个函数,是来调用的
主函数是这个:
clear;
clc;
[T,Y] = ode45(@odefun,[0 12],[9000 500 500 0 2000]);
Sievers分析仪
2024-10-13 广告
2024-10-13 广告
是的。传统上,对于符合要求的内毒素检测,最终用户必须从标准内毒素库存瓶中构建至少一式两份三点标准曲线;必须有重复的阴性控制;每个样品和PPC必须一式两份。有了Sievers Eclipse内毒素检测仪,这些步骤可以通过使用预嵌入的内毒素标准...
点击进入详情页
本回答由Sievers分析仪提供
展开全部
如果是常微分方程,可以用dsolve函数。该函数可以解单变量常微分方程或者多变量常微分方程组,所以5个变量也不在话下。
调用格式如下:
[y1,...,yN] = dsolve(eqns) solves the system of ordinary differential equations eqns and assigns the solutions to the variables y1,...,yN.
如果有初始条件,可以把条件一起传给函数来定解:
[y1,...,yN] = dsolve(eqns,conds) solves the system of ordinary differential equations eqns with the initial or boundary conditions conds.
给出一个2个变量的微分方程组求解代码:
syms x(t) y(t)
z = dsolve(diff(x) == y, diff(y) == -x,x(0)==1,y(0)==1);
x=z.x,y=z.y
运行结果为:
x =
cos(t) + sin(t)
y =
cos(t) - sin(t)
调用格式如下:
[y1,...,yN] = dsolve(eqns) solves the system of ordinary differential equations eqns and assigns the solutions to the variables y1,...,yN.
如果有初始条件,可以把条件一起传给函数来定解:
[y1,...,yN] = dsolve(eqns,conds) solves the system of ordinary differential equations eqns with the initial or boundary conditions conds.
给出一个2个变量的微分方程组求解代码:
syms x(t) y(t)
z = dsolve(diff(x) == y, diff(y) == -x,x(0)==1,y(0)==1);
x=z.x,y=z.y
运行结果为:
x =
cos(t) + sin(t)
y =
cos(t) - sin(t)
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询