ode45 求微分方程。

11 vues (au cours des 30 derniers jours)
fafoyix
fafoyix le 25 Nov 2022
M文件:
function dy=Acable_Fun(t,y)
global ksi w1 a1 a2 a3 a4 OmeggaA
dy = zeros(2,1);
dy(1) = y(2);
dy(2) =-2*ksi*w1*y(2)-(w1^2+a1*sin(OmeggaA*t))*y(1)-3*a2*y(1)^2-a3*y(1)^3-4*a4*sin(OmeggaA*t);
ksi=0.006;
w1=1.8692;
a1=0.1266;
OmeggaA=2*pi*0.2787;
a2=0.0551;
a3=0.0142;
a4=0.1228;
运行
[tA2,yA2]=ode45(@Acable_Fun,[0 500],[0 0]);figure(2),plot(tA2,yA2(:,1));xlabel('时间(s)');ylabel('跨中位移(m)');yAmax2=max(yA2(3500:end,1))

Réponse acceptée

libamoh
libamoh le 25 Nov 2022
function dy=Acable_Fun(t,y)
ksi=0.006;
w1=1.8692;
a1=0.1266;
OmeggaA=2*pi*0.2787;
a2=0.0551;
a3=0.0142;
a4=0.1228;
dy = zeros(2,1);
dy(1) = y(2);
dy(2) =-2*ksi*w1*y(2)-(w1^2+a1*sin(OmeggaA*t))*y(1)-3*a2*y(1)^2-a3*y(1)^3-4*a4*sin(OmeggaA*t);
[tA2,yA2]=ode45(@Acable_Fun,[0 500],[0 0]);figure(2),plot(tA2,yA2(:,1));xlabel('时间(s)');ylabel('跨中位移(m)');yAmax2=max(yA2(3500:end,1))

Plus de réponses (0)

Catégories

En savoir plus sur 编程 dans Help Center et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!