Models
This module contains computational models relevant to bone remodelling analysis at macro- and organ-level scales. The Lerebours Model implements the spatial component of the bone remodelling model based on the work of Lerebours et al. (2016). It initialises a cross-section and simulates the spatial distribution of bone volume fractions over time under various remodelling conditions. The model calls the respective bone cell population model for each RVE.
Lerebours Model
- class bone_models.bone_spatial_models.models.lerebours_model.Lerebours_Model(load_case, duration_of_simulation=3)[source]
Bases:
objectOrchestrates the multiscale spatial simulation of bone remodeling.
This class manages a 2D cross-section of bone (e.g., a femur midshaft) represented as a grid of Representative Volume Elements (RVEs). It couples macroscopic mechanical loading with local Bone Cell Population Models (BCPM).
Note
Source Publication: Lerebours, C., Buenzli, P. R., Scheiner, S., & Pivonka, P. (2016). A multiscale mechanobiological model of bone remodeling predicts site-specific bone loss in the femur during osteoporosis and mechanical disuse. Biomechanics and Modeling in Mechanobiology, 15(1), 43-67. DOI: 10.1007/s10237-015-0705-x
Initializes the spatial model parameters and simulation timing.
- Parameters:
load_case (Load_Case) – Object defining the mechanical loading scenario.
duration_of_simulation (int) – Simulation length in years.
- calculate_normal_force_center(cross_section)[source]
Calculates the stiffness-weighted centroid (neutral axis) of the bone.
- Parameters:
cross_section (pandas.DataFrame) – Current spatial data (coordinates and stiffness for each RVE).
- Returns:
Tuple of (y_nf_center, z_nf_center, total_axial_stiffness).
- Return type:
tuple
- calculate_second_moments_of_area(cross_section, y_normal_force_center, z_normal_force_center)[source]
Computes the stiffness-weighted second moments and product of area.
- Parameters:
cross_section (pandas.DataFrame) – Current spatial data (coordinates and stiffness for each RVE).
y_normal_force_center (float) – Y-coordinate of the neutral axis.
z_normal_force_center (float) – Z-coordinate of the neutral axis.
- Returns:
Tuple of (Iyy, Izz, Iyz).
- Return type:
tuple
- calculate_stiffness_for_all_RVEs(cross_section)[source]
Performs homogenization to find the effective longitudinal stiffness of each RVE.
Calls the BCPM homogenization methods to determine the macroscopic stiffness tensor based on local bone volume fraction.
- Parameters:
cross_section (pandas.DataFrame) – Current spatial data.
- Returns:
Updated cross-section with ‘Stiffness’ column (in Pa).
- Return type:
pandas.DataFrame
- calculate_strain_decomposition(cross_section, t)[source]
Decomposes global forces into axial strain and curvatures.
Solves the system of equations linking axial force and bending moments to the geometric stiffness matrix of the cross-section: determine normal force center, axial stiffness and second moments; insert in moment of area matrix and invert to calculate strain decomposition.
- Parameters:
cross_section (pandas.DataFrame) – Current spatial data.
t (float) – Current simulation time.
- Returns:
Tuple of (axial_strain, curvature_y, curvature_z, y_nf_center, z_nf_center).
- Return type:
tuple
- initialize_circular_cross_section()[source]
Generates an idealized circular bone cross-section with radial density zones.
Creates a grid-based geometry with an outer cortical ring and a transitional inner zone using a simple radial mask.
- Returns:
DataFrame containing coordinates (y, z) and initial BV/TV values.
- Return type:
pandas.DataFrame
- initialize_elliptical_cross_section()[source]
Generates an idealized elliptical femur midshaft cross-section.
Uses elliptical boundaries to define three distinct zones: dense cortical bone, transitional cortex, and the medullary cavity (marrow).
- Returns:
DataFrame containing coordinates (y, z) and initial BV/TV values.
- Return type:
pandas.DataFrame
- solve_spatial_model(only_initialize=False)[source]
Executes the multiscale simulation loop over the specified duration.
The solver iterates through time intervals, updating local cell populations via BCPMs and periodically recalculating the macroscopic stress distribution based on changed bone density/stiffness.
For initialization, each RVE gets one BCPM instance with mechanical environment depending on the local bone volume fraction and the steady-state is calculated. All BCPMs in the cross-section are solved over time intervals, after each the macroscopic mechanics (“global” stress tensor) are updated. The results are saved at the end of each interval and represent the initial condition for the next interval with the “new” macro stress tensor.
- Parameters:
only_initialize (bool) – If True, returns after setup without running the ODE solver.
- Returns:
Final cross-section state and a dictionary of temporal results.
- Return type:
tuple(pandas.DataFrame, dict)
- update_stress_tensor(cross_section, t)[source]
Recalculates the local axial stress for every RVE based on current stiffness.
Uses beam theory to decompose global forces and moments into local strains, then applies the constitutive law to find local stress.
Note
Mapped to internal z-direction (stress_xx index [2,2]) to align the longitudinal axis across different coordinate conventions (Scheiner 2013 v. Lerebours 2016).
- Parameters:
cross_section (pandas.DataFrame) – Current spatial data of the bone.
t (float or None) – Current simulation time.
- Returns:
Updated cross-section with ‘stress_xx’ values.
- Return type:
pandas.DataFrame