function P = PatientMonitoring(T,Y,VLhandle,dT) % % This function contains the implementation of routine patient monitoring % (see von Kleist M, Menz S, Stocker H, Arasteh K, Huisinga W, Schuette S (2011) % "HIV Quasispecies Dynamics during Pro-active Treatment Switching: Impact on % Multi-Drug Resistance and Resistance Archiving in Latent Reservoirs", PlosOne) % % Input arguments are: % % 1st) Considered duration of simulation in days % % 2nd) Initial state Y of the system % % 3rd) Function handle to compute viral load from a state Y % % 4th) Time intervals between monitorings in days % % % Copyright (C) 2011, Free University Berlin % Contact: vkleist@zedat.fu-berlin.de % % FOR ACADEMIC USE this program is free software; you can redistribute % it and/or modify it under the terms of the GNU General Public License % as published by the Free Software Foundation; either version 2 % of the License, or (at your option) any later version. % % This program is distributed in the hope that it will be useful, % but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, write to the Free Software % Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, % USA. %%%%%%%%%% START %%%%%%%%%% % set default values of patient-monitoring dT_monitoring = dT; % get time intervals between monitorings in days if dT > T error('PatientMonitoring:argChk',... '\nMonitoring interval can not exceed duration of simulation.'); end FirstLogDecline = 100.0; % neccessary log-decline in viral load [HIV mRNA/mL blood] after treatment initiation VLDetectionLimit = 50.0; % detection limit [HIV RNA/mL plasma] SimulationEnd = T; CheckUp = 1; CheckUpTimes = dT_monitoring:dT_monitoring:T; if CheckUpTimes(end) ~= T CheckUpTimes(end) = CheckUpTimes(end) + T; end prevVL = VLhandle(Y); VLfunction = VLhandle; % event function of patient-monitoring function [value,isterminal,direction] = patient_monitoring(t) value = t - CheckUpTimes(CheckUp); isterminal = 1; direction = 1; end % perform check up function drugswitch = perform_checkup(y) drugswitch = false; % measure viral load VL = VLfunction(y); % later check up's if CheckUp > 1 % infection successful suppressed if VL < VLDetectionLimit % shift remaining monitorings CheckUpTimes(CheckUp+1:end) = CheckUpTimes(CheckUp+1:end) + dT_monitoring; % failure elseif VL >= prevVL % switch drug combination drugswitch = true; end % first check up else % infection successful suppressed if VL < VLDetectionLimit % shift remaining monitorings CheckUpTimes(CheckUp+1:end) = CheckUpTimes(CheckUp+1:end) + dT_monitoring; % failure elseif VL >= prevVL/FirstLogDecline % switch drug combination drugswitch = true; end end prevVL = VL; CheckUp = CheckUp+1; end % set monitoring parameters function [] = set_dT_monitoring(dT) CheckUp = 1; dT_monitoring = dT; CheckUpTimes = dT:dT:SimulationEnd; if CheckUpTimes(end) ~= SimulationEnd CheckUpTimes(end) = CheckUpTimes(end) + SimulationEnd; end end function [] = set_first_logDecline(FLD) FirstLogDecline = FLD; end function [] = set_VL_detectionLimit(VLDL) VLDetectionLimit = VLDL; end % return functions of patient monitoring P.patient_monitoring = @patient_monitoring; P.perform_checkup = @perform_checkup; P.set_dT_monitoring = @set_dT_monitoring; P.set_first_logDecline = @set_first_logDecline; P.set_VL_detectionLimit = @set_VL_detectionLimit; end