Activity output types¶
Activity outputs can be of five different types:
Constant¶
Activity outputs of this type are always have a constant value for all time points.
For instance, the following activity output named test_output always have the value f = 2
:
activity = sund.Activity(time_unit = "s")
activity.add_output("constant", "test_output", f = 2)
Piecewise constant¶
Activity outputs of this type are have different constant values between specified time points. All activity outputs of this type always have a default value outside of specified time points.
For instance, the following activity output named test_output has the default value f = 2
prior
to the specified time points and the value f = 1
from time point t = 1
and the value f = 3
from time point t = 2
and the value f = 2.5
from the time point t = 3
. In other words, at t = [1, 2, 3]
, f assumes the values f = [1, 3, 2.5]
, with a default value (before the first time point) at 2:
activity = sund.Activity(time_unit = "s")
activity.add_output("piecewise_constant", "test_output", t = [1, 2, 3], f = [2, 1, 3, 2.5])
Piecewise linear¶
Activity outputs of this type have values based on linear equations between specified values at specified time points.
For instance, the following activity output named test_output has a linearly decreasing value
from f = 2
to f = 1
between time points t = 0
and t = 1
, a linearly increasing value from
f = 1
to f = 3
between time points t = 1
and t = 2
and a linearly decreasing value from
f = 3
to f = 2.5
between time points t = 2
and t = 3
:
activity = sund.Activity(time_unit = "s")
activity.add_output("piecewise_linear", "test_output", t = [0, 1, 2, 3], f = [2, 1, 3, 2.5])
Cubic spline¶
Activity output of this type have values based on natural spline interpolation, conforming to specific values at specific time points.
For instance, the following activity output named test_output has its value as a cubic function conforming to the values f = 2
at t = 0
, f = 1
at t = 1
, f = 3
at t = 2
and f = 2.5
at t = 3
:
activity = sund.Activity(time_unit = "s")
activity.add_output("cubic_spline", "test_output", t = [0, 1, 2, 3], f = [2, 1, 3, 2.5])
Cubic spline with slope¶
This output type is not fully supported and will be removed in a future version.