Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
from scipy.integrate import odeint
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import animation
# phase space points y = (X, phi, X', phi')
# length in units of l
# time in units of 1 / \omega_P
#!/usr/bin/env python3
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import animation
# what to plot
def y(x, t):
return np.sin(x - t)
#!/usr/bin/env python3
import numpy as np
from scipy.integrate import odeint
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib import animation
# define constants/units