Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
cody2 authored Jun 30, 2022
1 parent 8f9fb66 commit 4275fca
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions N803_model_2.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%% N803_model_2.m - solves ODE model for N-803 treatment of SIV
%
% /--------------------------------------------------------------\
% | Date: 06/27/2022 |
% | Date: 06/29/2022 |
% | Author: Jonathan Cody |
% | Affiliation: Purdue University |
% | Weldon School of Biomedical Engineering |
Expand Down Expand Up @@ -35,8 +35,8 @@
% OPTIONS
% ========================================================================
%
% varargin = cell vector used to add optional inputs (see line 54)
% EX: N803_model_2(SoluTimes,DoseTimes,Pars,Yic,'InputName',[InputValue])
% Opts = cell vector used to add optional inputs (see list on line 54)
% EX: Opts = {'AbsTol',1e-2} will set ode solver absolute tolerance to 1e-2
%
%% ========================================================================
% OUTPUTS
Expand All @@ -48,7 +48,7 @@
%% ========================================================================
% FUNCTION
% ========================================================================
function Y_OUT = N803_model_2(SoluTimes,DoseTimes,Pars,Yic,varargin)
function Y_OUT = N803_model_2(SoluTimes,DoseTimes,Pars,Yic,Opts)

% Declare optional input default values
EqualPars = [] ;% vector of indices in 'Pars' for equating parameters
Expand All @@ -62,14 +62,14 @@
odeSolver = '15s' ;% ode solver function: 'ode15s' or 'ode23s'

% Overwrite optional inputs, if specified
for n = 1:length(varargin)
if strcmp('EqualPars', varargin(n)) ; EqualPars = varargin{n+1} ; end
if strcmp('fullOut', varargin(n)) ; fullOut = varargin{n+1} ; end
if strcmp('timeOut', varargin(n)) ; timeOut = varargin{n+1} ; end
if strcmp('warnOff', varargin(n)) ; warnOff = varargin{n+1} ; end
if strcmp('AbsTol', varargin(n)) ; AbsTol = varargin{n+1} ; end
if strcmp('RelTol', varargin(n)) ; RelTol = varargin{n+1} ; end
if strcmp('odeSolver', varargin(n)) ; odeSolver = varargin{n+1} ; end
for n = 1:length(Opts)
if strcmp('EqualPars', Opts(n)) ; EqualPars = Opts{n+1} ; end
if strcmp('fullOut', Opts(n)) ; fullOut = Opts{n+1} ; end
if strcmp('timeOut', Opts(n)) ; timeOut = Opts{n+1} ; end
if strcmp('warnOff', Opts(n)) ; warnOff = Opts{n+1} ; end
if strcmp('AbsTol', Opts(n)) ; AbsTol = Opts{n+1} ; end
if strcmp('RelTol', Opts(n)) ; RelTol = Opts{n+1} ; end
if strcmp('odeSolver', Opts(n)) ; odeSolver = Opts{n+1} ; end
end

% check inputs vector orientation
Expand Down Expand Up @@ -324,8 +324,8 @@
J(03,17 ) = daEdR * E0 ;

% Partial derivatives of f4-10 = dE2-8/dt
J(39:19:153) = - dA - pE ;
J(40:19:154) = 2*pE ;
J(37:18:145) = - dA - pE ;
J(38:18:146) = 2*pE ;
J(10,10) = - dA - mE ;

% Partial derivatives of f11 = dB0/dt
Expand Down

0 comments on commit 4275fca

Please sign in to comment.