ampl/tp122.mod


If Cut/Copy and Paste fails, then click here for download.


# Model tp122
# Source version 1
# Simple APM canonicalizer version 1.3
# AMPL back end version 1.1
param mypi := 4*atan(1);
param c2 := 2;
param c3 := 3;
param c10 := 10;
param c20 := 20;
param c1000 := 1000;
param c100000 := 100000;
param rrough := ((50/c1000)/((2700 + 19300 + 7860)*(4/c3)*mypi))^(1/c3);
param rcage := 1;
var x_1;
let x_1 := rrough;
var x_2;
let x_2 := rrough;
var x_3;
let x_3 := rrough;
var x_4;
let x_4 := (-1)/c20;
var x_5;
let x_5 := 1/c20;
var x_6;
let x_6 := (-1)/c20;
var x_7;
let x_7 := (-1)/c20;
var x_8;
let x_8 := (-1)*rrough/c10;
var x_9;
let x_9 := 1/c20;
var x_10;
let x_10 := 1/c10;
var x_11;
let x_11 := 1/c10;
var x_12;
let x_12 := 1/c10;
var massa = 2700*(4/c3)*mypi*x_1^3;
var massg = 19300*(4/c3)*mypi*x_2^3;
var massi = 7860*(4/c3)*mypi*x_3^3;
var dista0p2 = x_4^2 + x_7^2 + x_10^2;
var distg0p2 = x_5^2 + x_8^2 + x_11^2;
var disti0p2 = x_6^2 + x_9^2 + x_12^2;
var distag = sqrt((x_4 - x_5)^2 + (x_7 - x_8)^2 + (x_10 - x_11)^2);
var distgi = sqrt((x_5 - x_6)^2 + (x_8 - x_9)^2 + (x_11 - x_12)^2);
var distia = sqrt((x_6 - x_4)^2 + (x_9 - x_7)^2 + (x_12 - x_10)^2);
var rsumag = x_1 + x_2;
var rsumgi = x_2 + x_3;
var rsumia = x_3 + x_1;
var mf = (980665/c100000)*(massa*x_10 + massg*x_11 + massi*x_12);
var c_1 = x_8 + x_2/c10;
var c_2 = massa + massg + massi - 50/c1000;
var c_3 = (x_1^2 + 2*rcage*(x_10 - x_1) - dista0p2)/rrough;
var c_4 = (x_2^2 + 2*rcage*(x_11 - x_2) - distg0p2)/rrough;
var c_5 = (x_3^2 + 2*rcage*(x_12 - x_3) - disti0p2)/rrough;
var c_6 = distag - rsumag;
var c_7 = distgi - rsumgi;
var c_8 = distia - rsumia;
var c_9 = (-1)*(x_4 + x_1/c10);
var c_10 = x_5 - x_2/c10;
var c_11 = (-1)*(x_6 + x_3/c10);
var c_12 = (-1)*(x_7 + x_1/c10);
var c_13 = x_9 - x_3/c10;
var c_14 = x_1 - x_2/c2;
var c_15 = x_1 - x_3/c2;
var c_16 = x_2 - x_1/c2;
var c_17 = x_2 - x_3/c2;
var c_18 = x_3 - x_1/c2;
var c_19 = x_3 - x_2/c2;
var myminfun = mf;
var myabsdevnod0_0 = abs(myminfun - 0.003625517252207682);
var myreldevnod0_0 = abs(myminfun/0.003625517252207682 - 1);
var myabsdevnod0_1 = abs(x_1 - 0.007322215428894107);
var myreldevnod0_1 = abs(x_1/0.007322215428894107 - 1);
var myabsdevnod0_2 = abs(x_2 - 0.007383190030817839);
var myreldevnod0_2 = abs(x_2/0.007383190030817839 - 1);
var myabsdevnod0_3 = abs(x_3 - 0.007340627520740361);
var myreldevnod0_3 = abs(x_3/0.007340627520740361 - 1);
var myabsdevnod0_4 = abs(x_4 + 0.007248606058940914);
var myreldevnod0_4 = abs(x_4/0.007248606058940914 + 1);
var myabsdevnod0_5 = abs(x_5 - 0.00457274646768661);
var myreldevnod0_5 = abs(x_5/0.00457274646768661 - 1);
var myabsdevnod0_6 = abs(x_6 + 0.008953401300522358);
var myreldevnod0_6 = abs(x_6/0.008953401300522358 + 1);
var myabsdevnod0_7 = abs(x_7 + 0.009485008329662611);
var myreldevnod0_7 = abs(x_7/0.009485008329662611 + 1);
var myabsdevnod0_8 = abs(x_8 + 0.0007383190030817839);
var myreldevnod0_8 = abs(x_8/0.0007383190030817839 + 1);
var myabsdevnod0_9 = abs(x_9 - 0.005078392253646442);
var myreldevnod0_9 = abs(x_9/0.005078392253646442 - 1);
var myabsdevnod0_10 = abs(x_10 - 0.007393997445014723);
var myreldevnod0_10 = abs(x_10/0.007393997445014723 - 1);
var myabsdevnod0_11 = abs(x_11 - 0.007393997445014723);
var myreldevnod0_11 = abs(x_11/0.007393997445014723 - 1);
var myabsdevnod0_12 = abs(x_12 - 0.007393997445014723);
var myreldevnod0_12 = abs(x_12/0.007393997445014723 - 1);
var myabsdevnod1_0 = (1/2)*(abs(myabsdevnod0_0 - myabsdevnod0_1) + (myabsdevnod0_0 + myabsdevnod0_1));
var myreldevnod1_0 = (1/2)*(abs(myreldevnod0_0 - myreldevnod0_1) + (myreldevnod0_0 + myreldevnod0_1));
var myabsdevnod1_2 = (1/2)*(abs(myabsdevnod0_2 - myabsdevnod0_3) + (myabsdevnod0_2 + myabsdevnod0_3));
var myreldevnod1_2 = (1/2)*(abs(myreldevnod0_2 - myreldevnod0_3) + (myreldevnod0_2 + myreldevnod0_3));
var myabsdevnod1_4 = (1/2)*(abs(myabsdevnod0_4 - myabsdevnod0_5) + (myabsdevnod0_4 + myabsdevnod0_5));
var myreldevnod1_4 = (1/2)*(abs(myreldevnod0_4 - myreldevnod0_5) + (myreldevnod0_4 + myreldevnod0_5));
var myabsdevnod1_6 = (1/2)*(abs(myabsdevnod0_6 - myabsdevnod0_7) + (myabsdevnod0_6 + myabsdevnod0_7));
var myreldevnod1_6 = (1/2)*(abs(myreldevnod0_6 - myreldevnod0_7) + (myreldevnod0_6 + myreldevnod0_7));
var myabsdevnod1_8 = (1/2)*(abs(myabsdevnod0_8 - myabsdevnod0_9) + (myabsdevnod0_8 + myabsdevnod0_9));
var myreldevnod1_8 = (1/2)*(abs(myreldevnod0_8 - myreldevnod0_9) + (myreldevnod0_8 + myreldevnod0_9));
var myabsdevnod1_10 = (1/2)*(abs(myabsdevnod0_10 - myabsdevnod0_11) + (myabsdevnod0_10 + myabsdevnod0_11));
var myreldevnod1_10 = (1/2)*(abs(myreldevnod0_10 - myreldevnod0_11) + (myreldevnod0_10 + myreldevnod0_11));
var myabsdevnod1_12 = myabsdevnod0_12;
var myreldevnod1_12 = myreldevnod0_12;
var myabsdevnod2_0 = (1/2)*(abs(myabsdevnod1_0 - myabsdevnod1_2) + (myabsdevnod1_0 + myabsdevnod1_2));
var myreldevnod2_0 = (1/2)*(abs(myreldevnod1_0 - myreldevnod1_2) + (myreldevnod1_0 + myreldevnod1_2));
var myabsdevnod2_4 = (1/2)*(abs(myabsdevnod1_4 - myabsdevnod1_6) + (myabsdevnod1_4 + myabsdevnod1_6));
var myreldevnod2_4 = (1/2)*(abs(myreldevnod1_4 - myreldevnod1_6) + (myreldevnod1_4 + myreldevnod1_6));
var myabsdevnod2_8 = (1/2)*(abs(myabsdevnod1_8 - myabsdevnod1_10) + (myabsdevnod1_8 + myabsdevnod1_10));
var myreldevnod2_8 = (1/2)*(abs(myreldevnod1_8 - myreldevnod1_10) + (myreldevnod1_8 + myreldevnod1_10));
var myabsdevnod2_12 = myabsdevnod1_12;
var myreldevnod2_12 = myreldevnod1_12;
var myabsdevnod3_0 = (1/2)*(abs(myabsdevnod2_0 - myabsdevnod2_4) + (myabsdevnod2_0 + myabsdevnod2_4));
var myreldevnod3_0 = (1/2)*(abs(myreldevnod2_0 - myreldevnod2_4) + (myreldevnod2_0 + myreldevnod2_4));
var myabsdevnod3_8 = (1/2)*(abs(myabsdevnod2_8 - myabsdevnod2_12) + (myabsdevnod2_8 + myabsdevnod2_12));
var myreldevnod3_8 = (1/2)*(abs(myreldevnod2_8 - myreldevnod2_12) + (myreldevnod2_8 + myreldevnod2_12));
var myabsdevnod4_0 = (1/2)*(abs(myabsdevnod3_0 - myabsdevnod3_8) + (myabsdevnod3_0 + myabsdevnod3_8));
var myreldevnod4_0 = (1/2)*(abs(myreldevnod3_0 - myreldevnod3_8) + (myreldevnod3_0 + myreldevnod3_8));
var zmyabsdevmax = myabsdevnod4_0;
var zmyreldevmax = myreldevnod4_0;
minimize obj: myminfun;
subject to ce_1: c_1 = 0;
subject to ce_2: c_2 = 0;
subject to ci_1: c_3 >= 0;
subject to ci_2: c_4 >= 0;
subject to ci_3: c_5 >= 0;
subject to ci_4: c_6 >= 0;
subject to ci_5: c_7 >= 0;
subject to ci_6: c_8 >= 0;
subject to ci_7: c_9 >= 0;
subject to ci_8: c_10 >= 0;
subject to ci_9: c_11 >= 0;
subject to ci_10: c_12 >= 0;
subject to ci_11: c_13 >= 0;
subject to ci_12: c_14 >= 0;
subject to ci_13: c_15 >= 0;
subject to ci_14: c_16 >= 0;
subject to ci_15: c_17 >= 0;
subject to ci_16: c_18 >= 0;
subject to ci_17: c_19 >= 0;
solve;
display x_1;
display x_2;
display x_3;
display x_4;
display x_5;
display x_6;
display x_7;
display x_8;
display x_9;
display x_10;
display x_11;
display x_12;
display myminfun;
display zmyabsdevmax;
display zmyreldevmax;
# End Model

Stephan K.H. Seidl