Transcript Outline

Continuity and Change (Activity) Are Fundamentally Related In
DEVS Simulation of Continuous Systems
Bernard P. Zeigler
Arizona Center for Integrative Modeling and Simulation
(ACIMS)
University of Arizona
Tucson, Arizona 85721, USA
[email protected]
www.acims.arizona.edu
Outline
• Review DEVS Framework for M&S
• Brief History of Activity Concept Development
• Summary of Recent Results
• Theory of Event Sets – Basis for Activity Theory
• Conclusions and Implications
Synopsis
• A continuous curve can be represented by a sequence of
finite events sets whose points get closer together at just
the right rate
• We can measure the amount of change in such a
continuous curve – this is its activity
• The activity divided by the largest change in an event set
gives the size of this set’s most economical
representation
• DEVS quantization can achieve this optimal
representation
DEVS Background
• DEVS = Discrete Event System Specification
• Based on formal M&S framework
• Derived from mathematical dynamical system theory
• Supports hierarchical, modular composition
• Object oriented implementation
• Supports discrete and continuous paradigms
• Exploits efficient parallel and distributed simulation
techniques
DEVS Hierarchical Modular Composition
Atomic: lowest level model,
contains structural
dynamics -- model level
modularity
Coupled: composed of
Atomic
one or more atomic
and/or coupled
models
Hierarchical
construction
Ato mic
Atomic
Atomic
A to mic
Atomic
Atomic
DEVS Theoretical Properties
• Closure Under Coupling
• Universality for Discrete Event Systems
• Representation of Continuous Systems
– quantization integrator approximation
– pulse representation of wave equations
• Simulator Correctness, Efficiency
DEVS Expressability
Coupled Models
Atomic Models
Ordinary
Differential
Equation
Models
Processing/
Queuing/
Coordinating
Spiking
Neuron
Models
Petri Net
Models
Partial
Differential
Equations
Networks,
Collaborations
Processing
Networks
Physical
Space
Spiking
Neuron
Networks
n-Dim
Cell Space
Discrete
Time/
StateChart
Models
Stochasti
c
Models
Fuzzy
Logic
Models
can be
components
in a coupled
model
Cellular
Automata
Quantized
Integrator
Models
Reactive
Agent
Models
Multi
Agent
Systems
Self Organized
Criticality
Models
Activity Theory unifies continuous and discrete paradigms
Heterogeneous
activity in time
and space
DEVS can represents
all decision making and
continuous dynamic
elements
Quantization allows
DEVS to naturally
focus computing
resources on high
activity regions
DEVS concentrates its computational resources at the regions of high activity. While
DEVS uses smaller time advance (similar to time step in DTSS) in regions of high
activity. DTSS uses the same time step regardless of the activity.
Mapping Ordinary Differential Equation Systems
into DEVS Quantized Integration
(n+1)D
X>0
D
ta(q) = ((n+1)D-q)/x
nD
x
s
x
s
x
f1
d s1/dt

ta(nD) = |D/x|
s1
X>0
D
X<0
X<0
nD
(n-1)D
f2
q
d s2/dt

s2
d sn/dt

sn
e
ta(q) = |q-nD/x|
...
s
x
fn
DEVS Integrator
x
DEVS
instantaneous
function
s
x
s
x

DEVS
S
d s 2/dt DEVS
 s2
f2
f
F
d s 1/dt
s1
d s n/dt
 sn
DEVS
1
F
...
s
x
F
fn
Theory of Modeling and Simulation, 2nd Edition, Bernard P. Zeigler , Herbert Praehofer
, Tag Gon Kim , Academic Press, 2000.
PDE Stability Requirements
• Courant Condition requires smaller time step for
smaller grid spacing for partial differential equation
solution
• This is a necessary stability condition for discrete time
methods but not for quantized state methods
time step as a function
of number of cells for
given length
 L
h( N )  k  
N
quantum as a function
of number of cells for
given length
2
q( N ) 
H
N
Ernesto Kofman, Discrete Event Based Simulation and Control of Hybrid Systems,
Ph.D. Dissertation: Faculty of Exact Sciences, National University of Rosario, Argentina
Activity – a characteristic of continuous functions
f (t )
b
quantum
#Threshold Crossings
= Activity/quantum
a
t
 
q
d f (t )
dt
Activity
= |b-a|
Activity(0,T) =
t1
ti
tn
 mi1 mi
i
#DEVS Transitions = #Threshold Crossings
dy1
dt
x
∫
F1
y
F2
dy
 f ( y)
dt

dA
 | f ( y) |
dt
Whenever there is a change in y,
increment the counter to get the
number of DEVS transitions.
dy2
dt
∑
Com
parat
or
Coun
ter
∫
∑
∫
1/quant
um
R. Jammalamadaka,, Activity Characterization of Spatial Models: Application to the Discrete Event
Solution of Partial Differential Equations, M.S. Thesis: Fall 2003,
Electrical and Computer Engineering Dept., University of Arizona
Activity Calculations for 1-D Diffusion
Initial
state
Activity
Activity/N
as N∞
Rectangular
pulse
2HN(W/L)(1 –W/L)
2H(W/L)
(1 –W/L)
Triangular
pulse
(N-1)*H/4
H/4
Gaussian
pulse
 2


L

ln 



2*

*
e
2*
c
*
t

start  






N *H  1
L

  erf 

L  2  4* c *tstart 

 erf  0.707 







