필터 지우기
필터 지우기

How do i get a direction field plot?

조회 수: 48 (최근 30일)
Kelsey Pettrone
Kelsey Pettrone 2020년 11월 12일
답변: Durganshu 2020년 11월 12일
I need to get a direction field for this :
dx/dt = x(1.5 − x − 0.5y)
dy/dt = y(2 − y − 0.75x)
how would i do this?

답변 (1개)

Durganshu
Durganshu 2020년 11월 12일
Try this:
[x,y]=meshgrid(a:k:b, c:j:d)
meshgrid creates a set of points (x, y), where x lies between a and b, incremented by k, and y lies between c and d, incremented by j.
The given equation can be written like this:
y' = y*(2 − y − 0.75x) / (x*(1.5 − x − 0.5y))
dy = dt*y*(2 y 0.75*x);
dx = dt*x*(1.5 x 0.5*y);
quiver(a,b,x,y);
Now, quiver(a,b,x,y) begins at the point (a, b) and plots an arrow in the direction of the vector v = (x, y)
Afterwards, you can plot the graph.
Please refer to the following documentation for learning more on that:
Hope that helps!!

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by