Skip to content

Commit

Permalink
Create total_parasitic via macro
Browse files Browse the repository at this point in the history
  • Loading branch information
cfe316 committed Sep 18, 2024
1 parent 7f0beb8 commit a5b4283
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/model/resources/fusion/fusion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,8 @@ function fusion_total_parasitic_power!(
resource_component,
r_id::Int
)
T = inputs["T"]

from_model(f::Function) = EP[Symbol(f(resource_component))]

ePassive = from_model(fusion_parasitic_passive_name)
Expand All @@ -471,7 +473,7 @@ function fusion_total_parasitic_power!(

total_parasitic = Symbol(fusion_parasitic_total_name(resource_component))

EP[total_parasitic] = ePassive + eActive + eStartEnergy
EP[total_parasitic] = @expression(EP, [t in 1:T], ePassive[t] + eActive[t] + eStartEnergy[t])

union!(inputs[FUSION_PARASITIC_POWER], (total_parasitic,))
end
Expand Down

0 comments on commit a5b4283

Please sign in to comment.