diff --git a/src/Blocks/analysis_points.jl b/src/Blocks/analysis_points.jl index a6b90866d..9b4fec8b2 100644 --- a/src/Blocks/analysis_points.jl +++ b/src/Blocks/analysis_points.jl @@ -450,10 +450,17 @@ end # Methods above are implemented in terms of linearization_function, the method below creates wrappers for linearize for f in [:get_sensitivity, :get_comp_sensitivity, :get_looptransfer] - @eval function $f(sys, ap, args...; loop_openings = nothing, kwargs...) - lin_fun, ssys = $(Symbol(string(f) * "_function"))(sys, ap, args...; loop_openings, + @eval function $f(sys, + ap, + args...; + loop_openings = nothing, + op = Dict(), + p = DiffEqBase.NullParameters(), + kwargs...) + lin_fun, ssys = $(Symbol(string(f) * "_function"))(sys, ap, args...; op, p, + loop_openings, kwargs...) - ModelingToolkit.linearize(ssys, lin_fun; kwargs...), ssys + ModelingToolkit.linearize(ssys, lin_fun; op, p, kwargs...), ssys end end diff --git a/test/Thermal/thermal.jl b/test/Thermal/thermal.jl index d8f69fd41..bf8b39383 100644 --- a/test/Thermal/thermal.jl +++ b/test/Thermal/thermal.jl @@ -240,7 +240,7 @@ end @test sol.retcode == Success @test sol[T_winding.T] == sol[winding.T] @test sol[T_core.T] == sol[core.T] - @test sol[-core.port.Q_flow] == + @test sol[-core.port.Q_flow] ≈ sol[coreLosses.port.Q_flow + convection.solid.Q_flow + winding2core.port_b.Q_flow] @test sol[T_winding.T][end] >= 500 # not good but better than nothing @test sol[T_core.T] <= sol[T_winding.T]