matlab not using the variable i give it in differential equation

1 view (last 30 days)
i try giving matlab values for my variable but it does not use them.
>> syms k N t
>> k = 0.025;
>> N = 1000;
>> dsolve('DP=k*P*(1-(P/N))', 'P(0)=200')
ans =
N/(exp(log(N/200 - 1) - k*t) + 1)
How do i get it to give me the same equation but with the values if k and N plugged in

Answers (1)

Torsten
Torsten on 3 Oct 2022
Edited: Torsten on 3 Oct 2022
syms k N t P(t)
knum = 0.025;
Nnum = 1000;
sol = simplify(dsolve(diff(P,t)==k*P*(1-(P/N)), P(0)==200))
sol = 
sol = subs(sol,[k N],[knum,Nnum])
sol = 

Community Treasure Hunt

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

Start Hunting!