.Pharmacolibrary
Modelica library for Pharmacokinetics and Pharmacodynamics (v1.0.0)Pharmacolibrary library
is a libary for modelling of pharmako-kinetics and pharmako-dynamics.
Connectors
There are two types of connectors used:
FlowPort
The FlowPort is designed for connections representing blood or plasma flows and thus to simulate perfusion-based drug distribution. It consists of flow variable Q (blood/plasma volume flow rate) and stream variable c_outflow (mass concentration of drug). There is no potential variable (as pressure) thus the connector is not ballanced which results in warnings durign compilation. If the flow dynamics is of interest, it pressure may be included.
BloodTissueConcentrationPort
The BloodTissueConcentrationPort serve for connections representing diffusion, active transport and simular mechanisms. There are two potential variables cFree (free concentration in tissue) and cBFree (free concentration in blood/plamsa) and one flow variable mFlow (drug mass flow).
Components
Besides some helper components, there are 5 types of components:
Source
several types of drug sources. These components should be connnected to concentration ports of compartments.
Compartments
compartments stor an mass of drug and volume of blood/plamsa, evaluates drug concentration and calculates mixing of inflow and contained blood/plasma of different drug concentrations.
Transfer
realize drug transfer as diffussion, active transport ...between compartments. Transfer components must be connected to Compartments or Elimination by means of their BloodTissueConcentrationPort connectors.
Elimination
Elimination components represents the point where drug is lost from the body by either excretion or metabolism.
Effect
several models of drug effects (either instant or indirect - depending on history) are provided.
Tool
Some helper components.
Other components
FixedFlow
determines the blood/plasma flow. The flow (perfusion) part of a model should be supplied with appropriet number of FixedFlow components so that the flow in each branch may be determined.
Break
If the flows part of a model is circular, the Break component must be connected somewhere so that the model is not over-determined. It is an equivalent of grounding in electrical domain.
FlowBouwndary
represents blood/plasma inflow/outflow. The predefined concentration is applied, in case of outflow.
ConcBoundary
represents unlimited source/sink of the drug. The concentration is given, the massflow rate is calculated outside (e.g. by a connected Transfer component).
Example models
Three compartment model with source
Simple model with source and three copartments representing arteries, tissues and veins. The source component is connected using the blue BloodTissueConcentrationPort. Other connections are realized using the red FlowPorts as they represent blood/plasma flow. Note the Break component connected in the blood/plasma loop that has no physiological effect but is required so that the model is well-ballanced.
Model is available at Pharmacolibrary.OriginalTests.Test2_1_PTissuePSystemic.
Three compartment model with source and diffusion transfer
One of the compartments representing red blood cells is connected only via the diffusion transfer component and using the blue BloodTissueConcentrationPorts, there is no perfusion.
Model is available at Pharmacolibrary.OriginalTests.Test2_10_PDiffusion.
Two compartment model including source and elimination
The PPeripheral compartment (on the left) includes a diffusion calculation so that there is no separate transfer component needed.
There is also elimination component included in the model that excrets the drug accoring to predefined clearance.
Model is available at Pharmacolibrary.OriginalTests.Test2_1_PTissuePSystemic.
Other example models are available in the packages Pharmacolibrary.Components.Tests and Pharmacolibrary.OriginalTests.
Contents
Generated at 2025-06-12T18:20:45Z
by OpenModelicaOpenModelica 1.25.0 using GenerateDoc.mos