osemosys: motivation for using it as part of the tools for ... · osemosys: motivation for using it...
TRANSCRIPT
Osemosys: motivation for using it as part of the tools for the IEPPresentation by Dr. Schalk Kok
Principal Researcher, Advanced Mathematical Modelling,
Modelling and Digital Science, CSIR
30 March 2012
© CSIR 2009 www.csir.co.za
Overview: Presentation
• Numerical Optimization- Linear programming
• Gnu Linear Programming Kit (GLPK)• Osemosys• Scenario Planning
- Example• Limitations and benefits of Osemosys• Closure
© CSIR 2009 www.csir.co.za
Numerical optimization
• Formal mathematical technique to choose the “best” elements from a set of available alternatives- A measure is required to define “best”- Simplest techniques uses a single scalar value,
known as the objective function, cost function or merit function, to quantify which solution is better that another
• The objective can either be maximized (e.g. profit, performance) or minimized (e.g. cost, risk)
• Common practise to always minimize (maximization problems solved by minimizing the negative of the cost function)
- Usually subject to constraints (limits)
© CSIR 2009 www.csir.co.za
Numerical optimization
• Constraints should “oppose” the cost function i.e. a trade-off should exist between the cost function and the constraints
• Examples include- Design a minimum cost aeroplane subject to
performance constraints and strength constraints- Design a minimum cost skyscraper subject to
size constraints and strength constraints• The solution to an optimization problem is
described by the design variables, or decision variables x.
• The cost function and constraints have to expressed as functions of x.
© CSIR 2009 www.csir.co.za
• Minimize w.r.t. x f(x)such that g
i(x) ≤ 0 i=1,2,...p
and hj(x) = 0 j=1,2,...q
• x is the design variable vector [x1, x
2, … x
n]
• x can contain real numbers, integers, or binary variables
• f(x) is the cost function• g
i(x) is the i-th inequality constraint
• hj(x) is the j-th equality constraint
Numerical optimization
© CSIR 2009 www.csir.co.za
Linear programming
• If the cost function f(x) and all the constraints g(x) and h(x) are linear functions of x, the problem is known as a linear programming problem
• Linear programming algorithms are mature, and can handle many thousands design variables
• If the variables are real, the problem is convex and very efficient solution schemes exist (usually variations of the Simplex method developed by Dantzig in 1947)- Convexity guarantees a global optimum, unless
there is no feasible region
© CSIR 2009 www.csir.co.za
Gnu Linear Programming Kit
• Gnu Linear programming Kit (GLPK): Open source linear programming suite of programs- Consists of a mathematical programming
language Gnu Mathprog- And a solver glpsol
• A reference manual is available fromhttp://www.cs.unb.ca/~bremner/docs/glpk/gmpl.pdf
• Structured language to set up linear programming problems- Define variables, parameters, sets,
objectives and constraints- The solver computes the variables that
minimizes the objective, and satisfies all the constraints
© CSIR 2009 www.csir.co.za
• Parameters and sets defined for convenience (allows powerful manipulation)
• Sets are used to address the indices of multi-dimensional arrays (similar to vectors in 1D and matrices in 2D)
• Parameters are used to store known numerical values that are required to compute the cost function and constraints
Gnu Mathprog
© CSIR 2009 www.csir.co.za
Osemosys
• Open Source Energy Modelling System• Written in GNU Mathprog• Objective: discounted cost (consisting of
operating, capital, emissions penalty and salvage components)
• Constraints: Energy demand constraints, and energy balance constraints
• Variables: activities of various technologies, and investment in technologies, per year for the complete model period
© CSIR 2009 www.csir.co.za
Osemosys (cont.)
• Determine in which technologies to invest, and how to use the available capacity (residual and new), in order to satisfy all the specified demands (annual demand and peak demand)
• If there is multiple options available to generate the required energy demand, choose the technology with the lowest cost
© CSIR 2009 www.csir.co.za
• Scenario planning similar to engineering design under multiple load cases
- The design must be feasible if subjected to every load case e.g. design a vehicle that will experience paved road and off-road conditions
• Scenarios in energy planning - One difference from conventional engineering
design is that modifications are allowed to the design in the future
- Completely independent scenarios are however problematic since the solution for scenario A might be infeasible for scenario B
- Suggested solution: enforce similarity between the solutions of each scenario within a “decision window”
Scenarios and energy planning
© CSIR 2009 www.csir.co.za
Scenarios and energy planning
• Some existing energy planning software1 supports scenario planning via “stochastic programming”. - Cost function becomes expected cost, or
“Expected utility criterion with linearized risk aversion”
- Any model parameter can be uncertain, and is resolved (its value is revealed) at the resolution time
• Can alter Osemosys to add a scenario set, and add technology lead time and decision window constraints
1 R. Loulou, M Labriet, ETSAP-TIMES: the TIMES integrated assessment model Part I: Model structure,CMS (2008) 5:7-40.
© CSIR 2009 www.csir.co.za
Scenario planning example
• Consider 4 scenarios, with 3 technology options
Scenario DiscountRate
Growth Rate
EmissionsTax
1 4% 2% 12 4% 2% 1-103 6% 4% 14 6% 4% 1-10
Tech Cap cost
Fix op cost
Var op cost
Emit Lead time
Life
A 100 5 10 10 7 20
B 500 5 1 1 10 60
C 50 1 10 20 2 5
© CSIR 2009 www.csir.co.za
• The increased cost of simultaneous planning is offset by the cost of realising too late that a different future is playing out- E.g. future 3 years 1 to 4, then switch to future 4
• Independent cost: 9388• Simultaneous cost: 8002
Cost of solutionsScenario Independent Simultaneous % increase
1 4320 4677 8.3 %
2 7567 7604 0.5 %
3 4249 4811 13.2 %
4 8175 8436 3.2 %
© CSIR 2009 www.csir.co.za
Osemosys benefits
• Open source:- Since Osemosys is open source, all equations
are transparent and any modifications can be made (as long as the problem remains linear).
- No license fees are required- Reduced risk of becoming a captured client- Improved chances of developing a larger group
of researchers using energy planning tools• Learning curve:
- The learning curve to use Osemosys proficiently is not as steep as with commercial software
- Allows faster development of features not supported by commercial products
© CSIR 2009 www.csir.co.za
Osemosys limitations
• Linear programming problems- Since Osemosys models are solved using GLPK,
the models are required to be linear. Hence the objective function (cost) and constraints are required to be linear functions of the variables
• Continuous problems- Linear programming problems using continuous
variables can be solved efficiently- Introduction of integer variables makes the
problem combinatorial in nature, requiring exhaustive search or heuristics
- Hence the capacity of all new technologies are modelled as continuous (including the electricity supply options)
• Technology learning rates- Not yet implemented in Osemosys
© CSIR 2009 www.csir.co.za
Summary
• Osemosys is an open source energy planning tool, that can be tailored to the specific problem at hand