Skip to contents

PeriodicClock(dt, phase) is the periodic clock (Clock()), Continuous() (or ContinuousClock()) the continuous time domain, EventClock(name) the clock of an event and IndexedClock(clock, idx) the ticks idx of a clock. isclock(), iscontinuous(), issolverstepclock(), iseventclock() and is_discrete_time_domain() classify time domains. first_clock_tick_time(clock, t0) is the first tick at or after t0; canonicalize_indexed_clock(ic, sol) returns the times of the ticks of an indexed clock in a solution (sol$t for the continuous clock).

Usage

PeriodicClock(dt, phase = 0)

Continuous()

EventClock(name = NULL)

IndexedClock(clock, idx)

isclock(x)

iscontinuous(x)

issolverstepclock(x)

iseventclock(x)

is_discrete_time_domain(x)

first_clock_tick_time(clock, t0)

canonicalize_indexed_clock(ic, sol)

Arguments

dt, phase

Period and offset.

name

Name of the event.

clock, ic

A clock or an indexed clock.

idx

Tick indices.

x

A time domain.

t0

A time.

sol

A solution.

Value

A clock, a flag, a time or times.

Examples

c1 <- PeriodicClock(0.5)
first_clock_tick_time(c1, 0.2)
#> [1] 0.5
iscontinuous(Continuous())
#> [1] TRUE