Examples Lynch book
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

10 lines
295 B

# Program 02b: The logistic equation; example 4-ch2.
from sympy import dsolve, Eq, Function, symbols, pprint
t, b, d = symbols('t beta sigma')
P = symbols('P', cls=Function)
dPdt = P(t).diff(t)
de = Eq(dPdt, P(t)*(b-d*P(t)))
print('program 02b:\n')
pprint(de)
sol = dsolve(de, P(t))
pprint(sol)