phase plane in MATLAB?

17 visualizaciones (últimos 30 días)
JIE YUANG LU
JIE YUANG LU el 10 de Nov. de 2016
Editada: JIE YUANG LU el 11 de Nov. de 2016
Hi I have a equations here, and I wonder it to do phase plane.How to do it?

Respuesta aceptada

Mischa Kim
Mischa Kim el 10 de Nov. de 2016
Hello, check out the code below:
function my_ODE()
th0 = 0;
Dth0 = 1;
tspan = linspace(0,2,200);
options = odeset('RelTol',1e-8,'AbsTol',1e-10);
[~,X] = ode45(@DE, tspan,[th0; Dth0],options);
plot(X(:,1),X(:,2))
grid
end
function dX = DE(~,x)
dX = [x(2); u(x(1))];
end
function uval = u(x1)
if (x1 < 0)
uval = +5;
else
uval = -5;
end
end
  1 comentario
JIE YUANG LU
JIE YUANG LU el 11 de Nov. de 2016
Editada: JIE YUANG LU el 11 de Nov. de 2016
so when I change U condition which code to change? and what is DE?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Transmitters and Receivers en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by