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
271 B

  1. # Program 02a: A simple separable ODE. See Example 1.
  2. from sympy import dsolve, Eq, Function, symbols, pprint
  3. t = symbols('t')
  4. x = symbols('x', cls=Function)
  5. dxdt = x(t).diff(t)
  6. de = Eq(dxdt, -t/x(t))
  7. print('Program 02a:\n')
  8. pprint(de)
  9. sol = dsolve(de, x(t))
  10. pprint(sol)