Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 104 additions & 0 deletions AMK/AMK_PlasmaODEs.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
%% =======================================================================
% AMK_PlasmaODEs.m — Two-Compartment Plasma PK ODEs for Amikacin
% ========================================================================
%
% DESCRIPTION
% Right-hand side function for a two-compartment PK model of amikacin
% with zero-order IV infusion input and first-order elimination from
% the central compartment. Intended to be called by an ODE solver
% (e.g. ode45) from AMK_PopPK.
%
% MODEL
% Reimplementation of Tod et al., 1998.
% Michel Tod et al. "Population pharmacokinetic study of amikacin administered
% once or twice daily to febrile, severly neutropenic adults". In: *Antimicrobial
% agents and chemotherapy* 42.4 (1998), pp. 849-856.
%
% INPUTS
% t - Time (h); scalar supplied by the ODE solver.
% y - State vector of drug amounts (mg):
% y(1) = central compartment amount
% y(2) = peripheral compartment amount
% params - Parameter vector:
% params(1) = Vc/F central volume (L)
% params(2) = Vp/F peripheral volume (L)
% params(3) = CL/F clearance (L/h)
% params(4) = Q/F intercompartmental clearance (L/h)
% params(5) = dose dose for this interval (mg)
% params(6) = infusion duration (h)
%
% OUTPUTS
% dy - Derivative vector (mg/h):
% dy(1) = d(central)/dt
% dy(2) = d(peripheral)/dt
%
% AUTHORS
% Trevor Shoaf
% Copyright: Elsje Pienaar's Computational Systems Pharmacology Lab,
% Weldon School of Biomedical Engineering, Purdue University
%
% Original implementation: Meghna Nair, 2024-01-28
%
% VERSION
% Created: 2024-01-28
% Tested on: MATLAB R2026a
% ========================================================================

function dy = AMK_PlasmaODEs(t,y,params)

% Extracting parameter values from params variable to assign to local variables

% Departmental constants
V_Fs = [...
params(1) %(L) Central compartment Vc/F
params(2) %(L) Peripheral compartment Vp/F
];
rates = [...
params(3) % CL/F Clearance
params(4) % Q/F Intercompartmental Clearance
];
dose = params(5); % Dose for this interval (mg)
infusionDuration = params(6); % IV infusion duration (h)

% Handle dosing duration

if t < infusionDuration
RateIn = dose / infusionDuration; % (mg/h) zero-order IV input
else
RateIn = 0; % no input after infusion ends
end

% ODE Y value assignments
A = [...
y(1) %Drug amount in central compartment (mg)
y(2) %Drug amount in peripheral compartment (mg)
];

% Define ODEs

% ODE around CENTRAL compartment
% ------------------------------------------
% ODE_1 terms
dA1_term1 = RateIn; %
dA1_term2 = - rates(2) * A(1) / V_Fs(1); % Flow out to Peripheral: -Q * A1 / Vc
dA1_term3 = rates(2) * A(2) / V_Fs(2); % +Q * A2 / Vp
dA1_term4 = - rates(1) * A(1) / V_Fs(1); % Clearance from system: -CL * A1 / Vc

dA1dt = dA1_term1 + dA1_term2 + dA1_term3 + dA1_term4; %(mg/h)

% ODE around PERIPHERAL compartment
% ------------------------------------------
% ODE_2 terms
dA2_term1 = rates(2) * A(1) / V_Fs(1); % +Q * A1 / Vc
dA2_term2 = - rates(2) * A(2) / V_Fs(2); % -Q * A2 / Vp

dA2dt = dA2_term1 + dA2_term2; %(mg/h)

% ODE Outputs

dy = [...
dA1dt
dA2dt
];

end
Loading