作业帮 > 英语 > 作业

关于mathematica画图的基本问题!

来源:学生作业帮 编辑:搜搜做题作业网作业帮 分类:英语作业 时间:2024/04/28 06:52:22
关于mathematica画图的基本问题!
式子
dn/dt=r n(1-n/k)-(m (n/a)^2)/(1+(n/a)^2)
a)
On one graph,plot the new predation term (2nd term on right hand side of equation (2)) between n = 0 and n = 100 with m = 5 and a = 1,10,20,50.Remember to label your axes and include a descriptive legend,and make sure the whole axis is shown.
b)
Solve equation (2) numerically between t = 0 and t = 10,using the initial condition n = 1 at t = 0 and the parameter values r = 0.1,k = 100,m = 5 and a = 20.Plot your solution on axes between n = 0 and n = 10,and with appropriate labels.
关于mathematica画图的基本问题!
第一问:
Plot[(m (n/a)^2)/(1 + (n/a)^2) /.{m -> 5,a -> {1,10,20,50}} //
Evaluate,{n,0,100},AxesLabel -> {"横坐标","纵坐标"},
PlotLegends -> {"a=1","a=10","a=20","a=50"},PlotRange->All]
第二问:
s = NDSolve[((n'[t] ==
r n[t] (1 - n[t]/k) - (m (n[t]/a)^2)/(1 + (n[t]/a)^2)) /.{r ->
1/10,k -> 100,m -> 5,a -> 20}) \[And] n[0] == 1,
n,{t,0,10}];
Plot[Evaluate[n[t] /.s],{t,0,10},PlotRange -> All]