sbmltoodejax.jaxfuncs
#
- sbmltoodejax.jaxfuncs.coth(x)[source]#
Hyperbolic cotangent function \(csch(x) = \frac{1}{\tanh(x)}\)
- sbmltoodejax.jaxfuncs.csch(x)[source]#
Hyperbolic cosecant function \(csch(x) = \frac{1}{\sinh(x)}\)
- sbmltoodejax.jaxfuncs.piecewise(*args)[source]#
This function implements the Piecewise function used in SBML models:
Piecewise(expression1, condition1 [, expression2, condition2 [,...]])
- Parameters:
expressionN (float) – a numerical value
conditionN (bool) – a boolean value
- Returns:
The first expression passed as argument with a
True
condition, read left to right. If all conditions are false, will return 0.- Return type:
float
Note
This function is not intended to be used by a user, but is defined in a way that matches how libSBML formats piecewise functions are used in SBML models. This is similar to
jax.numpy.piecewise
function but instead of evaluating inputs inside the function, they are evaluated before being passed to the function.Examples
For example, if called like so
piecewise(x + 2, x < 3, x + 4, x > 3)
and ifx = 2
, then the arguments will be evaluated topiecewise(4, True, 6, False)
and returns 4.