Skip to content

Commit 8d0dfb8

Browse files
committed
debug: idem
1 parent d45ef86 commit 8d0dfb8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/model/linearization.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,18 +157,18 @@ julia> linearize!(linmodel, model, x=[20.0], u=[0.0]); linmodel.A
157157
```
158158
"""
159159
function linearize!(
160-
linmodel::LinModel{NT}, model::SimModel;
160+
linmodel::LinModel, model::SimModel;
161161
x=(model.buffer.x.=model.x0.+model.xop), u=model.uop, d=model.dop
162-
) where NT<:Real
162+
)
163163
nonlinmodel = model
164164
buffer = nonlinmodel.buffer
165-
# --- compute the Jacobians at linearization points ---
166-
linearize_core!(linmodel, nonlinmodel, x, u, d) # no deviation vectors in model.linfunc!
167165
# --- remove the operating points of the nonlinear model (typically zeros) ---
168166
x0, u0, d0, k0 = buffer.x, buffer.u, buffer.d, buffer.k
169167
x0 .= x .- nonlinmodel.xop
170168
u0 .= u .- nonlinmodel.uop
171169
d0 .= d .- nonlinmodel.dop
170+
# --- compute the Jacobians at linearization points ---
171+
linearize_core!(linmodel, nonlinmodel, x0, u0, d0)
172172
# --- compute the nonlinear model output at operating points ---
173173
x0next, y0 = linmodel.buffer.x, linmodel.buffer.y
174174
h!(y0, nonlinmodel, x0, d0, model.p)

0 commit comments

Comments
 (0)