Create a seasonal wave function that oscillates between -1 and 1, with a specified period and shift. The wave peaks at the specified shift time.
Usage
seasonal(period = 1, shift = 0)
Arguments
- period
Duration of wave in simulation time units. Defaults to 1.
- shift
Timing of wave peak in simulation time units. Defaults to 0.
Details
Equivalent of Seasonal() in Insight Maker
Examples
# Create a simple model with a seasonal wave
sfm <- xmile() |>
build("a", "stock") |>
build("input", "constant", eqn = "seasonal(10, 0)") |>
build("inflow", "flow", eqn = "input(t)", to = "a")
sim <- simulate(sfm, only_stocks = FALSE)
plot(sim)