How to plot a differential equation?
9 次查看(过去 30 天)
显示 更早的评论
Hello,
I've got the following differential equation: dN(t)/dt - ((k - (a*N(t)))*N(t)) = f(t) This is the logistic law of population growth. N(t) = #individuals. dN(t)/dt = the derivative of N(t) = change of # individuals = #individuals/s. k = velocity of growth = 1/s. a = an inhibition factor on the growth = 1/(#individual*s). f(t) = production function = #individual/s.
I want to plot this equation. How can I do this?
2 个评论
Torsten
2017-11-6
Do you want to plot the equation or the solution to the equation ?
Best wishes
Torsten.
回答(1 个)
Torsten
2017-11-6
编辑:Torsten
2017-11-6
ezplot(NSol,[0,4]);
Best wishes
Torsten.
3 个评论
Torsten
2017-11-6
ode = diff(N(t),t) == 2,309*N(t) - 2*N(t)^2;
I don't know what your ODE should look like, but the comma is wrong for certain.
Best wishes
Torsten.
Steven Lord
2017-11-6
Yes. The decimal separator in MATLAB is period (.) not comma (,), and to enter numbers in the thousands or greater omit the comma. The comma operator separates commands, elements in an array, or function input or output arguments.
Specify that coefficient as 2.309 or 2309 instead of 2,309.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Ordinary Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!