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

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