% oxon dosing for 90 days to adult rats
% 20, 1000, or 2000 ppm


rat_parameters 	        % rat parameters
TSTOP=2400;      			  % Simulation duration

MAXT=0.01;        %maximum time step
MINT=1.0e-3;      %minimum time step


%90 day exposure
%BW during study (weekly)
%males--Column B; females--Column C
DT = xlsread("oxon_bw_90_days.xls", "20ppm", "A1:A101"); 
BWT=xlsread("oxon_bw_90_days.xls","20ppm","c1:c101"); 
%to dose with various concentrations, change name of subsheet accordingly
%to dose males--Column B; to dose females--column C
DT = xlsRead("oxon_dosing_90_days_3.xls", "20ppm", "A1:A101");  % Dosing Times (hr)
DORALO=xlsRead("oxon_dosing_90_days_3.xls", "20ppm", "c1:c101"); % Dose in ug/kg

prepare @clear @all

load @format=ascii @separator=comma @ignoreheader @file=oxon_90days_1.csv oxon_1
tdata1=oxon_1
load @format=ascii @separator=comma @ignoreheader @file=oxon_90days_2.csv oxon_2
tdata2=oxon_2
load @format=ascii @separator=comma @ignoreheader @file=oxon_90days_3.csv oxon_3
tdata3=oxon_3


start@nocallback

%20 ppm
plot(_time, _bce, "-", tdata1(:,1), tdata1(:,3),tdata1(:,1), tdata1(:,5), "*", 'oxon_90days_1_brain.aps')
plot(_time, _rbcce, "-", tdata1(:,1), tdata1(:,2),tdata1(:,1), tdata1(:,4), "*", 'oxon_90days_1_RBC.aps')

%1000 ppm
%plot(_time, _bce, "-", tdata2(:,1), tdata2(:,3),tdata2(:,1), tdata2(:,5), "*", 'oxon_90days_2_brain.aps')
%plot(_time, _rbcce, "-", tdata2(:,1), tdata2(:,2),tdata2(:,1), tdata2(:,4), "*", 'oxon_90days_2_RBC.aps')

%2000 ppm
%plot(_time, _bce, "-", tdata3(:,1), tdata3(:,3),tdata3(:,1), tdata3(:,5), "*", 'oxon_90days_3_brain.aps')
%plot(_time, _rbcce, "-", tdata3(:,1), tdata3(:,2),tdata3(:,1), tdata3(:,4), "*", 'oxon_90days_3_RBC.aps')




