matlab not using the variable i give it in differential equation

조회 수: 1 (최근 30일)
Ej
Ej 2022년 10월 3일
편집: Torsten 2022년 10월 3일
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