Skip to content

Commit 513ab6d

Browse files
committed
added: feature un README.md
1 parent 3066c51 commit 513ab6d

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ for more detailed examples.
8282
- input setpoint tracking
8383
- terminal costs
8484
- custom economic costs (economic model predictive control)
85+
- control horizon distinct from prediction horizon and custom move blocking
8586
- adaptive linear model predictive controller
8687
- manual model modification
8788
- automatic successive linearization of a nonlinear model

src/controller/transcription.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,10 @@ The ``\mathbf{P_u}`` and ``\mathbf{T_u}`` matrices are defined in the Extended H
113113
114114
# Extended Help
115115
!!! details "Extended Help"
116-
With ``n_j``, the ``j``th element of the ``\mathbf{n_b}`` vector defined in [`move_blocking`](@ref)
117-
documentation, we introduce the ``\mathbf{Q}(j)`` matrix of size `(nu*nj, nu)`:
116+
With ``n_i``, the ``i``th element of the ``\mathbf{n_b}`` vector defined in [`move_blocking`](@ref)
117+
documentation, we introduce the ``\mathbf{Q}(i)`` matrix of size `(nu*ni, nu)`:
118118
```math
119-
\mathbf{Q}(j) = \begin{bmatrix}
119+
\mathbf{Q}(i) = \begin{bmatrix}
120120
\mathbf{I} \\
121121
\mathbf{I} \\
122122
\vdots \\
@@ -152,11 +152,11 @@ function init_ZtoU(
152152
# Pu and Tu are `Matrix{NT}`, conversion is faster than `Matrix{Bool}` or `BitMatrix`
153153
I_nu = Matrix{NT}(I, nu, nu)
154154
PuDagger = Matrix{NT}(undef, nu*Hp, nu*Hc)
155-
for j=1:Hc
156-
nj = nb[j]
157-
Qj = repeat(I_nu, nj, 1)
158-
iRows = (1:nu*nj) .+ @views nu*sum(nb[1:j-1])
159-
PuDagger[iRows, :] = [repeat(Qj, 1, j) zeros(nu*nj, nu*(Hc-j))]
155+
for i=1:Hc
156+
ni = nb[i]
157+
Qi = repeat(I_nu, ni, 1)
158+
iRows = (1:nu*ni) .+ @views nu*sum(nb[1:i-1])
159+
PuDagger[iRows, :] = [repeat(Qi, 1, i) zeros(nu*ni, nu*(Hc-i))]
160160
end
161161
Pu = init_PUmat(estim, transcription, Hp, Hc, PuDagger)
162162
Tu = repeat(I_nu, Hp)

0 commit comments

Comments
 (0)