Skip to content

Commit

Permalink
test: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AayushSabharwal committed Dec 28, 2023
1 parent 5cae853 commit f6fea58
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/distributed.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ end
solve_lorenz(ode_prob)

future = @spawn solve_lorenz(ode_prob)
@test_broken fetch(future)
fetch(future)
3 changes: 2 additions & 1 deletion test/inversemodel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ using ModelingToolkit
using ModelingToolkitStandardLibrary
using ModelingToolkitStandardLibrary.Blocks
using OrdinaryDiffEq
using SymbolicIndexingInterface
using Test
using ControlSystemsMTK: tf, ss, get_named_sensitivity, get_named_comp_sensitivity

Expand Down Expand Up @@ -144,7 +145,7 @@ sol = solve(prob, Rodas5P())
# plot(sol, idxs=[model.tank.xc, model.tank.xT, model.controller.ctr_output.u], layout=3, sp=[1 2 3])
# hline!([prob[cm.ref.k]], label="ref", sp=1)

@test sol(tspan[2], idxs = cm.tank.xc)prob[cm.ref.k] atol=1e-2 # Test that the inverse model led to the correct reference
@test sol(tspan[2], idxs = cm.tank.xc) getp(prob, cm.ref.k)(prob) atol=1e-2 # Test that the inverse model led to the correct reference

Sf, simplified_sys = Blocks.get_sensitivity_function(model, :y) # This should work without providing an operating opint containing a dummy derivative
x, p = ModelingToolkit.get_u0_p(simplified_sys, op)
Expand Down

0 comments on commit f6fea58

Please sign in to comment.