Skip to content

Commit

Permalink
Merge 7fa1e22 into 684aed0
Browse files Browse the repository at this point in the history
  • Loading branch information
odow authored Feb 22, 2021
2 parents 684aed0 + 7fa1e22 commit 0e0bff8
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions docs/src/manual/nlp.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,8 @@ julia> @NLexpression(model, nested[i = 1:2], sin(my_expr[i]))

## Create a nonlinear parameter

For nonlinear models only, JuMP offers a syntax for explicit "parameter" objects
which can be used to modify a model in-place just by updating the value of the
parameter.
For nonlinear models only, JuMP offers a syntax for explicit "parameter" objects,
which are constants in the model that can be efficiently updated between solves.

Nonlinear parameters are declared by using the [`@NLparameter`](@ref) macro
and may be indexed by arbitrary sets analogously to JuMP variables and
Expand All @@ -110,6 +109,11 @@ julia> @NLparameter(model, p[i = 1:2] == i)
"Reference to nonlinear parameter #2"
```

!!! info
A parameter is not an optimization variable. It must be fixed to a value with
`==`. If you want a parameter that is `<=` or `>=`, create a variable instead
using [`@variable`](@ref).

Use [`value`](@ref) and [`set_value`](@ref) to query or update the value of a
parameter.

Expand Down Expand Up @@ -148,6 +152,8 @@ julia> @NLexpression(model, my_nl_expr, p[1] * x^2)
"Reference to nonlinear expression #1"
```

### When to use a parameter

Nonlinear parameters are useful when solving nonlinear models in a sequence:

```@example
Expand Down

0 comments on commit 0e0bff8

Please sign in to comment.