How to plot nullcline in matlab?

29 views (last 30 days)
Hi guys, I need to plot a set of ODEs' nullclines,
dL/dt = beta*Lext*Y-gamma*L;
dY/dt = delta+kfeed*L^4/(Kmfeed+L^4)-sigma*Y
here is my code:
beta=1; gamma=1; delta=0.2; Kmfeed=20; kfeed=2; sigma=1; Lext=2;
nullclineL=@(L)gamma.*L/(beta*Lext);
nullclineY=@(L)delta/sigma+kfeed.*L.^4/(sigma*(Kmfeed+L.^4));
L=1:.1:20;
figure(3)
plot(L,nullclineL(L),'b','LineWidth',2); hold on;
plot(L,nullclineY(L),'r','LineWidth',2);
the question is that i cannot get the second plot result, but i don't know what is wrong with that? Thanks for reading and possible help.
but I don't don't know why i cannot get the second plot reslut,

Accepted Answer

John D'Errico
John D'Errico on 5 May 2017
Edited: John D'Errico on 5 May 2017
It seems like you understand the need for .^ operators here. So why have you not chosen to use ./ when appropriate? (The .* operator can also be valuable, but it is not the problem here.)
Think about my question, then look at this line of code, as written by you:
nullclineY=@(L)delta/sigma+kfeed.*L.^4/(sigma*(Kmfeed+L.^4));

More Answers (0)

Categories

Find more on Programming in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!