Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
import numpy
import pylab
A = .1
w = 0.25
T = 1
t = 2
while (t > 0.0):
x = numpy.arange(0.0, 1.0+0.01, 0.01)
s = A*numpy.cos(((((2*numpy.pi)/w)*(x)) - ((2*numpy.pi)/T)*t))
pylab.plot(x, s)
pylab.ylim(ymax = .15, ymin = -.15)
pylab.xlabel('Postion')
pylab.ylabel('Amplitude')
pylab.title('Cosine Function')
pylab.grid(True)
pylab.savefig("plot_%.2f.png" %t)
t = (t - 0.1)
pylab.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment