D'Onofrio model, binary variant (AMPL)

From mintOC
Jump to: navigation, search

This page contains a discretized version of the MIOCP D'Onofrio model (binary variant) in AMPL format and with the package ampl_mintoc. You should be aware of the comments regarding discretization made on the AMPL overview page. Note that you will need to include two generic support AMPL files, mintocPre.mod and mintocPost.mod.

AMPL

The model in AMPL code for a fixed control discretization grid with a collocation method. We need a model file donofrio.mod,

# -------------------------------
# Model: D'Onofrio chemotherapy model, Mintoc.de, Clemens Zeile 2017
# Outer Convexification formulation
# -------------------------------
 
# Problem specific parameters and variables
param zeta;
param b;
param mu;
param d;
param G;
param F;
param eta_dono;
param u_0_max;
param x_2_max;
param x_0_0;
param x_1_0;
param x_2_0;
param x_3_0;
param u_1_max;
param x_3_max;
param alpha_dono;
 
 
# Problem specific functions
# Note: scaled to  \in {0,1}
var f {k in X,o in 0..no,i in I} = (
	if      (k==1 && o==0) then -zeta*x[1,i]*log(x[1,i]/x[2,i])  
	else if (k==1 && o==1) then 0
	else if (k==1 && o==2) then -F*x[1,i]*u_1_max
	else if (k==1 && o==3) then -F*x[1,i]*u_1_max
	else if (k==1 && o==4) then 0
	else if (k==2 && o==0) then b*x[1,i]-mu*x[2,i]-d*(x[1,i])^(2/3)*x[2,i] 
	else if (k==2 && o==1) then -G*x[2,i]*u_0_max
	else if (k==2 && o==2) then -eta_dono*x[2,i]*u_1_max
	else if (k==2 && o==3) then -G*x[2,i]*u_0_max-eta_dono*x[2,i]*u_1_max
	else if (k==2 && o==4) then 0
	else if (k==3 && o==0) then 0
	else if (k==3 && o==1) then u_0_max
	else if (k==3 && o==3) then u_0_max
	else if (k==4 && o==2) then u_1_max
	else if (k==4 && o==3) then u_1_max
	else 0
);
 
var mayer = x[1,nt];
 
var lagrange{i in IC} = alpha_dono * (wi[1,i]^2+wi[3,i]^2);
 
var re{k in RE} = (
	if           (k==1)   then x[1,0]  - x_0_0
	else if      (k==2)   then x[2,0]  - x_1_0
	else if      (k==3)   then x[3,0]  - x_2_0
	else if      (k==4)   then x[4,0]  - x_3_0
);
 
var con {k in C, i in IC} = (
	if      (k==1) then x[3,i] - x_2_max
	else if     (k==2) then x[4,i] - x_3_max
);
 
# -----------------------------------------
# Unused modeling parts
 
 
var ri {k in RI} = (
	if      (k==1) then x[1,0]
);
 
var xa {k in XA, i in I} = (
	if      (k==1) then x[1,i]
);
 
 
var vcon {k in VC, o in 0..no, i in IC} = (
	if      (k==1) then x[1,i]
);
 
var sw{o in Omega, i in IC diff {nt}, k in 1..nsw} = (
	if      (k==1) then x[1,i] - 0.8
	else if (k==2) then 1.4 - x[1,i]
);

the data file donofrio.dat

# -------------------------------
# Data: D'Onofrio chemotherapy model, Mintoc.de, Clemens Zeile 2017
# -------------------------------
 
# Dimensions, all other 0 by default
param nxd := 4;
param no := 4;
param nre := 4;
param nc := 2;
 
 
# Algorithmic parameters
##param nt := 3600;
##param ntperu := 2;
 
# Problem parameters
 
let T := 6;
 
let zeta := 0.192;
let b := 5.85;
let mu := 0.0;
let d := 0.00873;
let G := 0.15;
let F := 1;
let eta_dono := 1;
let x_2_0 := 0;
let x_3_0 := 0;
let u_0_max := 75;
let x_2_max := 300;
 
let alpha_dono := 0;
 
 
#scenario 1
#let x_0_0 := 12000;
#let x_1_0 := 15000;
#let u_1_max := 1;
#let x_3_max := 2;
 
#scenario 2
#let x_0_0 := 12000;
#let x_1_0 := 15000;
#let u_1_max := 1;
#let x_3_max := 10;
 
#scenario 3
#let x_0_0 := 14000;
#let x_1_0 := 5000;
#let u_1_max := 1;
#let x_3_max := 2;
 
#scenario 4
#let x_0_0 := 14000;
#let x_1_0 := 5000;
#let u_1_max := 2;
#let x_3_max := 10;
 
 
 
# Initial values control
#let {i in IU} wi[1,i] := 0.9;
option randseed 10;
let {i in IU} wi[1,i] := Uniform01();
 
# Plot names
let nplots := 2;
let filename_base := "donofrio";
let {k in X} plotx[k] := 1;
let plotw[1] := 2;
let plotw[2] := 2;


and the run file

##############################
model ../mintocPre.mod;
model donofrio.mod;
model ../mintocPost.mod;
data donofrio.dat;
##############################
 
let isSOS1 := 1;
let integrator := "explicitEuler";
 
 
 
 
##############################
let integrator := "radau3";
let mode := "Relaxed";
include ../solve.run;
include ../plot1404.run;
include ../printOutput.run;
 
##############################
let mode := "CIA";
include ../solveMILP.run;
let mode := "Simulate";
include ../solve.run;
let filename_ext := "CIA";
include ../plot1404.run;
include ../printOutput.run;