e.g.
// Example: single-compartment with drug pulse
model PumpedCell {
parameters:
k = 0.1
kdeg = 0.05
pulse_amp = 10
pulse_dur = 5
variables:
x: real // species level
t_clock: clock
locations:
idle:
invariant: true
flow:
dx/dt = -kdeg * x
dt_clock/dt = 1
transitions:
-> pulse
guard: t_clock >= 10
reset: t_clock = 0
pulse:
invariant: t_clock <= pulse_dur
flow:
dx/dt = pulse_amp - kdeg * x
dt_clock/dt = 1
transitions:
-> idle
guard: t_clock >= pulse_dur
reset: t_clock = 0
init:
location: idle
x = 0
t_clock = 0
outputs:
sample: sample_every(0.1, x)
}
Might be worth implementing a protocol DSL based on diffsl?
field of hybrid automata looks interesting:
e.g.