Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions src/Blocks/analysis_points.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion test/Thermal/thermal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down