Skip to content

Commit d213756

Browse files
committed
small doc corrections
1 parent 9ceded3 commit d213756

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

docs/src/manual/nonlinmpc.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ plot(res, plotu=false, plotxwithx̂=true)
7575
```
7676

7777
The estimate ``x̂_3`` is the integrator state that compensates for static errors (`nint_ym`
78-
parameter of [`UnscentedKalmanFilter`](@ref)). The Kalman filter performance seems
79-
sufficient for control. As the motor torque is limited to -1.5 to 1.5 N m, we incorporate
80-
the input constraints in a [`NonLinMPC`](@ref):
78+
and `σQ_int` parameters of [`UnscentedKalmanFilter`](@ref)). The Kalman filter performance
79+
seems sufficient for control. As the motor torque is limited to -1.5 to 1.5 N m, we
80+
incorporate the input constraints in a [`NonLinMPC`](@ref):
8181

8282
```@example 1
8383
mpc = NonLinMPC(estim, Hp=20, Hc=4, Mwt=[0.05], Nwt=[2.5], Cwt=Inf)

src/estimator/kalman.jl

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,10 @@ It implements the time-varying Kalman Filter in its predictor (observer) form :
284284
[\mathbf{Ĉ^m P̂}_{k-1}(k)\mathbf{Ĉ^m + R̂}]^{-1} \\
285285
\mathbf{K}(k) &= \mathbf{Â M(k)} \\
286286
\mathbf{ŷ^m}(k) &= \mathbf{Ĉ^m x̂}_{k-1}(k) + \mathbf{D̂_d^m d}(k) \\
287-
\mathbf{x̂}_{k}(k+1) &= \mathbf{Â x̂}_{k-1}(k) + \mathbf{B̂_u u}(k) + \mathbf{B̂_d d}(k)
287+
\mathbf{x̂}_{k}(k+1) &= \mathbf{Â x̂}_{k-1}(k) + \mathbf{B̂_u u}(k) + \mathbf{B̂_d d}(k)
288288
+ \mathbf{K}(k)[\mathbf{y^m}(k) - \mathbf{ŷ^m}(k)] \\
289-
\mathbf{P̂}_{k}(k+1) &= \mathbf{Â}[\mathbf{P̂}_{k-1}(k) -
290-
\mathbf{M}(k)\mathbf{Ĉ^m P̂}_{k-1}(k)]\mathbf{Â}' + \mathbf{Q̂}
289+
\mathbf{P̂}_{k}(k+1) &= \mathbf{Â}[\mathbf{P̂}_{k-1}(k)
290+
- \mathbf{M}(k)\mathbf{Ĉ^m P̂}_{k-1}(k)]\mathbf{Â}' + \mathbf{Q̂}
291291
\end{aligned}
292292
```
293293
based on the process model described in [`SteadyKalmanFilter`](@ref). The notation
@@ -646,14 +646,15 @@ The equations are similar to [`update_estimate!(::KalmanFilter)`](@ref) but with
646646
substitutions ``\mathbf{Â = F̂}(k)`` and ``\mathbf{Ĉ^m = Ĥ^m}(k)``:
647647
```math
648648
\begin{aligned}
649-
\mathbf{M}(k) &= \mathbf{P̂}_{k-1}(k)\mathbf{Ĥ^m}'
650-
[\mathbf{Ĥ^m P̂}_{k-1}(k)\mathbf{Ĥ^m + R̂}]^{-1} \\
651-
\mathbf{K}(k) &= \mathbf{F̂ M(k)} \\
649+
\mathbf{M}(k) &= \mathbf{P̂}_{k-1}(k)\mathbf{Ĥ^m}'(k)
650+
[\mathbf{Ĥ^m}(k)\mathbf{P̂}_{k-1}(k)\mathbf{Ĥ^m}(k) + \mathbf{R̂}]^{-1} \\
651+
\mathbf{K}(k) &= \mathbf{F̂}(k) \mathbf{M}(k) \\
652652
\mathbf{ŷ^m}(k) &= \mathbf{ĥ^m}\Big( \mathbf{x̂}_{k-1}(k), \mathbf{d}(k) \Big) \\
653653
\mathbf{x̂}_{k}(k+1) &= \mathbf{f̂}\Big( \mathbf{x̂}_{k-1}(k), \mathbf{u}(k), \mathbf{d}(k) \Big)
654654
+ \mathbf{K}(k)[\mathbf{y^m}(k) - \mathbf{ŷ^m}(k)] \\
655-
\mathbf{P̂}_{k}(k+1) &= \mathbf{F̂}[\mathbf{P̂}_{k-1}(k) -
656-
\mathbf{M}(k)\mathbf{Ĥ^m P̂}_{k-1}(k)]\mathbf{F̂}' + \mathbf{Q̂}
655+
\mathbf{P̂}_{k}(k+1) &= \mathbf{F̂}(k)[\mathbf{P̂}_{k-1}(k)
656+
- \mathbf{M}(k)\mathbf{Ĥ^m}(k)\mathbf{P̂}_{k-1}(k)]\mathbf{F̂}'(k)
657+
+ \mathbf{Q̂}
657658
\end{aligned}
658659
```
659660
[`ForwardDiff.jacobian`](https://juliadiff.org/ForwardDiff.jl/stable/user/api/#ForwardDiff.jacobian)

0 commit comments

Comments
 (0)