You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/controller/nonlinmpc.jl
+12-2Lines changed: 12 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -140,7 +140,11 @@ since ``H_c ≤ H_p`` implies that ``\mathbf{u}(k+H_p) = \mathbf{u}(k+H_p-1)``.
140
140
Replace any of the 3 arguments with `_` if not needed (see `JE` default value below).
141
141
142
142
This method uses the default state estimator, an [`UnscentedKalmanFilter`](@ref) with
143
-
default arguments.
143
+
default arguments.
144
+
145
+
!!! warning
146
+
See Extended Help if you get an error like `MethodError: no method matching
147
+
Float64(::ForwardDiff.Dual)`
144
148
145
149
# Arguments
146
150
- `model::SimModel` : model used for controller predictions and state estimations.
@@ -174,6 +178,12 @@ NonLinMPC controller with a sample time Ts = 10.0 s, UnscentedKalmanFilter estim
174
178
`NonLinMPC` controllers based on [`LinModel`](@ref) compute the predictions with matrix
175
179
algebra instead of a `for` loop. This feature can accelerate the optimization and is not
176
180
available in any other package, to my knowledge.
181
+
182
+
The optimizations rely on [`JuMP.jl`](https://github.com/jump-dev/JuMP.jl) automatic
183
+
differentiation (AD) to compute the objective and constraint derivatives. Optimizers
184
+
generally benefit from exact derivatives like AD. However, the [`NonLinModel`](@ref) `f`
185
+
and `h` functions must be compatible with this feature. See [Automatic differentiation](https://jump.dev/JuMP.jl/stable/manual/nlp/#Automatic-differentiation)
0 commit comments