Skip to content

Commit 67db801

Browse files
committed
Update tests
1 parent ae6844e commit 67db801

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

test/linearize.jl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,12 @@ if VERSION >= v"1.8"
207207

208208
@named model = ODESystem(eqs, t, [], []; systems = [link1, cart, force, fixed])
209209
def = ModelingToolkit.defaults(model)
210-
def[link1.y1] = 0
210+
for s in states(model)
211+
def[s] = 0
212+
end
211213
def[link1.x1] = 10
214+
def[link1.fy1] = -def[link1.g] * def[link1.m]
212215
def[link1.A] = -pi / 2
213-
def[link1.dA] = 0
214-
def[cart.s] = 0
215-
def[force.flange.v] = 0
216216
lin_outputs = [cart.s, cart.v, link1.A, link1.dA]
217217
lin_inputs = [force.f.u]
218218

@@ -237,7 +237,9 @@ if VERSION >= v"1.8"
237237
def = merge(def, Dict(x => 0.0 for x in dummyder))
238238

239239
@test substitute(lsyss.A, def) lsys.A
240-
@test substitute(lsyss.B, def) lsys.B
240+
# We cannot pivot symbolically, so the part where a linear solve is required
241+
# is not reliable.
242+
@test substitute(lsyss.B, def)[1:6, :] lsys.B[1:6, :]
241243
@test substitute(lsyss.C, def) lsys.C
242244
@test substitute(lsyss.D, def) lsys.D
243245
end

0 commit comments

Comments
 (0)