Skip to content
Snippets Groups Projects
Commit 1e6c9379 authored by Hu Zhao's avatar Hu Zhao
Browse files

docs: add result plots for mpm example

parent e0c06ac1
No related branches found
No related tags found
No related merge requests found
...@@ -104,3 +104,25 @@ import warnings ...@@ -104,3 +104,25 @@ import warnings
warnings.filterwarnings("ignore") warnings.filterwarnings("ignore")
output = mpm.run(elevation=elevation, coulomb_friction=mu, turbulent_friction=xi, x0=x0, y0=y0) 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()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment