@@ -414,7 +414,7 @@ The ``\mathbf{F}`` and ``\mathbf{f_x̂}`` vectors are recalculated at each contr
414
414
# Extended Help
415
415
!!! details "Extended Help"
416
416
Using the augmented matrices ``\m athbf{Â, B̂_u, Ĉ, B̂_d, D̂_d}`` in `estim` (see
417
- [`augment_model`](@ref)) and the function ``\m athbf{W}(j) = ∑_{i=0}^j \m athbf{Â}^i``,
417
+ [`augment_model`](@ref)), and the function ``\m athbf{W}(j) = ∑_{i=0}^j \m athbf{Â}^i``,
418
418
the prediction matrices are computed by :
419
419
```math
420
420
\b egin{aligned}
@@ -447,8 +447,7 @@ The ``\mathbf{F}`` and ``\mathbf{f_x̂}`` vectors are recalculated at each contr
447
447
\m athbf{Ĉ W}(0) \\
448
448
\m athbf{Ĉ W}(1) \\
449
449
\v dots \\
450
- \m athbf{Ĉ W}(H_p-1) \e nd{bmatrix}
451
- \m athbf{\b ig(x̂_{op} + f̂_{op}\b ig)}
450
+ \m athbf{Ĉ W}(H_p-1) \e nd{bmatrix} \m athbf{\b ig(x̂_{op} + f̂_{op}\b ig)}
452
451
\e nd{aligned}
453
452
```
454
453
For the terminal constraints, the matrices are computed with:
@@ -468,7 +467,7 @@ The ``\mathbf{F}`` and ``\mathbf{f_x̂}`` vectors are recalculated at each contr
468
467
\e nd{bmatrix} \\
469
468
\m athbf{k_x̂} &= \m athbf{Â}^{H_p} \\
470
469
\m athbf{v_x̂} &= \m athbf{W}(H_p-1)\m athbf{B̂_u} \\
471
- \m athbf{b_x̂} &= \m athbf{W}(H_p-1) \m athbf{\b ig(x̂_ {op} + f̂_ {op}\b ig)}
470
+ \m athbf{b_x̂} &= \m athbf{W}(H_p-1) \m athbf{\b ig(f̂_ {op} - x̂_ {op}\b ig)}
472
471
\e nd{aligned}
473
472
```
474
473
"""
@@ -525,15 +524,16 @@ function init_predmat(estim::StateEstimator{NT}, model::LinModel, Hp, Hc) where
525
524
jx̂[: , iCol] = j < Hp ? getpower (Âpow, Hp- j- 1 )* B̂d : zeros (NT, nx̂, nd)
526
525
end
527
526
end
528
- # --- state x̂ and state update f̂op operating points ---
527
+ # --- state x̂op and state update f̂op operating points ---
529
528
coef_bx̂ = getpower (Âpow_csum, Hp- 1 )
530
529
coef_B = Matrix {NT} (undef, ny* Hp, nx̂)
531
530
for j= 1 : Hp
532
531
iRow = (1 : ny) .+ ny* (j- 1 )
533
532
coef_B[iRow,:] = Ĉ* getpower (Âpow_csum, j- 1 )
534
533
end
535
- bx̂ = coef_bx̂ * (estim. f̂op - estim. x̂op)
536
- B = coef_B * (estim. f̂op - estim. x̂op)
534
+ f̂op_n_x̂op = estim. f̂op - estim. x̂op
535
+ bx̂ = coef_bx̂ * f̂op_n_x̂op
536
+ B = coef_B * f̂op_n_x̂op
537
537
return E, G, J, K, V, B, ex̂, gx̂, jx̂, kx̂, vx̂, bx̂
538
538
end
539
539
0 commit comments