vector fields in Matlab

5 ビュー (過去 30 日間)
Alvaro Mª Zumalacarregui Delgado
Alvaro Mª Zumalacarregui Delgado 2021 年 2 月 23 日
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

回答 (1 件)

darova
darova 2021 年 2 月 23 日
Here is the mistake
  1 件のコメント
Alvaro Mª Zumalacarregui Delgado
Alvaro Mª Zumalacarregui Delgado 2021 年 2 月 23 日
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?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSimulink についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by