用matlab求解微分方程!dy/dx=((1-0.786)^1.33)*((3*p1*x^2+2*p2*x+p3)/(p1*x^3+p2*x^2+p3*x+p4))*y其中 x=2008时,y=20.83*10^6 p1 = -57.924 p2 = 3.4558e+005 p3 = -6.8719e+008 p4 = 4.5547e+011求出y与x的方程,和画图 x的范围1990-2025
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/27 15:27:47
用matlab求解微分方程!dy/dx=((1-0.786)^1.33)*((3*p1*x^2+2*p2*x+p3)/(p1*x^3+p2*x^2+p3*x+p4))*y其中 x=2008时,y=20.83*10^6 p1 = -57.924 p2 = 3.4558e+005 p3 = -6.8719e+008 p4 = 4.5547e+011求出y与x的方程,和画图 x的范围1990-2025
用matlab求解微分方程!dy/dx=((1-0.786)^1.33)*((3*p1*x^2+2*p2*x+p3)/(p1*x^3+p2*x^2+p3*x+p4))*y
其中 x=2008时,y=20.83*10^6
p1 = -57.924
p2 = 3.4558e+005
p3 = -6.8719e+008
p4 = 4.5547e+011
求出y与x的方程,和画图 x的范围1990-2025
用matlab求解微分方程!dy/dx=((1-0.786)^1.33)*((3*p1*x^2+2*p2*x+p3)/(p1*x^3+p2*x^2+p3*x+p4))*y其中 x=2008时,y=20.83*10^6 p1 = -57.924 p2 = 3.4558e+005 p3 = -6.8719e+008 p4 = 4.5547e+011求出y与x的方程,和画图 x的范围1990-2025
%%%%%%%%%%%%%%%%%%% 求解主体代码 %%%%%%%%%%%%%%%%%
clear;clc;
close all;
options = odeset('RelTol',1e-4,'AbsTol',1e-5);
[X1,Y1] = ode45(@aatest,[2008 2025],20.83E6,options);
[X2,Y2] = ode45(@aatest,[2008 1990],20.83E6,options);
figure;
hold on;
grid on;
plot(X1,Y1/1E6)
plot(X2,Y2/1E6)
%%%%%%%%%%%%%%%%%%% 微分方程对应函数 %%%%%%%%%%%%%%%%%
function dy=aatest(x,y)
p1 = -57.924;
p2 = 3.4558e+005;
p3 = -6.8719e+008;
p4 = 4.5547e+011;
dy=((1-0.786)^1.33)*((3*p1*x^2+2*p2*x+p3)/(p1*x^3+p2*x^2+p3*x+p4))*y;
结果图