how to plot 2D Vector field of a 3D ode
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello, I need a help please. Since i have ploted the vector field of my problem in 3D but unfortunetally i can not conclude the vector field around specific points. How can i plot 2D Vector field of a 3D ode?
Here is my code:
clear all; close all; clc
r=2;
b=150;
beta=1;
rho= 1.5;
delta= 0.3;
m= 2;
f=@(t,s)[r*(s(1)+s(2))-1/b*s(1)*(s(1)+s(2))-beta*s(1)*s(3)/(1+beta*s(1))-s(1)*(1+s(3)*s(2))/(1+s(3)) ;
s(1)*(1+s(3)*s(2))/(1+s(3))-1/b*s(2)*(s(1)+s(2))-rho*beta*s(2)*s(3)/(1+beta*s(2));
delta*s(1)*s(3)/(1+beta*s(1))+rho*delta*s(2)*s(3)/(1+beta*s(2))-m*s(3)];
[x1,y1,z1] = meshgrid(-2:2:10,-2:2:10,-2:2:10);
u = zeros(size(x1));
v = zeros(size(y1));
w = zeros(size(z1));
t=1;
for i = 1:numel(x1)
Yprime = f(t,[x1(i); y1(i); z1(i)]);
u(i) = Yprime(1);
v(i) = Yprime(2);
w(i) = Yprime(3);
end
q=quiver3(x1,y1,z1,u,v,w ,2); figure(gcf);
0 Kommentare
Antworten (1)
Star Strider
am 8 Dez. 2019
figure
q=quiver3(x1,y1,z1,u,v,w ,2); figure(gcf);
view(0, 90)
Make appropriate changes to get the result you want.
2 Kommentare
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!