ODE solver: how to integrate a system with a vector of parameters?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Uladzislau
el 24 de En. de 2020
Comentada: Uladzislau
el 24 de En. de 2020
Hello! I would like to ask how can I solve the system below for V varying from 1 to 1.2 with step 0.001? My aim is to plot bifurcation diagramm.
function [out] = chuaSmoothIris(~,in,alpha, beta, A, C, V)
x = in(1);
y = in(2);
z = in(3);
xdot = alpha*y - A*alpha*x^3 - C*alpha*x - V*alpha*x;
ydot = x - y + z;
zdot = -beta*y;
out = [xdot ydot zdot]';
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
t = [0 400];
y = [0.004 0 0];
alpha = 15.6;
beta = 28;
A = 0.002;
C = -1.3;
V = 1:0.001:1.2;
[t,y] = ode45(@(t, y) chuaSmoothIris(t, y, alpha', beta', A', C', V'), t, y );
0 comentarios
Respuesta aceptada
J. Alex Lee
el 24 de En. de 2020
Are you just looking for solving the ODE as many times as you have different values of V?
t = [0 400];
y = [0.004 0 0];
alpha = 15.6;
beta = 28;
A = 0.002;
C = -1.3;
V = 1:0.001:1.2;
for i = 1:length(V)
[t,y] = ode45(@(t, y) chuaSmoothIris(t, y, alpha', beta', A', C', V(i)), t, y );
end
3 comentarios
J. Alex Lee
el 24 de En. de 2020
Oops. It's because you are overwriting the variable y.
t = [0 400];
y0 = [0.004 0 0]; % give this a special name
alpha = 15.6;
beta = 28;
A = 0.002;
C = -1.3;
V = 1:0.001:1.2;
for i = 1:length(V)
[t,y] = ode45(@(t, y) chuaSmoothIris(t, y, alpha', beta', A', C', V(i)), t, y0 );
end
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!