I was computing the solution for:
y' = ky(L-y)
the solution should be:
y(t) = C_{1} e^{0.6t} (2000 - y(t))
the value of C_{1} should be 2/3. Thus
y(t) = \frac{4000/3}{2/3 + e^{-0.6t}}
I believe I have followed the formula correctly and enter into the code, but it seems to be all wrong, this is the code:
using SymPy, Plots, LaTeXStrings, Plots.PlotMeasures
@syms q, t, r
@syms q()
# Computing IVP with SymPy
q(t).diff(t)
k = 0.0003
L = 2000
# Let Q' = kQ (L - Q)
diffeq = Eq(q(t).diff(t), k*q(t)*(L-q(t)) ); string(diffeq)
# To solve the ODE, pass it and the function to solve for to dsolve.
qt = dsolve(diffeq, q(t))
# To solve the Initial Value Problem q(0)=800
ivp = dsolve(diffeq, q(t), ics = Dict(q(0) => 800))
plot(y, 0,10,
legend=:topright, bottom_margin=5mm,
left_margin=5mm,
xlabel="years", ylabel="population",
label=L"y(t) = \frac{4000/3}{2/3 + e^{0.6 t}}",
size=(720, 360), tickfontsize=10)
What did I do wrong or is it because Logistic Differential Equation canβt be solved with dsolve?