vector fields in Matlab

조회 수: 5 (최근 30일)
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

답변 (1개)

darova
darova 2021년 2월 23일
Here is the mistake
  댓글 수: 1
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?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Simulink에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by