# File:    ex5python2.py
# Purpose: solves task 1.a) on exercise sheet 5: domain wall for small kappa
# Linking: needs scipy, numpy, matplotlib (or other plotting package)
# Author:  Sarah B. Etter, 22 October 2014


from scipy.integrate import odeint
import matplotlib.pyplot as plt
import numpy as np

#set up the equations
def equ(y,x):
    return (y[1],-y[0]+y[0]*y[0]*y[0])  #need indent here

#set up the space
xspace = np.linspace(0,5,100)

#set up the initial values
init = np.array([0,1/np.sqrt(2)]) #shooting method: try different values here

#solver
y = odeint(equ,init,xspace)

#plot result
plt.plot(xspace,y[:,0])
plt.show()

