Title: Multiformalism Models
1 Multi-formalism Models
2Basic Features of Systems Dynamics and Bond Graphs
3Basic Features of Petri nets and Statecharts
4 Hybrid Model Examples
5Leaky Integrate-and-fire Neuron Models
6Bunjee Jumping
gravity
velocity
airRes
spring
position
velocity
The spring restoring force Only takes effect
when The jumper reaches the stretch length L
7Bouncing Ball
conservation of momentum some loss is effected
by reducing v(t)
the loss shows up in the diminishing bounce
8Bouncing Ball on Stairs
Extend the bouncing ball model to represent a
ball that falls downstairs as illustrated. In
addition to bouncing vertically, the ball moves
with constant speed, horizontally. The model must
determine when the ball hits a stair. Stairs have
length and width equal to s.
9Multi-formalism Approaches
DEVDESS
Combining Formalisms
Formalism
DEVDESS
Embedding Formalisms
Embedding DEVDESS
10DEVS and DESS combined model
Derivative Function Changes Integrators States
Reset
State Event Detection
Note full capability requires both state event
detection and integrators state reset
11Discrete Event Changes to DESS
State Event Detection
Derivative Function Change
Integrator State Reset
12DEVDESS model Barrel Filler
dext ((contents, valve), e, inflow, on/off) if
on/off on then valve open elseif
on/off off then valve closed Cint
((contents, valve), e, inflow) contents
10 dint ((contents, valve), e,
inflow) contents 0 ?discr ((contents, valve),
e, inflow) barrel 10-liter-barrel -- send
out 10-liter-barrel at port barrel f
((contents, valve), e, inflow) case
valve open d contents / dt 0 closed d
contents / dt inflow ?cont ((contents, valve),
e, inflow) cout contents
BarrelFiller (Xcont, Xdiscr, Ycont, Ydiscr,
Scont, Sdiscr, dext, Cint, dint , ldiscr, f,
lcont)Xcont inflow inflow ÃŽRXdiscr
on/off on/off ÃŽ on, offYcont cout
cout Î ÂYdiscr barrel barrel Î
10-liter-barrelSdiscr valve valve ÃŽ
open, closed Scont contents contents in
R
13Functional dependencies of barrel model
14Barrel generator trajectories
15DEVDESS includes full DEVS capability
DEVDESS is formulated so that it does not
include DEVSs internal transition triggered by
its time advance function a time event.
However, the following shows how to recapture
the time event in DEVSDESS as a state event!!
DEVS
reset to 0
trigger internal transition function
elapsed time is obtained as the output of an
integrator that is reset to zero at a state event
level crossing detector
16Implementing DEVDESS in DEVS
DEVS external transition function includes
DEVDESS internal transition specification and
is triggered by event detection
DEVS control of derivative function
DEVS
DEVS implementation of DESS
event detection
DEVS control of threshold crossing condition
DEVS Integrator with port to reset state
17One Dimensional Integrator Response to External
Input an integrator receives a new input,
updates its state, predicts a next state and
reschedules itself accordingly to reach the next
threshold
Residual QuantumLeft Method-- limits time to
next output by reducing quantumLeft with each
external input.
inpgt0
s ? selastInp qleft qleft - elastInp ta
qleft/nput
q
s
inplt0
e
First Order Integrator uses last input
(derivative) to update to current state
Residual QuantumLeft Method sigma
qleft/inp qleft qleft - einp qleft qleft
eqleft/sigma qleft (1 esigma)
time of current external event
time of last event
18Implementing DEVDESS in DEVS Example Barrel
Filler
DEVS Quantized Integrator
Level crossing detector Sends reset to
integrator and outputs barrel
Barrel contents integrator output
Barrel output event
19Implementing DEVDESS in DEVS Example Flip/Flop
level crossing detectors set derivative input to
zero when high or low limits are crossed
Pulse generator with exponential interarrival
times
level crossing outputs when going down
level crossing outputs when going up
20Implementing DEVDESS in DEVS Example Synapse
exponentially distributed positive and negative
spikes add to state of integrator
first order decay consisting of integrator with
negative feedback
21Implementing DEVDESS in DEVS Example Leaky
Neuron
Leaky Neuron is coupled model with components
synapse and leakyNeurInteg
negative feedback for leaking
time dependent threshold detector
22DEVS Threshold for Neuron
Relative Refractory Period
threshold
Resting Threshold
Absolute Refractory Period
elapsedSinceLastFire
public double thresholdFn(double e) if
(phaseIs("absoluteRefractory"))
return INFINITY else if
(phaseIs("relativeRefractory"))
return restingThresh (1
(refractFactor /(elapsedSinceLastFire
e))) else if
(phaseIs("resting")) return
restingThresh
inputgt thresh
fire
resting
inputgt thresh
absolute Refractory
relative Refractory
23DEVS Threshold for Neuron, contd
public void deltext(double e, message x)
Continue(e) if (somethingOnPort(x,
"in")) double input
getRealValueOnPort(x, "in") if
(input gt thresholdFn(e))
holdIn("fire", 0) else
elapsedSinceLastFire e
public message out()
message m new message() if
(phaseIs("fire")) content con
makeContent("out", new doubleEnt(pulseSize))
m.add(con) return m
public void initialize()
super.initialize() elapsedSinceLastFire
INFINITY passivateIn("resting")
public void deltint() if
(phaseIs("fire"))
elapsedSinceLastFire 0
holdIn("absoluteRefractory", absoluteRefractoryPer
iod) else if (phaseIs("absoluteRefracto
ry")) elapsedSinceLastFire
absoluteRefractoryPeriod
holdIn("relativeRefractory", refractoryPeriod)
else if (phaseIs("relativeRefractory"))
elapsedSinceLastFire INFINITY
passivateIn("resting")
24DEVS Threshold for Neuron, contd
public void deltext(double e, message x)
Continue(e) if (somethingOnPort(x,
"in")) double input
getRealValueOnPort(x, "in") if
(input gt thresholdFn(e))
holdIn("fire", 0) else
elapsedSinceLastFire e
public message out()
message m new message() if
(phaseIs("fire")) content con
makeContent("out", new doubleEnt(pulseSize))
m.add(con) return m
public void initialize()
super.initialize() elapsedSinceLastFire
INFINITY passivateIn("resting")
public void deltint() if
(phaseIs("fire"))
elapsedSinceLastFire 0
holdIn("absoluteRefractory", absoluteRefractoryPer
iod) else if (phaseIs("absoluteRefracto
ry")) elapsedSinceLastFire
absoluteRefractoryPeriod
holdIn("relativeRefractory", refractoryPeriod)
else if (phaseIs("relativeRefractory"))
elapsedSinceLastFire INFINITY
passivateIn("resting")
25Expressability Packages wrt DEVDESS
- Continuous simulation languages (CSSL,
ASCL,Simulink,Systems Dynamics,) are limited to
DESS - Hybrid languages (PowerDEVS,) have the event
detection but not integration state resetting
capability - Full DEVS systems with DESS simulation capability
(via quantization) (DEVSJAVA, aDEVS,) have
complete DEVDESS capability