用MATLAB求解符号微分方程组(求大虾帮忙)dx=ydy=x+y不太会用MATLAB
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/08 09:15:33
用MATLAB求解符号微分方程组(求大虾帮忙)dx=ydy=x+y不太会用MATLAB
用MATLAB求解符号微分方程组(求大虾帮忙)
dx=y
dy=x+y
不太会用MATLAB
用MATLAB求解符号微分方程组(求大虾帮忙)dx=ydy=x+y不太会用MATLAB
clc;clear;
[x,y]=dsolve('Dx=y','Dy=x+y')
%test检验
s1=diff(x)-y
s11=simplify(s1)
s2=diff(y)-x-y
s22=simplify(s2)
结果:
x =C1*exp((1/2+1/2*5^(1/2))*t)+C2*exp(-1/2*(5^(1/2)-1)*t)
y =C2*(-1/2*5^(1/2)+1/2)*exp(-1/2*(5^(1/2)-1)*t)+(1/2*exp(1/2*(5^(1/2)+1)*t)+1/2*exp(1/2*(5^(1/2)+1)*t)*5^(1/2))*C1
s1 =C1*(1/2+1/2*5^(1/2))*exp((1/2+1/2*5^(1/2))*t)-(1/2*exp(1/2*(5^(1/2)+1)*t)+1/2*exp(1/2*(5^(1/2)+1)*t)*5^(1/2))*C1
s11 =0
s2 = C2*(-1/2*5^(1/2)+1/2)^2*exp(-1/2*(5^(1/2)-1)*t)+(1/2*(1/2+1/2*5^(1/2))*exp(1/2*(5^(1/2)+1)*t)+1/2*(1/2+1/2*5^(1/2))*exp(1/2*(5^(1/2)+1)*t)*5^(1/2))*C1-C1*exp((1/2+1/2*5^(1/2))*t)-C2*exp(-1/2*(5^(1/2)-1)*t)-C2*(-1/2*5^(1/2)+1/2)*exp(-1/2*(5^(1/2)-1)*t)-(1/2*exp(1/2*(5^(1/2)+1)*t)+1/2*exp(1/2*(5^(1/2)+1)*t)*5^(1/2))*C1
s22 = 0