Solve an ode using ode45

21 次查看(过去 30 天)
Mou Ab
Mou Ab 2020-3-24
回答: darova 2020-3-24
we have
T=10;
%% Discretization data
dt=0.1;
t=0:dt:T;
ds=0.2;
sigma=-5:ds:-4;
%% initial data
z0=0;
z1=1;
y0=[z0;z1];
function dydt = vdp1(t,y,sigma,f)
dydt =[0,1;sigma,0]*y+[0;f];
end
[t,Y] = ode45(@(t,y)vdp1(t,y,sigma,f),t,[z0; z1]);
plot(t,Y(:,1),t,Y(:,2))
xlabel('Time t');
ylabel('Solution y');
legend('y_1','y_2')
The previous program for sigma a constant. Now I want the solution for each sigma where
segma=-5:0.2:-4

回答(1 个)

darova
darova 2020-3-24
SOlution

类别

Help CenterFile Exchange 中查找有关 Ordinary Differential Equations 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by