Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save GiovanniBalestrieri/98e3766cce5841982f8af6a387733c25 to your computer and use it in GitHub Desktop.
Save GiovanniBalestrieri/98e3766cce5841982f8af6a387733c25 to your computer and use it in GitHub Desktop.
Plot the solutions
"""
The "solve" function returns a Solution object which can be passed an array of points at which to evaluate the solution.
"""
A = numpy.linspace(0,TF, 101)
T = solution(A)
print T
"""
We can plot the solution using pylab with the following code
"""
import pylab
pylab.plot(A, T[0,:],'b-',label=('x(t)'))
pylab.plot(A, T[1,:],'v',label=('v(t)'))
pylab.xlabel('t')
pylab.grid()
pylab.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment