PK models

class AtracuriumModel(Patient_characteristic: list, model: str = None, model_params: dict = None, ts: float = 1, x0: ndarray = None)

Bases: object

AtracuriumModel class modelize the linear part of the PK-PD model of atracurium drug. Simulate the drug distribution in the body.

The model is a LTI model with the form:

\[x(k+1)= Ax(k) + Bu(k)\]
\[y(k) = Cx(k)\]

The state vector is the concentration of the drug in each compartement.

Parameters:
Patient_characteristic: list

Patient_characteristic = [age (yr), height(cm), weight(kg), sex(0: female, 1: male)]

modelstr, optional

“WardWeatherleyLago”[Ward1983,Weatherley1983,Lago1998]_. The default is “WardWeatherleyLago”.

model_paramsdict, optional

For “WardWeatherleyLago”:

  • ‘V1’: Volume of the central compartment (ml/kg)

  • ‘V2’: Volume of the peripheral compartment (ml/kg)

  • ‘Cl’: Clearance (ml/min/kg)

  • ‘t12_alpha’: First half live time (min)

  • ‘t12_beta’: Second half live time (min)

  • ‘ke0’: Transfer rate of the first effect-site compartment (1/min)

  • ‘tau’: Time constant of the second effect-site compartment (min)

If it is not provided average values are used.

tsfloat, optional

Sampling time, in s. The default is 1.

x0np.ndarray, optional

Initial conditions of the model. The default is np.zeros((len(A), 1)).

Attributes:
tsfloat

Sampling time, in s.

continuous_syscontrol.StateSpace

Continuous state space model.

discrete_syscontrol.StateSpace

Discrete state space model.

xnp.ndarray

State vector.

ynp.ndarray

Output vector (hypnotic effect site concentration).

References

[Ward1983]

S. Ward et al., “Pharmacokinetics of Atracurium Besylate in Healty Patients (after a single i.v. bolus dose),” British Journal of Anesthesia, vol. 55, no. 2, pp. 113-116, Feb. 1983, doi: 10.1093/bja/55.2.113.

[Weatherley1983]

B. Weatherley et al., “Pharmacokinetics, Pharmacodynamics and Dose-Response Relationship of Atracurium Administered i.v.” British Journal of Anesthesia, vol. 55, Suppl. 1, pp. 39S-45S, Jan. 1983.

[Lago1998]

P. Lago et al., “On-Line Autocalibration of a PID Controller of Neuromuscular Blockade” Proceedings of the 1998 IEEE International Conference on Control Applications (Cat. No.98CH36104), Trieste, Italy, Vol. 1, pp. 363-367, Sept. 1998, doi: 10.1109/CCA.1998.728448.

full_sim(u: ndarray, x0: ndarray | None = None, interp=False) list

Simulate the model with a given input.

Parameters:
ulist

Infusion rate [mg/s].

x0numpy array, optional

Initial state. The default is None.

interpbool, optional

Whether to use zero-order-hold (False, the default) or linear (True) interpolation for the input array.

Returns:
numpy array

List of the states value during the simulation.

get_system_gain()

Compute the steady-state (DC) gain of the atracurium model.

The steady-state gain is the ratio of the output to the input when the system reaches equilibrium. For a stable LTI system, this is given by:

\[G_{ss} = C (-A)^{-1} B + D\]

where ( A, B, C, D ) are the state-space matrices.

Returns:
float

The scalar steady-state gain of the system (assumes SISO or extracts [0,0] for MIMO).

initialize_state(x0: ndarray)

Initialize the state vector

Parameters:
x0numpy array

Initial state vector.

one_step(u: float) list

Simulate one step of the model.

\[x^+ = Ax + Bu\]
\[y = Cx\]
Parameters:
ufloat

Infusion rate (µg/s).

Returns:
numpy array

Actual effect site concentration (µg/mL).

class CompartmentModel(Patient_characteristic: list, lbm: float, drug: str, model: str = None, ts: float = 1, random: bool | None = False, x0: ndarray | None = None, opiate: bool | None = True, measurement: str | None = 'arterial', truncated: float | None = None)

Bases: object

