Skip to content

Commit

Permalink
fixup! fix: create and solve initialization system in linearization_f…
Browse files Browse the repository at this point in the history
…unction
  • Loading branch information
AayushSabharwal committed Apr 29, 2024
1 parent 8020ed0 commit 0654773
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions test/downstream/linearize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,14 @@ lsys = ModelingToolkit.reorder_unknowns(lsys0, unknowns(ssys), desired_order)
lsyss, _ = ModelingToolkit.linearize_symbolic(pid, [reference.u, measurement.u],
[ctr_output.u])

@test substitute(lsyss.A, merge(ModelingToolkit.defaults(pid), ModelingToolkit.guesses(pid))) == lsys.A
@test substitute(lsyss.B, merge(ModelingToolkit.defaults(pid), ModelingToolkit.guesses(pid))) == lsys.B
@test substitute(lsyss.C, merge(ModelingToolkit.defaults(pid), ModelingToolkit.guesses(pid))) == lsys.C
@test substitute(lsyss.D, merge(ModelingToolkit.defaults(pid), ModelingToolkit.guesses(pid))) == lsys.D
@test substitute(
lsyss.A, merge(ModelingToolkit.defaults(pid), ModelingToolkit.guesses(pid))) == lsys.A
@test substitute(
lsyss.B, merge(ModelingToolkit.defaults(pid), ModelingToolkit.guesses(pid))) == lsys.B
@test substitute(
lsyss.C, merge(ModelingToolkit.defaults(pid), ModelingToolkit.guesses(pid))) == lsys.C
@test substitute(
lsyss.D, merge(ModelingToolkit.defaults(pid), ModelingToolkit.guesses(pid))) == lsys.D

# Test with the reverse desired unknown order as well to verify that similarity transform and reoreder_unknowns really works
lsys = ModelingToolkit.reorder_unknowns(lsys, unknowns(ssys), reverse(desired_order))
Expand Down

0 comments on commit 0654773

Please sign in to comment.