
% SIMIODETemplate-TeacherORStudent.tex and simiode.cls for LaTeX2e
% Version 29 July 2015.
% 
% This class (simiode.cls) is a modification of that used by 
% the journal PRIMUS - Problems, Resources, and Issues in 
% Mathematics Undergraduate Studies. 
% 
% See http://www.tandfonline.com/loi/upri .
% 
% The class was developed by  Marc Frantz with suggestions of the 
% PRIMUS Editorial Board, especially John Thoo.
%
% This template is to be used with the  class file "simiode.cls". 
%  
% The latest version of this class and template files 
% can be found at
% 
%       <http://www.SIMIODE.org> in the Author section.
%
% A "Quick Start Guide" appears below.
%
% This file must be processed with version LaTeX2e or higher.
%
\documentclass{SIMIODE}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% With this version of the tex file and the associated SIMIODE.cls file you can produce BOTH a Student Version and a Teacher Version of your modeling scenario or technique narrative.
%
% Basically the Student Version contains the title STUDENT VERSION along with the NAME OF SCENARIO, with no abstract, no keywords, no tags, no author identifiers, and no COMMENTS section. The Student Version contains only the STATEMENT of the modeling scenario with appropriate figures, data, instructions, and perhaps a bibliography appropriate for student resourcing, but nothing in the bibliography which would "give away" the nature of the modeling scenario, etc.
%
%The Teacher Version contains the material in the Student Version, namely the title NAME OF SCENARIO, now headed with   TEACHER VERSION, but also full author  identification, abstract, key words, tag words, and, following the STATEMENT, a section of COMMENTS which can be discussion of presentation  ideas, "solutions," techniques, etc.
%
% Authors can prepare a full Teacher Version using the notions immediately below  to create a pdf for review (but in review please eliminate all information about the author as we use a double-blind referee system. Such information will be restored when accepted and published in SIMIODE at www.simiode.org.
%
%***********   Toggle the following line to turn the teacher version on (1) or off (0). ***********
%
%
\def\TeacherEdition{0} % Toggle this line's value.
\newcommand{\teacher}[1]{\ifnum\TeacherEdition=1 #1 \fi}
%
%
% The \teacher{ } command wraps any text that will appear only in the teacher version of
% the document. See this file for examples. This has been done for you in the document below.   
% Rename the pdf after you compile each final version.
% This option was created  by Eric Sullivan, Carroll College, Helena MT.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{amsmath,amssymb}
\usepackage{color}
\usepackage{graphicx}
%\usepackage{hyperref}
\usepackage{url}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% NOTE regarding double spacing %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Manuscripts should be submitted doubled spaced.  This is 
% accomplished via the \baselinestretch command below.
% However, you may obtain an idea of how your article will 
% look in final form, so that you can better plan your 
% presentation.  To see your manuscript formatted very 
% similarly to the on-line published format of  SIMIODE, 
% comment the following line out by inserting a percent sign % (%) at its beginning.

\renewcommand{\baselinestretch}{1.3}

%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% NOTE regarding macros %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Any macros defined for your paper should be contained in 
% the top matter. Likewise, any environment definitions such 
% as \newtheorem or \newenvironment should also go in the 
% top matter. 
% 
% Do not \input your macros as separate files within your 
% final version because more files make it harder for the 
% editors and users to keep track of and/or modify and 
% append your paper.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Top matter is above and 
% the beginning of the document below.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

\newpage
% You only need to change the NAME OF SCENARIO in the next line and delete the footnote. See above for instructions on toggling from Teacher Version to Student Version.
\title{\ifnum\TeacherEdition=1 TEACHER VERSION  \else STUDENT VERSION \fi\\DIALYSIS}



\teacher{
\keywords{dialysis, kidney, concurrent, countercurrent, compartment model }



\tagwords{linear system, differential equations}

}


\markboth{Dialysis}{Dialysis}






\author{Brian Winkel\\
Director SIMIODE\\
Cornwall NY \teacher{12518} USA\\
 \teacher{Director@simiode.org}
}


% \makeStitle
% replaces: \makeStitle
% Choose only one of the following:
\makeStitlePDFLaTex  % <--- use this for PDFLaTex (jpg and pdf image files etc.)
%\makeStitleLaTex    % <--- use this for LaTex (eps image files)


\teacher{
\begin{abstract}
We guide students through the design of a compartment model of a kidney dialysis machine and compare 3 and 9 compartments for the dialysis machine as well as require students to determine the effect of change in one of the parameters in the model on the effectiveness to deliver quality dialysis.
\end{abstract}
}

\teacher{

\vspace*{-.1 true cm}
\listkeywords

\vspace*{-.9 true cm}
\listtags
}




\section*{STATEMENT}

Kidney dialysis is a life saving procedure that is performed in out patient facilities. The patient's blood is passed through a dialysis machine and the urea in the blood is removed across a semipermeable membrane into a dialytic fluid which is very low urea or pure. The blood and the dialytic fluid need to pass by this membrane and the question in this modeling scenario is whether it is better to have the blood and the dialytic fluid flow in the same direction with the membrane separating them ({\it concurrent flow\/}) or in the opposite direction  with the membrane separating them ({\it countercurrent flow\/}).

Countercurrent flow is found in nature \cite{Teboh-Ewungkema2006}. 
For an excellent animation of countercurrent blood flow used to keep blood warm when it returns from cold surface exposure see \cite{Ash2000}. 

Diagrams, using small compartments,  illustrate flow and facilitate the modeling of concurrent flow (Figure~\ref{fig:5-5-Dialysis-Concurrent}) and countercurrent flow (Figure~\ref{fig:5-5-Dialysis-Countercurrent}).

  
\begin{figure}
\centering
\includegraphics[width=14cm]{5-5-Dialysis-Concurrent.eps}



\parbox{9 true cm}{\caption{\label{fig:5-5-Dialysis-Concurrent}  Model of concurrent dialysis in which the dialytic fluid flows in the same direction as the blood flows.}}
\end{figure}


\begin{figure}
\centering
\includegraphics[width=14cm]{5-5-Dialysis-Countercurrent.eps}



\parbox{9 true cm}{\caption{\label{fig:5-5-Dialysis-Countercurrent}  Model of countercurrent dialysis in which the dialytic fluid flows in the opposite direction as the blood flows.}}
\end{figure}



Parameters and variables in the model are identified:

\begin{itemize}
\item  
$rB$ is the rate (L Blood/min) of flow of blood from  blood compartment to blood compartment.  A realistic value for $rB$ is  $rB = 0.5$ L Blood/min. This would be difficult to change as it reflects   the natural blood flow rate of the patient.
\item  $rM$ is the rate (L dialytic fluid/min) of flow of 
dialytic fluid from dialytic fluid compartment to dialytic fluid 
compartment. A  value to start is at a flow rate slower than that of the blood flow, say $rM = 0.1$  L dialytic fluid/min.  In fact in an operator's manual \cite[p. 24]{Fresenuis2001} the settings for ``Dialysate Flow (Adjustment Range)'' offerings are ``300/400/500/600/700/800 mL/min.'' I.e., $rM = 0.3, 0.4, 0.5, 0.6, 0.7, 0.8$ L dialytic fluid/min.
\item   $k$ is the rate constant (1/min) for flow of urea from  
blood compartment to dialysis compartment across one way flow  
membrane. This is based on a concentration gradient difference  
between the  blood and dialysis fluid compartment concentrations. $k = .5$ 1/ min is a reasonable value for a membrane, but can be changed depending upon the type of membrane used.  
\item    ${\rm IB}$ is the initial urea levels in the blood. ${\rm IB} = 300$ (mL of urea)/(L of blood) is a reasonably high level to warrant dialysis. 
\item ${\rm VBB}$ is the constant volume of blood in L in the body.
\item ${\rm yBB}(t)$ is the amount of urea in L in the body at time $t$ in min.
\item ${\rm VB}$ is the volume of blood in the blood compartments - three compartments in all at first. 
\item ${\rm YBi}(t)$, $i = 1, 2, 3$  is the amount of urea in L in blood compartments $i = 1, 2, 3$, at time $t$ in min.
\item ${\rm YMi}(t)$, $i =1, 2, 3$  is the amount of urea in L in dialytic fluid compartments $i =1, 2, 3$, at time $t$ in min.
\end{itemize}

The goal of the dialysis is to reduce the concentration of urea in the body to 50 (mL of urea)/(Liter of blood). 
Here are some assumptions:

\begin{itemize}
  \item   Assume  the TOTAL amount of blood in the body is 5 
liters. This is quite reasonable.
 \item   For a three compartment model we shall assume each of the small compartments has volume 0.1 liter. Changing this would refine or broaden the exchange compartments in the model.
 \item Assume that once the cleaned blood enters the patient's blood system it thoroughly mixes with that blood, in particular, the blood that enters the dialysis unit has the same concentration of urea as that which exited the unit.  This could prove to be a very seriously wrong assumption. Why?  How might we change our model to avoid this? In fact, the 0.1 L of blood that enters into the approximately 5 L of blood really does not alter the concentration of urea that much so this might not even make that much different. However, this is still worthy of further modification to the simple compartment model.
\item The rate at which the urea flows through the membrane from blood compartment to dialytic compartment is proportional to the difference in the concentrations in these two compartments, respectively and that rate is $k$ 1/min.
 \item Assume that the dialytic fluid that enters the dialysis machine is free of urea. 
\end{itemize}

\subsection*{Activities}

\begin{enumerate}
  \item Using concurrent flow build a three compartment model for the amount of urea present in each of the three blood compartments, the blood in the body, and each of the three dialytic machine compartments. Here is one differential equation (\ref{eq:OneEq}) to get  started. This equation is for the rate of change in the amount of urea in blood compartment 1 in which urea enters from the bloodstream, leaves to go into blood compartment 2, and  moves across the membrane into compartment 1 of the dialytic machine.

\begin{equation}\label{eq:OneEq}
yB1'(t) = 
  rB \frac{yBB(t)}{VBB} - rB   \frac{yB1(t)}{VB1} - k \left(\frac{yB1(t)}{VB1} - \frac{yM1(t)}{VM1}\right)\, .
\end{equation}
  \item Using countercurrent flow build a three compartment model for the amount of urea present in each of the three blood compartments, the blood in the body, and each of the three dialytic machine compartments. Here is one differential equation (\ref{eq:TwoEq}) to get  started. This equation is for the rate of change in the amount of urea in dialytic compartment 1 in which urea enters from the bloodstream, leaves to go into blood compartment 2, and  moves across the membrane into compartment 1 of the dialytic machine.

\begin{equation}\label{eq:TwoEq}
yM1'(t) = 
  rM \frac{yM2(t)}{VM2} - rM   \frac{yM1(t)}{VM1}+ k \left(\frac{yB1(t)}{VB1} - \frac{yM1(t)}{VM1}\right)\, .
\end{equation}
\item In both cases (concurrent and countercurrent) determine how long it takes until the  urea concentration in the blood compartment reaches 50 ml/(L of blood). Based on this comparison which flow, concurrent or countercurrent, would you recommend. 
\item Perform the same analyses for (1) - (3) using a nine compartment model.
\item Pick one of the parameters, e.g., $rM$ or $k$ (changing $k$ might mean engineering a new membrane), and perform an analysis to see how sensitive the time until the blood compartment reaches 50 ml/(L of blood) is in terms of that new parameter.
\item In considering concurrent dialysis one source concludes ``the best you can expect with this sort of circuit is to halve the concentration of the solute. In the end, your patient and the dialysate fluid will both have the same concentration of urea.''\cite{derangedphysiology2014}  Defend or counter this claim based on this model. If this model does not conform to this claim how might you resolve the difference?  Might the circuit spoken of NOT use clean dialytic fluids at the entry of the membrane contact portion of the device?
\end{enumerate}

\teacher{
\section*{COMMENTS}

We enclose complete analyses of all the activities and more in a Mathematica notebook 5-5-Dialysis-TeachersVersion.nb and an accompanying pdf file for those who do not have access to Mathematica. We offer two of the graphics from the file which show results from three (Figure~\ref{fig:5-5-Dialysis-ComparisonsThreeCompartment}) and nine (Figure~\ref{fig:5-5-Dialysis-ComparisonsNineCompartment}) compartment models.

We have used this as a several days project for often in setting up  differential equations for 3 compartments and moreso with 9 compartments  the bookkeeping in the differential equations gets tedious and is error-proned. Students enjoy seeing that a simple model can give meaningful results and fit with the claims that countercurrent analysis is best, even in a limited modeling scenario offered here.

When we changed parameters (we elected to change $rM$, the rate (L dialytic fluid/min) of flow of dialytic fluid from dialytic fluid compartment to dialytic fluid compartment we found that no matter how fast we sent the dialytic fluid through the device there seemed to be a leveling off (see Figure~\ref{fig:5-5-Dialysis-LongTerm}) of the time at which the device would take to get to 50 ml/L urea in the blood. So we do not really have to speed through the dialytic fluid. Indeed, we can see that the rate, $rM$ is in the neighborhood, of the rate which the manual for a dialysis machine operates prescribes \cite[p. 24]{Fresenuis2001} and will bring us quite close 50 mL/L urea levels in  about 13 minutes.



 \begin{figure}[h]
\centering
\includegraphics[width=14cm]{5-5-Dialysis-LongTerm.eps}



\parbox{13 true cm}{\caption{\label{fig:5-5-Dialysis-LongTerm}  Plot of the time until there is  50 ml/L urea in entire blood system of the patient as a function of $rM$, the rate (L dialytic fluid/min) of flow of dialytic fluid from dialytic fluid compartment to dialytic fluid compartment.}}
\end{figure}



What the model shows is what the literature says, ``Physically speaking, countercurrent flow optimizes the concentration gradient throughout the length that the dialysate and blood are flowing next to one another. This causes more urea to diffuse through the membrane within this length, allowing the blood to be cleaned faster than concurrent flow.''\cite{WikiAnswers2014}


\newpage


 \begin{figure}[h]
\centering
\includegraphics[width=13cm]{5-5-Dialysis-ComparisonsThreeCompartment.eps}



\parbox{13 true cm}{\caption{\label{fig:5-5-Dialysis-ComparisonsThreeCompartment}  Plot of the results of using concurrent and countercurrent dialysis with a three compartment model. The concentration (mL/L) of mL urea per L of blood going into blood compartment at time $t$ is seen to decrease faster with countercurrent dialysis than with concurrent dialysis. 
The time to reach the desired level of 50 mL/L in the blood is 90.05 min (thick) using countercurrent dialysis and 104.38 min (thin) using concurrent dialysis.}}
\end{figure}


 \begin{figure}[!h]
\centering
\includegraphics[width=13cm]{5-5-Dialysis-ComparisonsNineCompartment.eps}



\parbox{13 true cm}{\caption{\label{fig:5-5-Dialysis-ComparisonsNineCompartment}  Plot of the results of using concurrent and countercurrent dialysis with a nine compartment model. The concentration (mL/L) of mL urea per L of blood going into blood compartment at time $t$ is seen to decrease faster with countercurrent dialysis than with concurrent dialysis.  The time to reach the desired level of 50 mL/L in the blood is 21.43 min (thick) using countercurrent dialysis and 95.96 min (thin)  using concurrent dialysis.
}}
\end{figure}
}


\begin{thebibliography}{99}
\bibitem{derangedphysiology2014} Deranged Physiology. 2014. Dialysis. \url{http://www.derangedphysiology.com/php/dialysis/6-The-benefits-of-the-counter-current-circuit-in-hemodialysis.php}.  Accessed 3 April 2014.

\teacher{
\bibitem{Fresenuis2001} Fresenius. 2001.  {\it Operator's Manual:  Fresenius 2008H Hemodialysis Machine\/}.  Walnut Creek CA:  Fresenius USA, Inc.  
}
 
\bibitem{Teboh-Ewungkema2006} Teboh-Ewungkema,M. I. and  E. P. Salatheb. 2006. The Role of Counter-Current Exchange in Preventing
Hypoxia in Skeletal Muscle. {\it Bulletin of Mathematical Biology\/}. 68: 2191-2204.

\teacher{
\bibitem{WikiAnswers2014} WikiAnswers. 2014.  \url{http://wiki.answers.com/Q/What\_is\_the\_aim\_of\_the\_countercurrent\_ flow\_in\_the\_hemodialysis\_dialyzer}. Accessed 4 April 2014.
}

\bibitem{Ash2000}  Ash, L. 2000.  Counter Current Heat Exchange and  Selective Vasoconstriction. Edmonton, Alberta CANADA: Department of biological Science,s University of Alberta. \url{http://www.biology.ualberta.ca/facilities/multimedia/uploads/zoology/counter-current.html}. Accessed 14 April 2014.
\end{thebibliography}









\end{document}
 
