Skip to content

protocol DSL #112

@martinjrobins

Description

@martinjrobins

Might be worth implementing a protocol DSL based on diffsl?

field of hybrid automata looks interesting:

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)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions