# Plot of Predator and Prey model problem

I am trying to solve the following problem. I have the following constants and the differential equations.

r=1;
b=1;
c=0.01;
a=0.36;
a1=0.01;
a2=0.05;
c1=2;
c2=1;
μ=0.4;
m=0.01;
d=0.5;
e=15;

deq1 = x'[t] ==r* x[t]-b*x[t]^2-c*x[t]*y[t]-0.6*x[t]*y[t]/(a+x[t])-a1*x[t]z[t]/(e+x[t])
deq2 = y'[t] ==-μ*y[t]+0.6*x[t]*y[t]/(a+x[t])-a2*y[t]z[t]/(d+y[t])
deq3 = z'[t]==-m*z[t]+c1*a1*x[t]*z[t]/(e+x[t])+c2*a2*y[t]*z[t]/(d+y[t])
soln = NDSolve[{deq1, deq2,deq3, x[0] == 0.2, y[0] == 0.05,z[0]==0.05}, {x[t], y[t],z[t]}, {t, 0, 20000}]


But i can not create the 3D plot. Any advice?

One possible way

soln = NDSolveValue[{deq1, deq2, deq3, x[0] == 0.2, y[0] == 0.05,
z[0] == 0.05}, {x, y, z}, {t, 0, 6000}];


ParametricPlot3D[{soln[[1]][t], soln[[2]][t], soln[[3]][t]}, {t, 0,
4500}, AxesLabel -> {"x(t)", "y(t)", "z(t)"}, BaseStyle -> 14,
PlotRange -> All]


• Thank you so much! It was easier than I thought! Dec 1, 2022 at 0:43

You can use ParametricNDSolve to control your parameter values:

soln = ParametricNDSolve[{deq1, deq2, deq3, x[0] == 0.2, y[0] == 0.05,
z[0] == 0.05}, {x, y, z}, {t, 0, 20000}, {a, a1, a2, b, c, c1, c2,
d, e, m, r, μ}]


    ParametricPlot3D[