matlab not using the variable i give it in differential equation

1 Ansicht (letzte 30 Tage)
Ej
Ej am 3 Okt. 2022
Bearbeitet: Torsten am 3 Okt. 2022
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

Antworten (1)

Torsten
Torsten am 3 Okt. 2022
Bearbeitet: Torsten am 3 Okt. 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!

Translated by