matlab解微分方程组(急)!解这个微分方程组dx(1)=-k1*(x(1)+n*x(2))+g1*x(1)*x(3);dx(2)=-k2*(x(2)-n*x(1))+g2*x(2)*x(4);dx(3)=-(1+i1+abs(x(1))^2)*x(3)+i1-1;dx(4)=-(1+i2+abs(x(2))^2)*x(4)+i2-1;其中k1=1000;i1=4;i2=4;g1=10500;g2=4700;n=0.2
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/23 15:25:46
matlab解微分方程组(急)!解这个微分方程组dx(1)=-k1*(x(1)+n*x(2))+g1*x(1)*x(3);dx(2)=-k2*(x(2)-n*x(1))+g2*x(2)*x(4);dx(3)=-(1+i1+abs(x(1))^2)*x(3)+i1-1;dx(4)=-(1+i2+abs(x(2))^2)*x(4)+i2-1;其中k1=1000;i1=4;i2=4;g1=10500;g2=4700;n=0.2
matlab解微分方程组(急)!
解这个微分方程组
dx(1)=-k1*(x(1)+n*x(2))+g1*x(1)*x(3);
dx(2)=-k2*(x(2)-n*x(1))+g2*x(2)*x(4);
dx(3)=-(1+i1+abs(x(1))^2)*x(3)+i1-1;
dx(4)=-(1+i2+abs(x(2))^2)*x(4)+i2-1;
其中k1=1000;i1=4;i2=4;g1=10500;g2=4700;n=0.2;
再画出x(1)和k2的关系图
matlab解微分方程组(急)!解这个微分方程组dx(1)=-k1*(x(1)+n*x(2))+g1*x(1)*x(3);dx(2)=-k2*(x(2)-n*x(1))+g2*x(2)*x(4);dx(3)=-(1+i1+abs(x(1))^2)*x(3)+i1-1;dx(4)=-(1+i2+abs(x(2))^2)*x(4)+i2-1;其中k1=1000;i1=4;i2=4;g1=10500;g2=4700;n=0.2
昨天不是回了一个吗?
在Matlab下输入:edit,然后将下面两行百分号之间的内容,复制进去,保存
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function dxdt=zhidao_rk4_t55262177(t,x)
k1=1000;k2=1000;i1=4;i2=4;g1=10500;g2=4700;n=0.2; %把这个g2改成4700就可以了.
dxdt=[
-k1*(x(1)+n*x(2))+g1*x(1)*x(3);
-k2*(x(2)-n*x(1))+g2*x(2)*x(4);
-(1+i1+abs(x(1))^2)*x(3)+i1-1;
-(1+i2+abs(x(2))^2)*x(4)+i2-1;
];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
在Matlab下面输入:
t_start=0;
t_end=10;
xx0=[0;1;0;0]; %初值
[t,x]=ode45('zhidao_rk4_t55262177',[0,t_end],xx0);
plot(x(:,1),x(:,2));
xlabel('x(1)');
ylabel('x(2)');
%具体的可以看一下论坛:
%http://www.matlabsky.cn