Detailed Description
Coil Compression String Design model.
This example shows how to setup quadratic and nonlinear constraints in SCIP when using SCIP as callable library. The example implements a model for the design of a coil compression string as it can be found in the GAMS model library: http://www.gams.com/modlib/libhtml/spring.htm
The task is to find a minimum volume of a wire for the production of a coil compression spring.
Original model source:
- E. Sangren
Nonlinear Integer and Discrete Programming in Mechanical Design Optimization
Journal of Mechanical Design, Trans. ASME 112 (1990), 223-229
Definition in file string.c.
Go to the source code of this file.
Macros | |
#define | M_PI 3.141592653589793238462643 |
#define | nwires 11 |
Functions | |
static SCIP_RETCODE | setupProblem (SCIP *scip) |
static SCIP_RETCODE | runString (void) |
int | main (int argc, char **argv) |
Variables | |
static const SCIP_Real | diameters [] = { 0.207, 0.225, 0.244, 0.263, 0.283, 0.307, 0.331, 0.362, 0.394, 0.4375, 0.500 } |
static const SCIP_Real | preload = 300 |
static const SCIP_Real | maxworkload = 1000 |
static const SCIP_Real | maxdeflect = 6 |
static const SCIP_Real | deflectpreload = 1.25 |
static const SCIP_Real | maxfreelen = 14.0 |
static const SCIP_Real | maxcoildiam = 3.0 |
static const SCIP_Real | maxshearstress = 189000.0 |
static const SCIP_Real | shearmod = 11500000.0 |
Macro Definition Documentation
◆ M_PI
#define M_PI 3.141592653589793238462643 |
Definition at line 42 of file string.c.
Referenced by setupProblem().
◆ nwires
#define nwires 11 |
Function Documentation
◆ setupProblem()
|
static |
sets up problem
- Parameters
-
scip SCIP data structure
Definition at line 81 of file string.c.
References deflectpreload, diameters, FALSE, M_PI, maxcoildiam, maxdeflect, maxfreelen, maxshearstress, maxworkload, NULL, nwires, preload, SCIP_CALL, SCIP_EXPR_DIV, SCIP_EXPR_INTPOWER, SCIP_EXPR_VARIDX, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIP_VARTYPE_BINARY, SCIP_VARTYPE_CONTINUOUS, SCIP_VARTYPE_INTEGER, SCIPaddBilinTermQuadratic(), SCIPaddCoefLinear(), SCIPaddCons(), SCIPaddQuadVarLinearCoefQuadratic(), SCIPaddSquareCoefQuadratic(), SCIPaddVar(), SCIPblkmem(), SCIPchgVarLb(), SCIPchgVarUb(), SCIPcreateConsBasicLinear(), SCIPcreateConsBasicNonlinear(), SCIPcreateConsBasicQuadratic(), SCIPcreateConsBasicSetpart(), SCIPcreateProbBasic(), SCIPcreateVarBasic(), SCIPexprCreate(), SCIPexprCreateLinear(), SCIPexprCreateMonomial(), SCIPexprCreatePolynomial(), SCIPexprtreeCreate(), SCIPexprtreeFree(), SCIPexprtreeSetVars(), SCIPinfinity(), SCIPreleaseCons(), SCIPreleaseVar(), SCIPsnprintf(), shearmod, and y.
Referenced by runString().
◆ runString()
|
static |
Definition at line 432 of file string.c.
References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPcreate(), SCIPfree(), SCIPgetBestSol(), SCIPgetNSols(), SCIPincludeDefaultPlugins(), SCIPinfoMessage(), SCIPpresolve(), SCIPprintOrigProblem(), SCIPprintSol(), SCIPsolve(), and setupProblem().
Referenced by main().
◆ main()
int main | ( | int | argc, |
char ** | argv | ||
) |
main method starting SCIP
- Parameters
-
argc number of arguments from the shell argv array of shell arguments
Definition at line 473 of file string.c.
References runString(), SCIP_OKAY, and SCIPprintError().
Variable Documentation
◆ diameters
|
static |
diameters of available diameters (in)
Definition at line 52 of file string.c.
Referenced by setupProblem().
◆ preload
|
static |
◆ maxworkload
|
static |
◆ maxdeflect
|
static |
◆ deflectpreload
|
static |
◆ maxfreelen
|
static |
maximal free length of spring (in)
Definition at line 67 of file string.c.
Referenced by setupProblem().
◆ maxcoildiam
|
static |
◆ maxshearstress
|
static |
◆ shearmod
|
static |