> 其他 >
用matlab解二阶微分方程
y''(t)= -3 cos(2t) +2sin(t)+t-3.8
使用ode23或ode45
人气:398 ℃ 时间:2020-03-26 10:35:46
解答
function Myexamp1clear,clc,tspan = [0 20]; % t 的取值范围y0=[0;1]; % 初始值 y(t0) 和 y'(t0)options = odeset('RelTol',1e-4,'AbsTol',[1e-4 1e-4]);[t,y] = ode45(@fun,tspan,y0 ,options);plot(t,y(:,1),'-',...
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版