@@ -414,7 +414,7 @@ The ``\mathbf{F}`` and ``\mathbf{f_x̂}`` vectors are recalculated at each contr
414414# Extended Help
415415!!! details "Extended Help"
416416 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``,
418418 the prediction matrices are computed by :
419419 ```math
420420 \b egin{aligned}
@@ -447,8 +447,7 @@ The ``\mathbf{F}`` and ``\mathbf{f_x̂}`` vectors are recalculated at each contr
447447 \m athbf{Ĉ W}(0) \\
448448 \m athbf{Ĉ W}(1) \\
449449 \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)}
452451 \e nd{aligned}
453452 ```
454453 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
468467 \e nd{bmatrix} \\
469468 \m athbf{k_x̂} &= \m athbf{Â}^{H_p} \\
470469 \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)}
472471 \e nd{aligned}
473472 ```
474473"""
@@ -525,15 +524,16 @@ function init_predmat(estim::StateEstimator{NT}, model::LinModel, Hp, Hc) where
525524 jx̂[: , iCol] = j < Hp ? getpower (Âpow, Hp- j- 1 )* B̂d : zeros (NT, nx̂, nd)
526525 end
527526 end
528- # --- state x̂ and state update f̂op operating points ---
527+ # --- state x̂op and state update f̂op operating points ---
529528 coef_bx̂ = getpower (Âpow_csum, Hp- 1 )
530529 coef_B = Matrix {NT} (undef, ny* Hp, nx̂)
531530 for j= 1 : Hp
532531 iRow = (1 : ny) .+ ny* (j- 1 )
533532 coef_B[iRow,:] = Ĉ* getpower (Âpow_csum, j- 1 )
534533 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
537537 return E, G, J, K, V, B, ex̂, gx̂, jx̂, kx̂, vx̂, bx̂
538538end
539539
0 commit comments