cubie.systemmodels.systems.threeCM

Three chamber cardiovascular model.

This module implements a three chamber cardiovascular model based on Antoine Pironet’s thesis , suitable for CUDA execution.

Classes

ThreeChamberModel([initial_values, ...])

Three chamber cardiovascular model.

class cubie.systemmodels.systems.threeCM.ThreeChamberModel(initial_values=None, parameters=None, constants=None, observables=None, precision=<class 'numpy.float64'>, default_initial_values={'V_a': 1.0, 'V_h': 1.0, 'V_v': 1.0}, default_parameters={'E_a': 0.0133, 'E_h': 0.52, 'E_v': 0.0624, 'R_c': 0.008771929824561403, 'R_i': 0.012, 'R_o': 1.0, 'V_s3': 2.0}, default_constants={}, default_observable_names=['P_a', 'P_v', 'P_h', 'Q_i', 'Q_o', 'Q_c'], num_drivers=1, **kwargs)[source]

Bases: GenericODE

Three chamber cardiovascular model.

A cardiovascular model with three chambers (heart, arteries, veins) as described in Antoine Pironet’s thesis[1]_.

Parameters:
  • initial_values (dict, optional) – Initial values for state variables (V_h, V_a, V_v).

  • parameters (dict, optional) – Parameter values for the system (E_h, E_a, E_v, R_i, R_o, R_c, V_s3).

  • constants (dict, optional) – Constants that are not expected to change between simulations.

  • observables (dict, optional) – Observable values to track (P_a, P_v, P_h, Q_i, Q_o, Q_c).

  • precision (numpy.dtype, optional) – Precision to use for calculations, by default np.float64.

  • default_initial_values (dict, optional) – Default initial values if not provided in initial_values.

  • default_parameters (dict, optional) – Default parameter values if not provided in parameters.

  • default_constants (dict, optional) – Default constant values if not provided in constants.

  • default_observable_names (list, optional) – Default observable names if not provided in observables.

  • num_drivers (int, optional) – Number of driver/forcing functions, by default 1.

  • **kwargs (dict) – Additional arguments.

Notes

State variables: - V_h: Volume in heart - V_a: Volume in arteries - V_v: Volume in veins

Parameters: - E_h: Elastance of Heart (e(t) multiplier) - E_a: Elastance of Arteries - E_v: Elastance of Ventricles - R_i: Resistance of input (mitral) valve - R_o: Resistance of output (atrial) valve - R_c: Resistance of circulation (arteries -> veins) - V_s3: Total stressed blood volume

Observables: - P_a: Pressure in arteries - P_v: Pressure in veins - P_h: Pressure in heart - Q_i: Flow through input valve (Mitral) - Q_o: Flow through output valve (Aortic) - Q_c: Flow in circulation

References

[1] A. Pironet. “Model-Based Prediction of the Response to Vascular

Therapy.” Unpublished doctoral thesis, ULiège - Université de Liège, 2016.

https://hdl.handle.net/2268/194747

__init__(initial_values=None, parameters=None, constants=None, observables=None, precision=<class 'numpy.float64'>, default_initial_values={'V_a': 1.0, 'V_h': 1.0, 'V_v': 1.0}, default_parameters={'E_a': 0.0133, 'E_h': 0.52, 'E_v': 0.0624, 'R_c': 0.008771929824561403, 'R_i': 0.012, 'R_o': 1.0, 'V_s3': 2.0}, default_constants={}, default_observable_names=['P_a', 'P_v', 'P_h', 'Q_i', 'Q_o', 'Q_c'], num_drivers=1, **kwargs)[source]

Initialize the three chamber model.

Parameters:
  • initial_values (dict, optional) – Initial values for state variables.

  • parameters (dict, optional) – Parameter values for the system.

  • constants (dict, optional) – Constants that are not expected to change between simulations.

  • observables (dict, optional) – Observable values to track.

  • precision (numpy.dtype, optional) – Precision to use for calculations, by default np.float64.

  • default_initial_values (dict, optional) – Default initial values if not provided in initial_values.

  • default_parameters (dict, optional) – Default parameter values if not provided in parameters.

  • default_constants (dict, optional) – Default constant values if not provided in constants.

  • default_observable_names (list, optional) – Default observable names if not provided in observables.

  • num_drivers (int, optional) – Number of driver/forcing functions, by default 1.

  • **kwargs (dict) – Additional arguments.

Notes

num_drivers probably shouldn’t be an instantiation parameter, but rather a property of the system.

build()[source]

Build the CUDA device function for the three chamber model.

Returns:

Compiled CUDA device function implementing the three chamber cardiovascular dynamics.

Return type:

function

correct_answer_python(states, parameters, drivers)[source]

Python version of the three chamber model for testing.

More-direct port of Nic Davey’s MATLAB implementation.

Parameters:
  • states (numpy.ndarray) – Current state values [V_h, V_a, V_v].

  • parameters (numpy.ndarray) – Parameter values [E_h, E_a, E_v, R_i, R_o, R_c, V_s3].

  • drivers (numpy.ndarray) – Driver/forcing values [e(t)].

Returns:

A tuple containing (dxdt, observables) arrays.

Return type:

tuple of numpy.ndarray