Filter löschen
Filter löschen

vector fields in Matlab

4 Ansichten (letzte 30 Tage)
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

Antworten (1)

darova
darova am 23 Feb. 2021
Here is the mistake
  1 Kommentar
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?

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Simulink finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by