# space-25-r.mod LQR2-AN-893-235
#
# MINLP model of twenty five bar space truss
#
# 1. Model discrete sizes as SOS-1 variables
# 2. Units kips, in; except for density in lbs/in^3
# 3. Optimum weight in lbs
#
# Reduced model (compared to space-25.mod) in the sense that
# defined variables are used to eliminate variables S[m] and R[m,y].
#
# From a GAMS file by F. Tin-Loi : 4 April 00
# AMPL coding: S. Leyffer, University of Dundee, April 2000.
#
# data file space-25-r.dat with 750 binary (or 25 SOS 1) variables
# ... modelling discrete sizes with SOS1 variables
param Nsize; # ... No. of different sizes
param size{1..Nsize}; # ... discrete sizes
# ... number of elements in each of sets defined below
param Ndof;
param Nmembers;
# ... definition of sets
set dof := 1..Ndof; # ... No. structure dof
set members := 1..Nmembers; # ... No. members
set yield := 1..2; # ... No. yield functions per member
set mdof := 1..6; # ... No. member dof
set proj := {"dx" , "dy" , "dz"}; # ... Truss coord projections
# ... group members of same areas
set group1 within members; set group2 within members;
set group3 within members; set group4 within members;
set group5 within members; set group6 within members;
set group7 within members;
# ... parameters
param F {dof} default 0;
param N {members,yield};
param truss {members,proj} default 0; # ... x y z projections
param lv {members,mdof}, integer; # ... location vectors
param C {members,dof}, default 0; # ... Structure C
param mC {members,mdof}, default 0; # ... Elements C
param L {m in members}
:= sqrt( truss[m,"dx"]^2 + truss[m,"dy"]^2 + truss[m,"dz"]^2 );
param ll {m in members} := truss[m,"dx"] / L[m];
param mm {m in members} := truss[m,"dy"] / L[m];
param nn {m in members} := truss[m,"dz"] / L[m];
param E {members} := 1e4; # ... Young's modulus (?)
param sigma{members} := 40;
param density := 0.1; # ... Units lbs per cubic inch
param ul {dof} default -1E20; # ... lower bounds on u
param uu {dof} default 1E20; # ... upper bounds on u
# ... variables with initial values & bounds
var A {members} >= 0.1, := 0.1;
var Q {members};
var u {d in dof} >= ul[d], <= uu[d];
# ... 0-1 variables for discrete sizes
var z {members,1..Nsize} binary;
# ... defined variables (depend linearly on A[m] alone)
var S {m in members} = E[m]*A[m]/L[m];
var R {m in members, y in yield} = sigma[m]*A[m];
# ... define additional variable (not used by optimizer !)
var stress {m in members} = Q[m] / A[m];
minimize cost: density * sum{m in members} A[m]*L[m];
subject to
compat {m in members}: - Q[m] + S[m]*sum{d in dof} C[m,d]*u[d] = 0;
equil {d in dof}: sum{m in members} C[m,d]*Q[m] - F[d] = 0;
constit {m in members, y in yield}: N[m,y]*Q[m] - R[m,y] <= 0;
tech1 {m in group1}: A[m] = A[2];
tech2 {m in group2}: A[m] = A[6];
tech3 {m in group3}: A[m] = A[10];
tech4 {m in group4}: A[m] = A[12];
tech5 {m in group5}: A[m] = A[14];
tech6 {m in group6}: A[m] = A[18];
tech7 {m in group7}: A[m] = A[22];
# ... integer constraints to model discrete sizes
SOS1 {m in members}: sum{i in 1..Nsize} z[m,i] = 1;
discr {m in members}: sum{i in 1..Nsize} z[m,i]*size[i] = A[m];