Welcome to PKModelling’s documentation!

class model.Model(clearance_rate=1, vol_c=1)

A Pharmokinetic (PK) model. Defaults to Intravenous Bolus. Adding subcutaneous compartment changes model type

add_peripheral_compartment(pc_name=None, vol_p=1, q_p=1)

Adds peripheral compartment to model. Valid for both IVB and SC.

Parameters
  • vol_p – int/float describing volume of per comp [ml]

  • q_p – int/float describing drug quantiyin per comp [ng]

Returns

add_subcutaneous_compartment(absorption_rate=1)

Adds subcutaneous compartment to model with absorption rate specified.

Parameters

absorption_rate – int/float describing absorp. rate for SC [/h]

Returns

class solution.Solution(model=<pkmodel.model.Model object>, protocol=<pkmodel.protocol.Protocol object>)

Accepts a pharmacokinetic model and solves it, either returning a plot or arrays of the drug concentrations over time.

plot(name)

Plots the concentrations in the different compartments over time.

Parameters

name – the name of the model in question, e.g. IV, 2 peripheral compartments

Returns

solve(y0=None, t_eval=None)

Uses the scipy library to solve the initial value problem for the system of equations specified in the system_of_equations function, (we currently assume that the initial drug concentrations are zero).

Returns

scipy bunch object

system_of_equations(t, y)

Implements the algebraic ODE formula from the project description in python and evaluates it at a specific time point.

Parameters
  • t – point in time, only relevant if you have a continuous dosing protocol

  • y – value from which the ODE expression is calculated

Returns

derivative of drug concentrations with respect to time

class protocol.Protocol(dose_amount=1, continuous=False, continuous_period=[0, 0], instantaneous=True, dose_times=[0])

A Pharmokinetic (PK) dosing protocol Allows for continuous or instantaneous (at one or more time points) dosing. Also allows to set up the dose X in ng.

dose_amount: numeric, optional, default=1

This parameter takes in the amount of dose given - X ng

continuous: logical, optional, default = False

This parameter specifies whether or not the dose X ng is applied at a continuous rate of X ng per hour.

continuous_period: numerical list, optional, default = [0, 0]

This parameter specifies the time period over which continuous dosing is applied. The first number in the list is the time at which continuous dosing begins and the second number is when continuous dosing ends.

instantaneous: logical, optional, default = True

This parameter specifies whether any instantaneous doses of X ng take place.

dose_times: numerical list, optional, default = [0]

This parameter is a list of numerics that specify the times at which instantaneous doses of X ng are applied.

add_instantaneous(time)

Paramater: time: Additional time at which there will be added an instantaneous dose of X ng. This method modifies an object of class Protocol to add an additional user specified instantaneous dose time.

change_dose(dose_amount)

Paramater: dose_amount: The dosage given - X ng This method modfies the dose_amount parameter in the object of protocol class it is called on.

dose_at_time(t)

Paramater: t: time at which you want dose(t) to be returned. Returns: Dose(t) for the specific dosing protocol set up in the object of class Protocol.

make_continuous(time_start, time_finish)

Paramater: time_start: The time that at which continuous dosing starts. Parameter: time_finish: The time at which continuous dosing finishes. This method modifies an object of class Protocol to convert the dosing protocol to continuous over a user specified time period.

PKModelling text

Indices and tables