Skip to content

Commit f3768aa

Browse files
committed
Merge branch 'master' into myb/strong_alias
2 parents 3b66f8c + 8c43b52 commit f3768aa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/systems/abstractsystem.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,11 +1189,11 @@ function linearize(sys, lin_fun; t = 0.0, op = Dict(), allow_input_derivatives =
11891189
B = [f_u
11901190
zeros(nz, nu)]
11911191
C = [h_x h_z]
1192-
Bs = -(gz \ (f_x * f_u + g_u))
1192+
Bs = -(gz \ g_u) # This equation differ from the cited paper, the paper is likely wrong since their equaiton leads to a dimension mismatch.
11931193
if !iszero(Bs)
11941194
if !allow_input_derivatives
11951195
der_inds = findall(vec(any(!=(0), Bs, dims = 1)))
1196-
error("Input derivatives appeared in expressions (-g_z\\(f_x*f_u + g_u) != 0), the following inputs appeared differentiated: $(inputs(sys)[der_inds]). Call `linear_staespace` with keyword argument `allow_input_derivatives = true` to allow this and have the returned `B` matrix be of double width ($(2nu)), where the last $nu inputs are the derivatives of the first $nu inputs.")
1196+
error("Input derivatives appeared in expressions (-g_z\\g_u != 0), the following inputs appeared differentiated: $(inputs(sys)[der_inds]). Call `linear_staespace` with keyword argument `allow_input_derivatives = true` to allow this and have the returned `B` matrix be of double width ($(2nu)), where the last $nu inputs are the derivatives of the first $nu inputs.")
11971197
end
11981198
B = [B Bs]
11991199
end

0 commit comments

Comments
 (0)