vector fields in Matlab

5 vues (au cours des 30 derniers jours)
Alvaro Mª Zumalacarregui Delgado
I am trying to create a vector field of a diferential equation system, I know what is the real vector field, but with my code I get another. I paste my code, the system, my vector field, which is wrong, and the good vector field, someone knows what part of my code is wrong?
my code:
x1=0;
x2=2;
y1=0;
y2=2;
N = 20;
x = linspace(x1,x2,N);
y = linspace(y1,y2,N);
[X,Y]= meshgrid(x,y);
m1 = a.*x.*y/b.*x.*y;
S1 = atan (m1);
U = - cos (S1);
V = - sin (S1);
[U,V]=meshgrid(U,V);
quiver (app.Axes2, X,Y,U,V);
the system
my vector field, that is wrong
the good one

Réponses (1)

darova
darova le 23 Fév 2021
Here is the mistake
  1 commentaire
Alvaro Mª Zumalacarregui Delgado
thanks because after correct that the field looks better, but if you look at the bottom of 'the good one' vectors are point and I have vectors like the top of 'the good one', so maybe the value of m1 is wrong, you know how to correct it?

Connectez-vous pour commenter.

Catégories

En savoir plus sur Simulink dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by