how to use pplane8 to plot some trajectories on a phase portrait

19 visualizaciones (últimos 30 días)
Muyu Zhou
Muyu Zhou el 16 de Oct. de 2020
Respondida: Prabhan Purwar el 19 de Oct. de 2020
i want to use pplane8 to plot some trajectories on a phase portrait from these code
tspan = [0 1]; % start and end times
v0 = 1; w0 = 2; % initial values
IC = [v0 w0];
% Call ode45
[t, vw] = ode45(@fn, tspan,IC);
% Extract individual solution values
v = vw(:,1);
w = vw(:,2);
% Plot results
plot(t,v,'r',t,w,'b'),grid
xlabel('t'),ylabel('v and w')
legend('v','w')
function dvwdt = fn(~,vw)
a = 0.8;
b = 0.7;
g = 0.08;
i = 1.25;
v = vw(1);
w = vw(2);
dvwdt = [v^3/3 - w + i;
g*(v+a-b*w)];
end

Respuestas (1)

Prabhan Purwar
Prabhan Purwar el 19 de Oct. de 2020
Hi,
pplane8 is one of the several submissions in MATLAB File Exchange on MATLAB Central which is a forum for our product users to interact, exchange information and knowledge, without MathWorks' involvement. Feel free to contact the author of this submission directly for specific questions about the implementation.
Thanks

Categorías

Más información sobre Ordinary Differential Equations 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