Solve an ode using ode45

21 vues (au cours des 30 derniers jours)
Mou Ab
Mou Ab le 24 Mar 2020
Réponse apportée : darova le 24 Mar 2020
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

Réponses (1)

darova
darova le 24 Mar 2020
SOlution

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by