-
Notifications
You must be signed in to change notification settings - Fork 7
Closed
Labels
Description
Pathsim supports event detection. Each event is defined by an event function, and an action.
We could investigate supporting some pre-made events, for example:
- When the storage inventory reaches zero, turn the plasma off
- When the storage inventory reaches some value, turn the plasma on
In the Pathsim model we define these as:
# EVENTS ================================================================================
def func_evt_down(t):
*_, x = storage()
return x
def func_act_down(t):
fusion_reaction_rate.off()
def func_evt_up(t):
*_, x = storage()
return x - startup_inventory
def func_act_up(t):
fusion_reaction_rate.on()
E1 = ZeroCrossingDown(func_act=func_act_down, func_evt=func_evt_down, tolerance=1e-8)
E2 = ZeroCrossingUp(func_act=func_act_up, func_evt=func_evt_up, tolerance=1e-8)Reactions are currently unavailable