function [ dxdt ] = BodyModelF( t, x) %UNTITLED14 Summary of this function goes here % BLOOD FLOW Qc = 5.58; %L/min Qlung = Qc; Qvenous = Qc; Qarterial = Qc; Qliverin = 0.20 * Qc; Qintestine = 0.05 * Qc; QintestineHealthy = 0.045 * Qc; QintestineSick = 0.005 * Qc; Qliver = 0.25 * Qc; %Qliverin + QintestineHealthy + QintestineSick; Qkidney = 0.19 * Qc; Qrpt = 0.18 * Qc; Qspt = 0.38 * Qc; %sum(QintestineHealthy,Qliver,Qkidney,Qrpt,Qspt) %Tissue Volumes BV = 70; Vlung = 0.008 * Qc; Vvenous = 0.0557 * Qc; Varterial = 0.0243 * Qc; Vliver = 0.0260 * BV; Vkidney = 0.0044 * BV; Vrpt = 0.0516 * BV; Vspt = 0.76 * BV; Vintestine = 0.07 * BV; VintestineHealthy = 0.9 * Vintestine; VintestineSick = 0.1 * Vintestine; %Blood Ratio Cplasma = 4; Cblood = Cplasma + 3; Pbp = Cplasma / Cblood; % Blood tissue ratio for all organs Pblung = 2.5; Pbliver = 2.8; Pbkidney = 8.5; Pbrpt = 2.2; Pbspt = 0.7; PbintestineHealthy = 2.6; PbintestineSick = 2.6; % Elimination constance for the kidneys Kel = 0; %%%%%%%%%%%%%%%%%%%%Explanation of the dxdt%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % dxdt(1) = Crpt % dxdt(2) = Cspt % dxdt(3) = Cliver % dxdt(4) = Ckidney % dxdt(5) = Cvenous % dxdt(6) = Clung % dxdt(7) = Carterial % dxdt(8) = IntestineHealthy % dxdt(9) = IntestineSick %Organs according to standard flow calculations %RPT blood flow dxdt(1) = Qrpt / Vrpt * ( x(7) - (x(1) / Pbrpt )); %SPT blood flow dxdt(2) = Qspt / Vspt * ( x(7) - (x(2) / Pbspt )); %Healthy intestines from Fres blood flow %dxdt(8) = Qintestine * x(7) / VintestineHealthy - QintestineHealthy * x(8)/ PbintestineHealthy / VintestineHealthy - QintestineSick * x(8) / PbintestineHealthy / VintestineHealthy; dxdt(8) = Qintestine / Vintestine * ( x(7) - (x(8) / PbintestineHealthy)); %Tumor intestine from Healthy intestines %dxdt(9) = QintestineSick * x(8) / PbintestineHealthy / VintestineSick - QintestineSick * x(9) / PbintestineSick / VintestineSick; %Liver blood flow from Healthy intestine and from Fresh blood flow %dxdt(3) = Qliverin * x(7) / Vliver + QintestineHealthy * x(8) / PbintestineHealthy / Vliver + QintestineSick * x(9) / PbintestineSick / Vliver - Qliver * x(3) / Pbliver / Vliver; dxdt(3) = Qliverin / Vliver * x(7) + Qintestine / Vliver * x(8) / PbintestineHealthy - Qliver / Vliver * x(3) / Pbliver; %Kidney from Healthy blood flow, also removes some of the medicine dxdt(4) = Qkidney/Vkidney * (x(7) - x(4) / Pbkidney ) - ( Kel * x(4) / Vkidney * Pbkidney ); %Venous flow from all organs Cj = [x(1), x(2), x(3), x(4)];%, x(8)]; Qj = [Qrpt, Qspt, Qliver, Qkidney];% , QintestineHealthy]; Pbj = [Pbrpt, Pbspt, Pbliver, Pbkidney]; %, PbintestineHealthy]; som=0; for i = 1:length(Qj) som = som + Qj(i) * Cj(i) / Pbj(i); end dxdt(5) = 1 / Vvenous * ( som - Qvenous * x(5)); %Lung from Venous dxdt(6) = Qlung / Vlung * ( x(5) - (x(6) / Pblung )); %Arterial from Lung dxdt(7) = 1 / Varterial * ( Qlung * x(6) / Pblung - Qarterial * x(7) ); %transpose result dxdt = dxdt'; end