Constant/L
This shows that the activity per cell in all the three cases goes to
a constant as N (number of cells) tends to infinity.
DEVS Efficiency Advantage where Activity is
Heterogeneous in Time and Space
time step
size
t
# time
steps
t
=T/
Potential Speed Up
=
#time steps /
# crossings
Time
Period
T
activity
A
quantum
q
# crossings
=A/q
X
number
of
cells
Ratio: DTSS/DEVS Transitions
# DTSS
# DEVS

MaxDeriv  T
A/ N
1
where
 dyi 
MaxDeriv = Maxi 

 dt 
#DTSS/#DEVS Ratio for 1-D Diffusion
initial state
DTSS/DEVS
TcN 2
2w(1  w) L2
Rectangular Pulse
where w is the width to the length ratio
Triangular Pulse
4TcN
L2
Gaussian Pulse
0.062T
f ( L)
3 1/ 2
(c * tstart )
*f is an increasing function of L
Execution time (s)
1600
1200
Explicit
Implicit
800
Quantized
400
0
0
50 000
100 000
150 000
Number of cells
200 000
250 000
Alexander Muzy’s scalability results
Muzy’s Fire Front model
Instantaneous Activity
Peak Bars
Accumulated Activity
Region Of Imminence
S. R. Akerkar, Analysis and Visualization of Time-varying data using
the concept of 'Activity Modeling', M.S. Thesis, University of Arizona,2004
DEVS vs DTSS in Parallel Distributed
Simulation
J. Nutaro, Parallel Discrete Event Simulation with Application to Continuous Systems,
Ph. D. Dissertation Fall 2003,, Univerisity of Arizona
Quantization in Digital Processing
QFFT Module
1
2
Q
3
Q
4
.
.
.
N-1
B
Q
B
.
.
.
N/2
Units
Q
B
Q
.
.
.
.
.
.
Q
B
N/2
Units
B
N
2
1
2
3
3
4
4
1
B
.
.
.
N
q = q0/N
q = q0/(N-1)
1
B
2
Q
3
B
4
.
.
.
.
.
.
...
N-1
Q
N-1
N/2
Units
Q
B
.
.
.
N-1
N
N
q = q0/1
n = log2N Stages
Q = Quantizer
B = Butterfly
N = 1024 (powers of 2)
n = 10 (log2N)
q = Quantum for respective stage
Transmit to next
stage only when
quantum
exceeded
Harsha Gopalakrishnan, DEVS Scalable Modeling of a High performance
pipelined DIF FFT core with Quantization, MS Thesis U. Arizona.
QFFT System
Output
Input
300 – 3000 Hz
QFFT Module
(Backward Transform)
QFFT Module
(Forward Transform)
Music 300 Hz - 3000 Hz
Analog LPF
3000 Hz cut-off
Voice 300 Hz - 3000 Hz
At q = .02
60000000
30000000
25000000
Computation Time
Computation Time
At q = .06
20000000
15000000
10000000
5000000
50000000
40000000
30000000
20000000
10000000
0
0
0
0.02
0.04
0.06
0.08
0.1
0.12
0.14
0.16
0
0.05
0.1
Quantum
Reduction (at q0 = 0.02) = 30.8%
0.15
Quantum
Reduction (at q0 = 0.06) = 52%
0.2
0.25
0.3
Event Set Basics
E  {(ti , vi ) | i  1...n}
size( E )  n
Sum( E )   | vi 1  vi |
Max( E )  maxi | vi 1  vi |
i
extrema( E)  {(t *i , v *i )}  E
Sum( E )   | v *i 1 v *i | .
E refines E  if E  E 
E refines E   Sum( E )  Sum( E )
E refines E 
Sum( E )  Sum( E )
iff
E refines wtb E 
E refines wtb E   Max( E )  Max( E )
i
Event set refinement sequence
size = 5
size = 9
size = 17
size = 33
Convergence of the Sum ,
Maximum variation, and form factor
Sum of Variations
Number of peaks detected
Maximum Variation
A refinement sequence
E0 , E1 ,..., Ei , Ei 1 ,... such that:
Sum( Ei )  A
Max( Ei )  k / size( Ei )
is a discrete event representation of a differentiable continuous function
Domain and Range Based Event Sets
Et*
domain-based event set with equally spaced domain points separated by step
Eq
denote a range-based event set with equally spaced range values, separated by a
q
quantum
R
size
. ( Eq ( f ))
size( Et ( f ))

Avg ( f )
1
MaxDer ( f )
For an n-th degree polynomial we have
. So that potential gains of the order of
Avg ( f ) 
Sum( f )
domainIntervalLength
1
1
R
2
n
n
O(n2 ) are possible.
Conclusions
• Activity Theory confirms that where there is
heterogeneity of activity in space and time,
DEVS will have significant advantage over
conventional numerical methods
• This lead us to try reformulating the math
foundations of continuity in discrete event terms
Implications
•
•
•
•
•
•
sensing– most sensors are currently driven at high sampling rates to
obviate missing critical events. Quantization-based approaches require less
energy and produce less irrelevant data.
data compression – even though data might be produced by fixed interval
sampling, it can be quantized and communicated with less bandwidth by
employing domain-based to range-based mapping.
reduced communication in multi-stage computations, e.g., in digital filters
and fuzzy logic is possible using quantized inter-stage coupling.
spatial continuity–quantization of state variables saves computation and
our theory provides a test for the smallest quantum size needed in the time
domain; a similar approach can be taken in space to determine the smallest
cell size needed, namely, when further resolution does not materially affect
the observed spatial form factor.
coherence detection in organizations – formations of large numbers of
entities such as robotic collectives, ants, etc. can be judged for coherence
and maintenance of coherence over time using this paper’s variation
measures.
education -- revamp teach of the calculus to dispense with its mysterious
foundations (limits, continuity) that are too difficult to convey to learners.