March 17, 2013 at 00:36 - by eelvex | no comments (Leave a comment)

Split like this to make a system:

\begin{align*}

\frac{d}{dx}{\phi_0} &= \phi_1\\

\frac{d}{dx}{\phi_1} &= -\phi_1^{2/3}(k\phi_0^{1/3} + c)

\end{align*}

where

1 2 3 4 5 6 7 8 9 10 11 12 13 14 | import scipy import scipy.integrate k = 1.0 c = 0.0 def system_d(phi, x=0): y = [phi[1], -phi[1]**(2/3)*(k*phi[0]**(1/3) + c)] return y if __name__ == "__main__": x = scipy.linspace(0, 15, 1000) phi_init = scipy.array([0, 0]) phi = scipy.integrate.odeint(system_d, phi_init, x) |

## no comments

RSS / trackback