matlab not using the variable i give it in differential equation

1 次查看(过去 30 天)
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

回答(1 个)

Torsten
Torsten 2022-10-3
编辑:Torsten 2022-10-3
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 = 

类别

Help CenterFile Exchange 中查找有关 Calculus 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by