Closed schmid-mat closed 3 months ago
Actually great idea, I'll make one. How should it behave at the x-value of the jump? Is it like (-inf, x] (x, inf) or (-inf, x) [x, inf)?
def step(x, /, *, no_m=0, c_m=1):
"""A step function.
>>> f = step(2)
>>> f(1)
0
>>> f(2)
1
"""
assert 0 <= no_m < c_m <= 1
@njit
def f(x):
return c_m if x >= x else no_m
return f
would that do the trick?
Hi, is there the possibility to implement a step function (like on/off)? I tried it by manipulation the function R. Unfortunately, the R and S functions ignore a decimal input, like: R(0.45, 0.5), to approximate a jump.
Thanks!