Skip to content

Commit

Permalink
change Union to real types
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigomha committed Jul 8, 2024
1 parent 9f28d70 commit f12759d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/base/caches.jl
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,5 @@ get_current_balance(sc::SimCache, ::Type{Float64}) = sc.current_balance
get_inner_vars(sc::SimCache, ::Type{Float64}) = sc.inner_vars
get_global_vars(sc::SimCache, ::Type{Float64}) = sc.global_vars

get_ω_sys(cache::Cache, T::Type{<:Union{Float64, ForwardDiff.Dual}}) =
get_ω_sys(cache::Cache, T::Type{<:ACCEPTED_REAL_TYPES}) =
get_global_vars(cache, T)[GLOBAL_VAR_SYS_FREQ_INDEX]
22 changes: 11 additions & 11 deletions src/models/inverter_models/output_current_limiter_models.jl
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
function limit_output_current(
limiter::Nothing,
Id_cnv_ref::Union{Float64, ForwardDiff.Dual},
Iq_cnv_ref::Union{Float64, ForwardDiff.Dual},
Id_cnv_ref::ACCEPTED_REAL_TYPES,
Iq_cnv_ref::ACCEPTED_REAL_TYPES,
)
return Id_cnv_ref, Iq_cnv_ref
end

function limit_output_current(
limiter::PSY.InstantaneousOutputCurrentLimiter,
Id_cnv_ref::Union{Float64, ForwardDiff.Dual},
Iq_cnv_ref::Union{Float64, ForwardDiff.Dual},
Id_cnv_ref::ACCEPTED_REAL_TYPES,
Iq_cnv_ref::ACCEPTED_REAL_TYPES,
)
d_lim = PSY.get_Id_max(limiter)
q_lim = PSY.get_Iq_max(limiter)
Expand All @@ -20,8 +20,8 @@ end

function limit_output_current(
limiter::PSY.MagnitudeOutputCurrentLimiter,
Id_cnv_ref::Union{Float64, ForwardDiff.Dual},
Iq_cnv_ref::Union{Float64, ForwardDiff.Dual},
Id_cnv_ref::ACCEPTED_REAL_TYPES,
Iq_cnv_ref::ACCEPTED_REAL_TYPES,
)
limit_value = PSY.get_I_max(limiter)
theta = atan(Iq_cnv_ref, Id_cnv_ref)
Expand All @@ -37,8 +37,8 @@ end

function limit_output_current(
limiter::PSY.SaturationOutputCurrentLimiter,
Id_cnv_ref::Union{Float64, ForwardDiff.Dual},
Iq_cnv_ref::Union{Float64, ForwardDiff.Dual},
Id_cnv_ref::ACCEPTED_REAL_TYPES,
Iq_cnv_ref::ACCEPTED_REAL_TYPES,
)
limit_value = PSY.get_I_max(limiter)
gain = PSY.get_kw(limiter)
Expand All @@ -57,9 +57,9 @@ end

function limit_output_current(
limiter::PSY.HybridOutputCurrentLimiter,
Id_cnv_ref::Union{Float64, ForwardDiff.Dual},
Iq_cnv_ref::Union{Float64, ForwardDiff.Dual},
ω::Union{Float64, ForwardDiff.Dual},
Id_cnv_ref::ACCEPTED_REAL_TYPES,
Iq_cnv_ref::ACCEPTED_REAL_TYPES,
ω::ACCEPTED_REAL_TYPES,
)
limit_value = PSY.get_I_max(limiter)
real_imped = PSY.get_rv(limiter)
Expand Down

0 comments on commit f12759d

Please sign in to comment.