Plotting nullclines in prey-predator model

조회 수: 22 (최근 30일)
Doaa Mahmoud
Doaa Mahmoud 2022년 10월 17일
댓글: Doaa Mahmoud 2022년 10월 23일
I want to plot these four function and I tried this code but I have a problem plotting "fs1" and "fs2" becaue I need each one of them to be plotted as one curve.
I realy need your help
Best Regards
clc
clear
close all
a=0.7;
b=0.6;
r=1.5;
k=12;
beta=0.5;
delta=0.25;
q1=0.25;
q2=0.1;
ET=5;
x=linspace(0, 10, 100);
fs1= (r.*x.*(1-x./k))./(a-b*r.*(1-x./k));
gs1= (x.*(a*beta-delta))/(b*delta);
fs2= -(x.*(k*(q1-r)+r.*x))./(a*k+b*k*(q1 - r)+b*r.*x);
gs2= -(x.*(q2+a*beta-delta))/(b*(q2-delta));
plot(x,fs1,'Color','k','LineWidth',1.5)
hold on
plot(x,gs1,'Color','g','LineWidth',1.5)
plot(x,fs2,'Color','b','LineWidth',1.5)
plot(x,gs2,'Color','r','LineWidth',1.5)
xlim([0 10])
ylim([0 20])
  댓글 수: 2
Sai Kiran
Sai Kiran 2022년 10월 20일
Hi,
I have a doubt regarding your query.
Do you want to plot fs1 and fs2 variables in the same plot? and gs1 & gs2 on another plot?
Can you please elaborate your query?
Doaa Mahmoud
Doaa Mahmoud 2022년 10월 23일
thanks alot for replying.
I knew what was the problem.it was value of one constant was incorrect

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

답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by