Scippy

SCIP

Solving Constraint Integer Programs

string.c File Reference

Detailed Description

Coil Compression String Design model.

Author
Stefan Vigerske

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.

#include <stdio.h>
#include <math.h>
#include "scip/scip.h"
#include "scip/scipdefplugins.h"

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

◆ nwires

#define nwires   11

number of possible wire types

Definition at line 49 of file string.c.

Referenced by setupProblem().

Function Documentation

◆ setupProblem()

◆ runString()

◆ main()

int main ( int  argc,
char **  argv 
)

main method starting SCIP

Parameters
argcnumber of arguments from the shell
argvarray of shell arguments

Definition at line 475 of file string.c.

References runString(), SCIP_OKAY, and SCIPprintError().

Variable Documentation

◆ diameters

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

diameters of available diameters (in)

Definition at line 52 of file string.c.

Referenced by setupProblem().

◆ preload

const SCIP_Real preload = 300
static

preload (lb)

Definition at line 55 of file string.c.

Referenced by setupProblem().

◆ maxworkload

const SCIP_Real maxworkload = 1000
static

maximal working load (lb)

Definition at line 58 of file string.c.

Referenced by setupProblem().

◆ maxdeflect

const SCIP_Real maxdeflect = 6
static

maximal deflection (in)

Definition at line 61 of file string.c.

Referenced by setupProblem().

◆ deflectpreload

const SCIP_Real deflectpreload = 1.25
static

deflection from preload (in)

Definition at line 64 of file string.c.

Referenced by setupProblem().

◆ maxfreelen

const SCIP_Real maxfreelen = 14.0
static

maximal free length of spring (in)

Definition at line 67 of file string.c.

Referenced by setupProblem().

◆ maxcoildiam

const SCIP_Real maxcoildiam = 3.0
static

maximal coil diameter (in)

Definition at line 70 of file string.c.

Referenced by setupProblem().

◆ maxshearstress

const SCIP_Real maxshearstress = 189000.0
static

maximal shear stress

Definition at line 73 of file string.c.

Referenced by setupProblem().

◆ shearmod

const SCIP_Real shearmod = 11500000.0
static

shear modulus of material

Definition at line 76 of file string.c.

Referenced by setupProblem().