圆捕快 2022-05-06 16:51
浏览 322
已结题

MATLAB求解微分方程组时报错该怎么解决

问题遇到的现象和发生背景
使用MATLAB求解微分方程组时报错

问题相关代码

clear,clc
syms S(t) E(t) I(t) A(t) Q(t) R(t);
%od
ode1=diff(S,t)==(-1)*9.77174671*(I+0.5*A+0.5*E)*(I+0.5*A+0.5*E)/0.776;
ode2=diff(E,t)==9.77174671*(I+0.5*A+0.5*E)*(I+0.5*A)/0.776-4.7*E;
ode3=diff(I,t)==9.77174671*(I+0.5*A+0.5*E)*S-25.3458333*I;
ode4=diff(A,t)==9.77174671*(I+0.5*A+0.5*E)*S-0.5*25.3458333*A;
ode5=diff(Q,t)==0.8458333*(I+A)-24.5*Q;
ode6=diff(R,t)==24.5*(I+A)+23.7*Q;
ode=[ode1,ode2,ode3,ode4,ode5,ode6];
%cond
cond1=S(0)==24870895;
cond2=E(0)==0;
cond3=I(0)==56;
cond4=A(0)==18;
cond5=Q(0)==0;
cond6=R(0)==0;
cond=[cond1,cond2,cond3,cond4,cond5,cond6];
[Ss(t),Es(t),Is(t),As(t),Qs(t),Rs(t)]=dsolve(ode,cond);

img

报错结果

警告: Explicit solution could not be found.
In dsolve (line 201)https://pic1.zhimg.com/80/v2-f445b6d5437bd26918b2a149002ff88d_720w.png
In moxing2 (line 19)
错误使用 sym/subsindex (line 766)
Invalid indexing or function definition. When defining a function, ensure that the arguments are symbolic variables and the body of the function is a SYM expression.
When indexing, the input must be numeric, logical, or ':'.
出错 moxing2 (line 19)
[Ss(t),Es(t),Is(t),As(t),Qs(t),Rs(t)]=dsolve(ode,cond);

我想要达到的结果
不再报错

谢谢大家!

  • 写回答

0条回答 默认 最新

    报告相同问题?

    问题事件

    • 系统已结题 5月14日
    • 创建了问题 5月6日

    悬赏问题

    • ¥15 无法输出helloworld
    • ¥15 高通uboot 打印ubi init err 22
    • ¥20 PDF元数据中的XMP媒体管理属性
    • ¥15 R语言中lasso回归报错
    • ¥15 网站突然不能访问了,上午还好好的
    • ¥15 有没有dl可以帮弄”我去图书馆”秒选道具和积分
    • ¥15 semrush,SEO,内嵌网站,api
    • ¥15 Stata:为什么reghdfe后的因变量没有被发现识别啊
    • ¥15 振荡电路,ADS仿真
    • ¥15 关于#c语言#的问题,请各位专家解答!