diff --git a/docs/examples/simulator/plot_mass_point_model.py b/docs/examples/simulator/plot_mass_point_model.py index bd615934f2d0d35007aac7fdaf9216e7ffbeb9d4..0b942fec7d3e3f487812db6ddc6cee85478296bf 100644 --- a/docs/examples/simulator/plot_mass_point_model.py +++ b/docs/examples/simulator/plot_mass_point_model.py @@ -104,3 +104,25 @@ import warnings warnings.filterwarnings("ignore") output = mpm.run(elevation=elevation, coulomb_friction=mu, turbulent_friction=xi, x0=x0, y0=y0) +# %% md +# The simulation returns time history of the mass point's location and velocity. +# Following plots show the simulation results. + +fig, ax = plt.subplots(3, 1, figsize=(10,6)) + +ax[0].set_xlabel('time (s)') +ax[0].set_ylabel('x') +ax[0].set_title("x-t plot") +ax[0].plot(output[:,0], output[:,1]) + +ax[1].set_xlabel('time (s)') +ax[1].set_ylabel('velocity') +ax[1].set_title("v-t plot") +ax[1].plot(output[:,0], output[:,5]) + +ax[2].set_xlabel('x') +ax[2].set_ylabel('velocity') +ax[2].set_title("x-v plot") +ax[2].plot(output[:,1], output[:,5]) + +plt.tight_layout()