Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any way to solve a system of coupled differential equations in python?

Tags:

I've been working with sympy and scipy, but can't find or figure out how to solve a system of coupled differential equations (non-linear, first-order).

So is there any way to solve coupled differential equations?

The equations are of the form:

V11'(s) = -12*v12(s)**2 v22'(s) = 12*v12(s)**2 v12'(s) = 6*v11(s)*v12(s) - 6*v12(s)*v22(s) - 36*v12(s) 

with initial conditions for v11(s), v22(s), v12(s).

like image 817
bynx Avatar asked Jun 04 '13 04:06

bynx


People also ask

Can Python solve differential equations?

Differential equations are solved in Python with the Scipy. integrate package using function odeint or solve_ivp. t: Time points at which the solution should be reported. Additional internal points are often calculated to maintain accuracy of the solution but are not reported.


1 Answers

For the numerical solution of ODEs with scipy, see scipy.integrate.solve_ivp, scipy.integrate.odeint or scipy.integrate.ode.

Some examples are given in the SciPy Cookbook (scroll down to the section on "Ordinary Differential Equations").

like image 79
Warren Weckesser Avatar answered Dec 03 '22 06:12

Warren Weckesser