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

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