PKmodel class modelize the PK model of propofol, remifentanil or norepinephrine drug. Simulate the drug distribution in the body.

Use a 6 compartement model for propofol, a 5 compartement model for remifentanil and a 1 compartement model for norepinephrine. The model is a LTI model with the form:

\[x(k+1)= Ax(k) + Bu(k)\]
\[y(k) = Cx(k)\]

The state vector is the concentration of the drug in each compartement in the following order:

  • blood, muscles, fat, BIS effect-site, MAP effect-site 1, MAP effect-site 2 for propofol;

  • blood, muscles, fat, BIS effect-site, MAP effect-site 1 for remifentanil;

  • blood for norepinephrine;

The output of the model is:

  • the BIS effect-site concentration for propofol and remifentanil;

  • the blood concentration for norepinephrine;

Parameters:
Patient_characteristic: list

Patient_characteristic = [age (yr), height(cm), weight(kg), sex(0: female, 1: male)]

lbmfloat

lean body mass index.

drugstr

can be “Propofol”, “Remifentanil” or “Norepinephrine”.

modelstr, optional

Could be “Schnider”[Schnider1999], “Marsh_initial”[Marsh1991], “Marsh_modified”[Struys2000], “Shuttler”[Schuttler2000] or “Eleveld”[Eleveld2018] for Propofol. “Minto”[Minto1997], or “Eleveld”[Eleveld2017] for Remifentanil. “Beloeil”[Beloeil2005], “Oualha”[Oualha2014], or “Li”[Li2024] for Norepinephrine. The default is “Schnider” for Propofol, “Minto” for Remifentanil, and “Beloeil” for Norepinephrine.

tsfloat, optional

Sampling time, in s. The default is 1.

randombool, optional

bool to introduce uncertainties in the model. The default is False.

x0np.ndarray, optional

Initial concentration of the compartement model. The default is np.zeros((len(A), 1)).

opiatebool, optional

For Elelevd model for propofol, specify if their is a co-administration of opiate (Remifentantil) in the same time. The default is True.

measurementstr, optional

For Elelevd model for propofol, specify the measuremnt place for blood concentration. Can be either ‘arterial’ or ‘venous’. The default is ‘arterial’.

truncatedfloat, optional

If not None it correspond to the number of standard deviation after which the distribution are truncated for generating uncertain parameters. The default is None.

Attributes:
tsfloat

Sampling time, in s.

drugstr

can be “Propofol”, “Remifentanil” or “Norepinephrine”.

A_initnp.ndarray

Initial value of the matrix A.

B_initnp.ndarray

Initial value of the matrix B.

v1float

Volume of the first compartement.

u_endofloat.

Endogenous production of drug (µg/s).

self.u_lagfloat.

Lag time in the input of the model (s).

continuous_syscontrol.StateSpace

Continuous state space model.

discrete_syscontrol.StateSpace

Discrete state space model.

xnp.ndarray

State vector.

ynp.ndarray

Output vector (hypnotic effect site concentration).

References

[Schnider1999]

T. W. Schnider et al., “The Influence of Age on Propofol Pharmacodynamics,” Anesthesiology, vol. 90, no. 6, pp. 1502-1516., Jun. 1999, doi: 10.1097/00000542-199906000-00003.

[Marsh1991]

B. Marsh, M. White, N. morton, and G. N. C. Kenny, “Pharmacokinetic model Driven Infusion of Propofol in Children,” BJA: British Journal of Anaesthesia, vol. 67, no. 1, pp. 41–48, Jul. 1991, doi: 10.1093/bja/67.1.41.

[Struys2000]

M. M. R. F. Struys et al., “Comparison of Plasma Compartment versus Two Methods for Effect Compartment–controlled Target-controlled Infusion for Propofol,” Anesthesiology, vol. 92, no. 2, p. 399, Feb. 2000, doi: 10.1097/00000542-200002000-00021.

[Schuttler2000]

J. Schüttler and H. Ihmsen, “Population Pharmacokinetics of Propofol: A Multicenter Study,” Anesthesiology, vol. 92, no. 3, pp. 727–738, Mar. 2000, doi: 10.1097/00000542-200003000-00017.

