Detailed Description
Simple Gas Transportation Model.
This example shows how to setup nonlinear constraints with signpower-expression when using SCIP as callable library. The example implements a model for the distribution of gas through a network of pipelines, which is formulated as a cost minimization subject to nonlinear flow-pressure relations, material balances, and pressure bounds. The Belgian gas network is used as an example.
The model is taken from the GAMS model library: https://www.gams.com/latest/gamslib_ml/libhtml/gamslib_gastrans.html
Original model source:
- D. de Wolf and Y. Smeers
The Gas Transmission Problem Solved by and Extension of the Simplex Algorithm
Management Science 46, 11 (2000), 1454-1465
Definition in file gastrans.c.
Go to the source code of this file.
Data Structures | |
struct | NodeData |
struct | ArcData |
Macros | |
#define | nnodes 20 |
#define | narcs 24 |
#define | infinity 1e+20 |
Typedefs | |
typedef struct NodeData | NodeData |
typedef struct ArcData | ArcData |
Functions | |
static SCIP_RETCODE | setupProblem (SCIP *scip) |
static SCIP_RETCODE | runGastrans (void) |
int | main (int argc, char **argv) |
Variables | |
static const NodeData | nodedata [] |
static const ArcData | arcdata [] |
static const SCIP_Real | gastemp = 281.15 |
static const SCIP_Real | rugosity = 0.05 |
static const SCIP_Real | density = 0.616 |
static const SCIP_Real | compressibility = 0.8 |
Macro Definition Documentation
◆ nnodes
#define nnodes 20 |
number of nodes (towns)
Definition at line 74 of file gastrans.c.
Referenced by addBoundCutSepa(), addNodesInformation(), applyRepair(), calculateScalingValue(), checkLeavesBelowIncumbent(), COLORprobGetComplementaryGraph(), COLORprobSetUpArrayOfCons(), compSubcliques(), computeBranchingPriorities(), computeMinDistance(), computeNextAdjacency(), createClique(), createConsStoreGraphAtRoot(), createMIP(), createNewSol(), createVariableNodes(), depthFirstSearch(), determineGraphSize(), ensureSuccessorsSize(), fillGraphByConss(), fillGraphByLinearConss(), fillGraphByNonlinearConss(), findArticulationPointsUtil(), findCumulativeConss(), findPrecedenceConss(), findSubtour(), freeConflictGraphSST(), generateBoundInequalityFromSOS1Nodes(), getEnsembleEstimation(), getNViolatedEdges(), greedyInitialColoring(), greedyStableSet(), hasUncoloredNode(), index2nodes(), isRestartApplicable(), nodes2index(), presolveCons(), readCol(), reopttreeGetNNodes(), runTabuCol(), SCIP_DECL_BRANCHEXECLP(), SCIP_DECL_CONCSOLVEREXEC(), SCIP_DECL_CONSACTIVE(), SCIP_DECL_HEUREXEC(), SCIP_DECL_NODESELSELECT(), SCIP_DECL_PRICERFARKAS(), SCIP_DECL_PRICERREDCOST(), SCIP_DECL_READERREAD(), SCIP_DECL_READERWRITE(), SCIPaddNNodes(), SCIPbtPrintGml(), SCIPcreateProbColoring(), SCIPdigraphAddArc(), SCIPdigraphAddArcSafe(), SCIPdigraphComputeDirectedComponents(), SCIPdigraphCopy(), SCIPdigraphCreate(), SCIPdigraphGetNodeData(), SCIPdigraphGetNSuccessors(), SCIPdigraphGetSuccessors(), SCIPdigraphGetSuccessorsData(), SCIPdigraphResize(), SCIPdigraphSetNodeData(), SCIPdigraphSetNSuccessors(), SCIPnodeGetAncestorBranchingPath(), SCIPprintNodeRootPath(), SCIPrealHashCode(), SCIPsolveCIP(), SCIPtreeGetAvgLowerbound(), selectBestNode(), setupProblem(), sortGenVBounds(), sortNodes(), subtreeSumGapSplit(), SYMcomputeSymmetryGenerators(), tarjan(), TCLIQUE_ISEDGE(), TCLIQUE_NEWSOL(), TCLIQUE_SELECTADJNODES(), tcliqueAddEdge(), tcliqueFlush(), tcliqueGetFirstAdjedge(), tcliqueGetLastAdjedge(), tcliquegraphConstructCliqueTable(), tcliqueMaxClique(), transitiveClosure(), wrapperRins(), and tsp::ReaderTSP::~ReaderTSP().
◆ narcs
#define narcs 24 |
number of arcs
Definition at line 77 of file gastrans.c.
Referenced by addGLSCliques(), createMIP(), doSeachEcAggr(), SCIPdigraphGetNArcs(), separateGLS(), and setupProblem().
◆ infinity
#define infinity 1e+20 |
value we use to represent infinity
Definition at line 80 of file gastrans.c.
Referenced by atomic_userexpr::atomic_userexpr(), resolvePropagation(), SCIPintervalAddInf(), SCIPintervalAddScalar(), SCIPintervalAddSup(), SCIPintervalDiv(), SCIPintervalDivScalar(), SCIPintervalEntropy(), SCIPintervalExp(), SCIPintervalIsEntire(), SCIPintervalLog(), SCIPintervalMulInf(), SCIPintervalMulScalarInf(), SCIPintervalMulScalarSup(), SCIPintervalMulSup(), SCIPintervalPowerScalar(), SCIPintervalQuadBivar(), SCIPintervalQuadUpperBound(), SCIPintervalReciprocal(), SCIPintervalScalprod(), SCIPintervalScalprodScalarsInf(), SCIPintervalScalprodScalarsSup(), SCIPintervalSetEntire(), SCIPintervalSignPowerScalar(), SCIPintervalSolveBivariateQuadExpressionAllScalar(), SCIPintervalSolveUnivariateQuadExpressionPositive(), SCIPintervalSolveUnivariateQuadExpressionPositiveAllScalar(), SCIPintervalSquare(), SCIPintervalSquareRoot(), SCIPintervalSub(), SCIPlpiInfinity(), SCIPlpiIsInfinity(), SCIPlpiScaleCol(), SCIPlpiScaleRow(), and setupProblem().
Typedef Documentation
◆ NodeData
◆ ArcData
Function Documentation
◆ setupProblem()
|
static |
sets up problem
- Parameters
-
scip SCIP data structure
Definition at line 154 of file gastrans.c.
References active, ArcData::active, compressibility, NodeData::cost, density, gastemp, infinity, ArcData::length, NodeData::name, narcs, nnodes, ArcData::node1, NULL, NodeData::pressurelower, NodeData::pressureupper, rugosity, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIP_VARTYPE_CONTINUOUS, SCIPaddCoefLinear(), SCIPaddCons(), SCIPaddVar(), SCIPcreateConsBasicLinear(), SCIPcreateConsBasicNonlinear(), SCIPcreateExprSignpower(), SCIPcreateExprSum(), SCIPcreateExprVar(), SCIPcreateProbBasic(), SCIPcreateVarBasic(), SCIPinfinity(), SCIPreleaseCons(), SCIPreleaseExpr(), SCIPreleaseVar(), SCIPsnprintf(), NodeData::supplylower, and NodeData::supplyupper.
Referenced by runGastrans().
◆ runGastrans()
|
static |
runs gas transportation example
Definition at line 331 of file gastrans.c.
References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPcreate(), SCIPfree(), SCIPincludeDefaultPlugins(), SCIPinfoMessage(), SCIPpresolve(), SCIPprintOrigProblem(), 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 374 of file gastrans.c.
References runGastrans(), SCIP_OKAY, and SCIPprintError().
Variable Documentation
◆ nodedata
|
static |
data of nodes
Definition at line 83 of file gastrans.c.
Referenced by addBranchingComplementaritiesSOS1(), addSSTConssOrbitAndUpdateSST(), analyzeConflictOverload(), checkConComponentsVarbound(), checkOverloadViaThetaTree(), collectThetaSubtree(), computeEnergyContribution(), deleteLambdaLeaf(), detectVarboundSOS1(), findResponsibleLambdaLeafTraceEnergy(), findResponsibleLambdaLeafTraceEnvelop(), freeConflictgraph(), freeConflictGraphSST(), generateBoundInequalityFromSOS1Nodes(), getBoundConsFromVertices(), inferboundsEdgeFinding(), initConflictgraph(), initImplGraphSOS1(), insertThetanode(), moveNodeToLambda(), nodeGetSolvalVarboundLbSOS1(), nodeGetSolvalVarboundUbSOS1(), passConComponentVarbound(), propVariableNonzero(), selectOrbitLeaderSSTConss(), sepaImplBoundCutsSOS1(), traceLambdaEnergy(), traceLambdaEnvelop(), traceThetaEnvelop(), updateEnvelope(), updateKeyOnTrace(), and updateSymInfoConflictGraphSST().
◆ arcdata
|
static |
data of arcs
Definition at line 109 of file gastrans.c.
◆ gastemp
|
static |
◆ rugosity
|
static |
◆ density
|
static |
density of gas relative to air
Definition at line 145 of file gastrans.c.
Referenced by setupProblem(), and tcliquegraphConstructCliqueTable().
◆ compressibility
|
static |