-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
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_offMetadata
Metadata
Assignees
Labels
No labels