VanOsta2022 Regional Myocardial (Dys)function
The multipatch implementation of the wall module allows for simulationg regional wall mechanics. To initiate this, the wall can be split in multiple patches using the lines:
python
1model['Wall2022']['nPatch'][2:4] = [12, 6]
2
In this example, we apply a small heterogeneity in activation delay.
python
1model['Patch2022']['dT'][2:14] = np.linspace(0, 0.02, 12)
2model['Patch2022']['dT'][14:20] = np.linspace(0.01, 0.05, 6)
3
Running this simulation results in the following pressures, volumes, and regional fiber strain.
(Source code, png, hires.png, pdf)
![../../../_images/tutorial_regional_myocardial_mechanics.png](../../../_images/tutorial_regional_myocardial_mechanics.png)
The full code to generate this plot is shown below.
python
1"""
2Tutorial CircAdapt VanOsta2022.
3
4March 2023, by Nick van Osta
5
6This tutorial demonstrates how to model regional mechanics, how to change
7regional parameters and how to obtain and plot regional
8"""
9
10import numpy as np
11import matplotlib.pyplot as plt
12from circadapt import VanOsta2022
13
14# %% 1. load model
15model = VanOsta2022()
16
17# Split the LV in 12 and SV in 6 segments
18model['Wall2022']['nPatch'][2:4] = [12, 6]
19
20# Set activation delay
21model['Patch2022']['dT'][2:14] = np.linspace(0, 0.02, 12)
22model['Patch2022']['dT'][14:20] = np.linspace(0.01, 0.05, 6)
23
24# Run beats
25model.run(run_stable=True)
26
27# Plot data
28fig = plt.figure(2, figsize=(13, 4))
29ax1 = fig.add_subplot(1, 3, 1)
30ax2 = fig.add_subplot(1, 3, 2)
31ax3 = fig.add_subplot(1, 3, 3)
32
33# Plot pressure
34ax1.plot(model['Solver']['t']*1e3,
35 model['Cavity']['p'][:, ['cLv', 'SyArt', 'La']]*7.5e-3,
36 )
37
38# Plot Volume
39ax2.plot(model['Solver']['t']*1e3,
40 model['Cavity']['V'][:, ['cLv', 'La']]*1e6,
41 )
42
43# Plot natural fiber strain
44ax3.plot(model['Solver']['t']*1e3,
45 model['Patch2022']['Ef'][:, 2:20],
46 )
47
48# plot design, add labels
49for ax in [ax1, ax2, ax3]:
50 ax.spines[['right', 'top']].set_visible(False)
51ax2.set_xlabel('Time [ms]', fontsize=12)
52
53ax1.set_ylabel('$p$ [mmHg]', fontsize=12)
54ax2.set_ylabel('$V$ [mL]', fontsize=12)
55ax3.set_ylabel('$\epsilon$ [-]', fontsize=12)
56
57ax1.set_title('Pressure',
58 fontsize=12, fontweight='bold')
59ax2.set_title('Volume',
60 fontsize=12, fontweight='bold')
61ax3.set_title('Natural Fiber Strain',
62 fontsize=12, fontweight='bold')
63
64fig.suptitle('Simulating regional myocardial deformation. ',
65 fontsize=15, fontweight='bold')
66
67plt.tight_layout()
68plt.draw()