TCI Controller¶
- class TCIController(patient_info: list, drug_name: str, model_used: str = None, maximum_rate: float = 500, sampling_time: float = 1, control_time: float = 10, target_compartement: str = 'effect_site')¶
Bases:
objectImplement the control algorithm coded in the TCI device Orchestra PRIMUS, from [Shafer1992].
Warning: This code has been retro enginering and does not came from an official source.
- Parameters:
- patient_infolist
Patient information = [age (yr), height (cm), weight (kg), sex( 0= female, 1 = male)].
- drug_namestr
Can be either ‘Propofol’, ‘Remifentanil’, ‘Norepinephrine’ or ‘Atracurium’.
- model_usedstr
Could be “Minto”, “Eleveld” for Remifentanil, “Schnider”, “Marsh_initial”, “Marsh_modified”, “Shuttler” or “Eleveld” for Propofol, “Oualha”, or “Beloeil” for Norepinephrine, “WardWeatherleyLago” for Atracurium
- maximum_ratefloat
Maximum drug rate in mg/s or µg/s depending on the unit.
- sampling_timefloat, optional
Sampling time of the model for the calculs. The default is 1s.
- control_timefloat, optional
Sampling time of the controller, must be a multiple of the sampling time. The default is 10s.
- target_compartementstr, optional
Can be either “plasma” or “effect_site”, for Norepinephrine only plasma is available. The default is ‘effect_site’ except for norepinephrine.
- Attributes:
- sampling_timefloat
Sampling time of the model for the calculs.
- control_timefloat
Sampling time of the controller.
- target_idint
index of the target compartment in the state vector.
- infusion_maxfloat
Maximum drug rate in mg/s or µg/s.
- Adnp.array
Discretized state matrix of the mode with the sampling time of the model.
- Bdnp.array
Discretized input matrix of the model.
- Ad_controlnp.array
Discretized state matrix of the model with the sampling time of the controller.
- Bd_controlnp.array
Discretized input matrix of the model with the sampling time of the controller.
- Celist
List of the effect site concentration after a 10s infusion.
- infusion_ratefloat
Last control move chosen.
- xnp.array
Array to store the patient state at simulation time.
- targetfloat
Target concentration.
References
[Shafer1992]Shafer and K. M. Gregg, “Algorithms to rapidly achieve and maintain stable drug concentrations at the site of drug effect with a computer-controlled infusion pump,”0 Journal of Pharmacokinetics and Biopharmaceutics, vol. 20, no. 2, pp. 147–169, Apr. 1992, doi: 10.1007/BF01070999.
- one_step(target: float = 0) float¶
Implement one_step of the model. It must be called each sampling time.
- Parameters:
- targetfloat, optional
target concentration (µg/ml for propofol, ng/ml for Remifentanil). The default is 0.
- Returns:
- infusion rate: float
infusion rate in mg/s per Propofol and µg/s for remifentanil.