Skip to content

Profiles: Time-Varying Inputs


constant_profile()

from jaxhybridmodels.profiles import constant_profile  ·  also re-exported as jaxhybridmodels.constant_profile

python
constant_profile(value: 'float') -> 'Callable[[Array], Array]'

Return t -> value: a profile that never changes.

The degenerate case, included so a code path can treat every quantity uniformly (a quantity is either a covariate or constant_profile(v) evaluated at t).

Source


step_profile()

from jaxhybridmodels.profiles import step_profile  ·  also re-exported as jaxhybridmodels.step_profile

python
step_profile(
    before: 'float',
    after: 'float',
    jump_at: 'float',
) -> Callable[[Array], Array]

Return t -> before if t < jump_at else after: a step change.

For a reactor, the moment a feed valve opens or a heater switches. Discontinuous at jump_at; an adaptive solver sees a kink, so place the jump at a known event time or accept a short transient.

Source


ramp_profile()

from jaxhybridmodels.profiles import ramp_profile  ·  also re-exported as jaxhybridmodels.ramp_profile

python
ramp_profile(
    t0: 'float',
    t1: 'float',
    v0: 'float',
    v1: 'float',
) -> Callable[[Array], Array]

Return a flat-ramp-flat profile: v0 until t0, linear to v1 by t1, then flat.

The reactor heat-up shape: hold at the initial set point, ramp to the final set point, hold there. Values before t0 and after t1 are exactly the edge values (the two flat profiles on either edge).

t1 > t0 is required; equal times would be a discontinuity. The check runs when the times are host-side values; inside jit/vmap (per-experiment parameters from traced covariates) it is skipped, so the factory stays trace-safe.

Source


piecewise_linear_profile()

from jaxhybridmodels.profiles import piecewise_linear_profile  ·  also re-exported as jaxhybridmodels.piecewise_linear_profile

python
piecewise_linear_profile(
    knots: 'tuple[tuple[float, float], ...]',
) -> Callable[[Array], Array]

Return a piecewise-linear interpolation of (t, v) knots.

The general shape: any finite profile that is linear between its knots. Constant on both edges (the first and last values extend outward). Knots must be strictly increasing in t and contain at least two entries.

Source

Released under the BSD-3-Clause License.