fix:muscular flagella example nu and shear modulus
__doc__ = """Muscular flagella example from Zhang et. al. Nature Comm 2019 paper."""
import sys
-
+import numpy as np
sys.path.append("../../")
from elastica import *
@@ -39,6 +39,7 @@ density_body = 0.965e-3 # g/mm3
base_length_body = 1.927 # mm
E = 3.86e6 # MPa
poisson_ratio = 0.5
+shear_modulus = E / (poisson_ratio + 1.0)
base_radius_head = 0.02 # mm
base_radius_tail = 0.007 # mm
@@ -66,7 +67,7 @@ flagella_body = CosseratRod.straight_rod(
density_body,
nu_body,
E,
- poisson_ratio,
+ shear_modulus = shear_modulus,
)
# In order to match bending stiffness of the tail as given in below reference, recompute and
@@ -130,7 +131,8 @@ density_muscle = 2.6e-4 # g/mm3
base_radius_muscle = 0.01 # mm
base_length_muscle = 0.10756
E_muscle = 0.3e5 # MPa
-nu_muscle = 1e-6
+shear_modulus_muscle = E_muscle / (poisson_ratio + 1.0)
+nu_muscle = 1e-6 / density_muscle / (np.pi*base_radius_muscle**2)
# Start position of the muscle is the 4th element position of body. Lets use the exact location, because this will
# simplify the connection implementation.
@@ -151,7 +153,7 @@ flagella_muscle = CosseratRod.straight_rod(
density_muscle,
nu_muscle,
E_muscle,
- poisson_ratio,
+ shear_modulus=shear_modulus_muscle,
)
muscular_flagella_sim.append(flagella_muscle)
