Skip to content

Commit

Permalink
Update 2016-09-17-optimizer.md
Browse files Browse the repository at this point in the history
  • Loading branch information
johanlofberg authored Aug 23, 2024
1 parent 750601c commit e3fe7cc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions _posts/commands/2016-09-17-optimizer.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ sidebar:

[optimizer](/command/optimizer) creates an object with a pre-compiled low-level numerical format which can be used to efficiently solve a series of similar problems (reduces YALMP analysis and compilation overhead)

**Warning:** Never start your model development using optimizer constructs. Always start with a standard model based on calls to [optimize](/command/optimize), and then when everything works as expected, adjust you model to use [optimizer](/command/optimizer) instead, if you think this will improve simulation performance. Debugging models in the [optimizer](/command/optimizer) world is much harder, and [optimizer](/command/optimizer) skips many sanity checks and simply assumes you know what you are doing and the the model can be solved, once parameters are fixed, by the selected solver.

{: .notice--info}


See the post [updated optimizer](/optimizerupdates) for recent extensions and improvements.

## Syntax
Expand All @@ -20,8 +25,6 @@ P = optimizer(Con,Obj,Options,Parameters,WantedVariables)

## Examples

First a word of warning: Never start your model development using optimizer constructs. Always start with a standard model based on calls to [optimize](/command/optimize), and then when everything works as expected, adjust you model to use [optimizer](/command/optimizer) instead, if you think this will improve simulation performance. Debugging models in the [optimizer](/command/optimizer) world is much harder and not recommended.

[optimizer](/command/optimizer) is used to simplify and speed up code where almost the same model is setup and solved repeatedly.

As a start, we create a trivial linear programming model where a scalar decision variable \\(x\\) is bounded from below by some value \\(a+1\\). We create an optimizer object where the bound \\(a\\) is considered a parameter, and we are interested in the minimizing argument of \\(x^2\\) as the parameter \\(a\\) varies.
Expand Down

0 comments on commit e3fe7cc

Please sign in to comment.