[Eleveld2018]

D. J. Eleveld, P. Colin, A. R. Absalom, and M. M. R. F. Struys, “Pharmacokinetic–pharmacodynamic model for propofol for broad application in anaesthesia and sedation” British Journal of Anaesthesia, vol. 120, no. 5, pp. 942–959, mai 2018, doi:10.1016/j.bja.2018.01.018.

[Minto1997]

C. F. Minto et al., “Influence of Age and Gender on the Pharmacokinetics and Pharmacodynamics of Remifentanil: I. Model Development,” Anesthesiology, vol. 86, no. 1, pp. 10–23, Jan. 1997, doi: 10.1097/00000542-199701000-00004.

[Eleveld2017]

D. J. Eleveld et al., “An Allometric Model of Remifentanil Pharmacokinetics and Pharmacodynamics,” Anesthesiology, vol. 126, no. 6, pp. 1005–1018, juin 2017, doi: 10.1097/ALN.0000000000001634.

[Beloeil2005]

H. Beloeil, J.-X. Mazoit, D. Benhamou, and J. Duranteau, “Norepinephrine kinetics and dynamics in septic shock and trauma patients,” BJA: British Journal of Anaesthesia, vol. 95, no. 6, pp. 782–788, Dec. 2005, doi: 10.1093/bja/aei259.

[Oualha2014]

M. Oualha et al., “Population pharmacokinetics and haemodynamic effects of norepinephrine in hypotensive critically ill children,” British Journal of Clinical Pharmacology, vol. 78, no. 4, pp. 886–897, 2014, doi: 10.1111/bcp.12412.

[Li2024]

Y. Li et al., “Population Pharmacokinetic Modelling of Norepinephrine in Healthy Volunteers Prior to and During General Anesthesia,” Clin Pharmacokinet, vol. 63, no. 11, pp. 1597–1608, Nov. 2024, doi: 10.1007/s40262-024-01430-y.

full_sim(u: ndarray, x0: ndarray | None = None, interp=False) list

Simulate PK model with a given input.

Parameters:
ulist

Infusion rate (mg/s for Propofol, µg/s for Remifentanil and Norepinephrine).

x0numpy array, optional

Initial state. The default is None.

interpbool, optional

Whether to use zero-order-hold (False, the default) or linear (True) interpolation for the input array.

Returns:
numpy array

List of the states value during the simulation. (µg/mL for Propofol and ng/mL for Remifentanil and Norepinephrine).

get_system_gain()

Compute the steady-state (DC) gain of the compartment model.

The steady-state gain is the ratio of the output to the input when the system reaches equilibrium. For a stable LTI system, this is given by:

\[G_{ss} = C (-A)^{-1} B + D\]

where ( A, B, C, D ) are the state-space matrices.

Returns:
float

The scalar steady-state gain of the system (assumes SISO or extracts [0,0] for MIMO).

one_step(u: float) list

Simulate one step of PK model.

\[x^+ = Ax + Bu\]
\[y = Cx\]
Parameters:
ufloat

Infusion rate (mg/s for Propofol, µg/s for Remifentanil and Norepinephrine).

Returns:
numpy array

Actual effect site concentration (µg/mL for Propofol and ng/mL for Remifentanil and Norepinephrine).

update_Li_model_propo(c_prop: float)

Update Norpineprhine Li PK model thanks to the concentration of propofol.

Update the cl1 parameter.

Parameters:
c_propfloat

Plasmatique concentration of propofol (mg/mL).

Returns:
None.
update_param_CO(CO_ratio: float)

Update PK coefficient with a linear function of Cardiac output value.

Parameters:
CO_ratiofloat

Ratio of Current CO relatively to initial CO.

Returns:
None.
update_param_blood_loss(v_ratio: float, CO_ratio: float)

Update PK coefficient to mimic a blood loss.

Update the blood volume compartment

Parameters:
v_ratiofloat

blood volume as a fraction of init volume, 1 mean no loss, 0 mean 100% loss.

CO_ratiofloat

Ratio of Current CO relatively to initial CO.

Returns:
None.