##################INITIALIZATION EQUATIONS #################
$intestinemg=0;
$weight=$weight/2.2;
$absorption=$intestinemg/1.5;
$volplasma=3000;
$volextracel=12000;
$volintracel=24500;
$voldistribution=$volplasma+$volextracel+$volintracel;
$stepamt=$amtrenalfailure*60;
$renalfunction=0;
$steptime=48;
if ($time == $steptime) {
$renalfunction+=$stepamt;
}
$glomfiltrate=130*60+$renalfunction;
$clearance=$glomfiltrate;
$calchalflife= .693*$voldistribution/$clearance;
$plasmamg=0;
$concplasma= $plasmamg/$volplasma;
$extracellularmg=0;
$concextracel=$extracellularmg/$volextracel;
$capillary= ($concplasma-$concextracel)*10000;
$intracellularmg=0;
$concintracel=$intracellularmg/$volintracel;
$cellmembrane=($concextracel-$concintracel)*10000;
$filtration=$concplasma*$glomfiltrate;
$firstpulse=0;
$pulseamt=$dosage*$weight;
$xmax=24*$xmax;
$maxtime=24*$days;
$doseint=$frequency/24;
if ($time==$firstpulse || ($time/$dt) % ($doseint/$dt)==0) {
$flucytosine=$pulseamt/$dt;
} else {
$flucytosine=0;
}
$kidneymg=0;
$urine=$kidneymg/.2;
################## RUNTIME EQUATIONS ######################
open (FLUCYT, "> /tmp/flucyt$$.dat") || die "couldn't open flucyt$$.dat: $! \n";
open (EFFECT, "> /tmp/effect$$.dat") || die "couldn't open effect$$.dat:$! \n";
open (TOXIC, "> /tmp/toxic$$.dat") || die "couldn't open toxic$$.dat:$! \n";
for ($time=0;$time<=$maxtime;$time +=$dt) {
print FLUCYT "$time $concplasma\n";
print EFFECT "$time $concplasma\n";
print TOXIC "$time $concplasma\n";
$intestinemg=$intestinemg+($flucytosine-$absorption) *$dt;
$plasmamg=$plasmamg+($absorption-$capillary-$filtration)*$dt;
$extracellularmg=$extracellularmg+($capillary-$cellmembrane)*$dt;
$intracellularmg=$intracellularmg + $cellmembrane *$dt;
$kidneymg=$kidneymg + ($filtration-$urine) *$dt;
$absorption=$intestinemg/1.5;
$voldistribution=$volplasma+$volextracel+$volintracel;
if ($time==$steptime) {
$renalfunction+=$stepamt;
}
$glomfiltrate=(130*60)+$renalfunction;
$clearance=$glomfiltrate;
$calchalflife=.693*$voldistribution/$clearance;
$concplasma=$plasmamg/$volplasma;
$concextracel=$extracellularmg/$volextracel;
$capillary=($concplasma-$concextracel)*10000;
$concintracel=$intracellularmg/$volintracel;
$cellmembrane=($concextracel-$concintracel)*10000;
$filtration=$concplasma*$glomfiltrate;
$temp=$time/$dt;
if ($time==$firstpulse || (&round_pos($temp)) % ($doseint/$dt) ==0) {
$flucytosine=$pulseamt/$dt;
} else {
$flucytosine=0;
}
$urine=$kidneymg/.2;
}
sub round_pos {
local($exp)=@_;
if (($exp-int($exp)) < .5 ) {
return int($exp);
{ else }
return (int($exp)+1);
}
}
close (FLUCYT);
close (EFFECT);
close (TOXIC);