Hydrogen Inventory Simulations for PFCs (HISP) is a series of code that uses FESTIM to simulate deuterium and tritium inventories in a fusion tokamak first wall and divertor PFCs.
It would be convenient to have functions like periodic step function, periodic step function with ramp up/down etc.
def periodic_step_function(x, period_on, period_total, value_on, value_off=0.0):
"""
Creates a periodic step function with two periods.
"""
if period_total < period_on:
raise ValueError("period_total must be greater than period_on")
if x % period_total < period_on:
return value_on
else:
return value_off
It would be convenient to have functions like periodic step function, periodic step function with ramp up/down etc.