Created
August 9, 2016 17:32
-
-
Save GiovanniBalestrieri/98e3766cce5841982f8af6a387733c25 to your computer and use it in GitHub Desktop.
Plot the solutions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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