How to get started with modelling the following piecewise linear approximation?
AnsweredAny articles or examples related which I can reference from would be helpful, I have no idea what functions to use and how to get started

where s refer to a set of breakpoints, and f the corresponding values. For each point x, we are interested in recovering the corresponding value at x, using a piecewise linear approximation of the points (s,f).
1
-
Official comment
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum, or try Gurobot, our chatbot interface offering instant, expert-level support. -
Hi Jia,
The following should get you started.
- Gurobi has an interface for modelling piecewise-linear objective functions. The linked section explains in detail how to define piecewise-linear functions in Gurobi. The method Model.setPWLObj() can be used in Python to set a piecewise-linear objective function, for example. Check the piecewise.py example for how to define piecewise-linear objective functions.
- Gurobi also has an interface to define piecewise-linear constraints. The method Model.addGenConstrPWL() can be used in Python. Examples gc_pwl.py() and gc_pwl_func() are relevant examples that you might want to check.
Best regards,
Maliheh
0
Post is closed for comments.
Comments
2 comments