Skip to content

Commit bccc161

Browse files
committed
debug: clear error message for Hc<1
1 parent 3415b55 commit bccc161

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/controller/construct.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,9 @@ The vector is filled with `1`s, except for the last element which is `Hp - Hc +
496496
function move_blocking(Hp_arg::Int, Hc_arg::Int)
497497
Hp, Hc = Hp_arg, Hc_arg
498498
nb = fill(1, Hc)
499-
nb[end] = Hp - Hc + 1
499+
if Hc > 1 # if Hc < 1, it will crash later with a clear error message
500+
nb[end] = Hp - Hc + 1
501+
end
500502
return nb
501503
end
502504

src/controller/transcription.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ The ``\mathbf{P_u}`` and ``\mathbf{T_u}`` matrices are defined in the Extended H
134134
135135
# Extended Help
136136
!!! details "Extended Help"
137-
With ``n_j``, the ``j``th element of the ``\mathbf{n_b}`` vector introduced in [`init_ZtoΔU`](@ref)
137+
With ``n_j``, the ``j``th element of the ``\mathbf{n_b}`` vector definedc in [`init_ZtoΔU`](@ref)
138138
documentation, we introduce the ``\mathbf{Q}(j)`` matrix of size `(nu*nj, nu)`:
139139
```math
140140
\mathbf{Q}(j) = \begin{bmatrix}

0 commit comments

Comments
 (0)