Welcome to Pk-model’s documentation!¶
- class dose.DoseFn(constinput=0, centerpoints=None, magnitudes=None)¶
This class represents the dose function in the ODE. The dose function DOSE(t) should be a linear combination of several pseudo delta function(see GaussConvFn), plus a constant value. It represents consist of instantaneous doses of X ng of the drug at one or more time points, or a steady application of X ng per hour over a given time period, or some combination.
Building up an object needs to specify: the stead application dose (constinput) A list of instantaneous dosing time and quantity (centerpoints & magnitudes)
- eval_at(x)¶
Return the dose function value at x
- class dose.GaussConvFn(center: float, magnitude: float, sigma=0.02)¶
This class represents the convolution of a delta function with Gaussian function By Gaussian function we mean the pdf of Gaussian distribution. The purpose of this function is build up a smooth function which is close to a delta function, and enable the numerical solution of ODE using Runge-Kutta method. Formally, Let us denote
- ho(t)=A * delta(t-t_center), where A is the magnitude
omega(t) = int
rac{1}{sqrt{2pi}sigma}e^{- rac{t^2}{2sigma^2}},
then this class just represent
- ho * omega (t), where * is the convolution.
See the definition in https://en.wikipedia.org/wiki/Convolution for more information.
- eval_at(x: float) float¶
Return the value of this function at x.
- class solution.Solution(models: list, t_0=0, t_end=1, numsteps=1001, y0=[0.0])¶
A Pharmokinetic (PK) model solution, running from t_0 to t_end with N time steps
- generate_solutions()¶
Solve the model ODE for each model specified.
If no y0 is specified by the user, y0=0 for each equation
return all_solutions: list containing the solution class for each model returned by scipy.integrate.solve_ivp all_specifications: list containing user specifications for each model, for visualisation
- visualization.visualization(all_solutions, all_specifications)¶
visualize the drug mass vs time of all model solutions
- all_solutionsList
List of the solution of models containing the time and the drug mass vaules
- all_specificationsList
The list of lists (with three integers per list) that specify how many peripheral componets, which dose and protocol type for each model.
None