-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# # Bestel model | ||
|
||
# In this example we will show the both the pressure and activation model from Bestel et al. {cite}`bestel2001biomechanical`. | ||
|
||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
from scipy.integrate import solve_ivp | ||
|
||
from circulation import bestel | ||
|
||
# First let us define a time array | ||
|
||
t_eval = np.linspace(0, 1, 200) | ||
|
||
# Now we will solve the activation model | ||
|
||
activation = bestel.BestelActivation() | ||
result_activation = solve_ivp( | ||
activation, | ||
[0, 1], | ||
[0.0], | ||
t_eval=t_eval, | ||
method="Radau", | ||
) | ||
|
||
# and plot the results | ||
|
||
fig, ax = plt.subplots() | ||
ax.plot(result_activation.t, result_activation.y[0]) | ||
ax.set_xlabel("Time [s]") | ||
ax.set_ylabel("Active tension [Pa]") | ||
plt.show() | ||
|
||
# Now we will solve the pressure model | ||
|
||
pressure = bestel.BestelPressure() | ||
result_pressure = solve_ivp( | ||
pressure, | ||
[0, 1], | ||
[0.0], | ||
t_eval=t_eval, | ||
method="Radau", | ||
) | ||
|
||
# and plot the results | ||
|
||
fig, ax = plt.subplots() | ||
ax.plot(result_pressure.t, result_pressure.y[0]) | ||
ax.set_xlabel("Time [s]") | ||
ax.set_ylabel("Pressure [Pa]") | ||
plt.show() | ||
|
||
# # References | ||
# ```{bibliography} | ||
# :filter: docname in docnames | ||
# ``` |