--- Imports --- -- Goal -- import Pendulum import Goal.Core import Goal.Geometry import Goal.Simulation --- Globals --- qdq0 = fromList (Bundle pndl) [0,0] --- Main --- main = do let rnbl = toRenderable . execEC $ do vectorFieldLayout layout_title .= "Pendulum Vector Field" plot . fmap plotVectorField . liftEC $ do vectorFieldPlot $ opaque red plot_vectors_mapf .= sliceVectorField 0.1 0 f qdq0 plot_vectors_title .= "Damped" plot . fmap plotVectorField . liftEC $ do vectorFieldPlot $ opaque blue plot_vectors_mapf .= sliceVectorField 0.1 0 fg qdq0 plot_vectors_title .= "Conservative" void $ renderableToAspectWindow False 800 800 rnbl --void $ renderableToFile (FileOptions (400,400) PDF) "vector-field.pdf" rnbl