
all differential-equation state variables can be reset by reset and drunr state-
ments in the experiment-protocol script.
A DYNAMIC program segment may contain any number of vector assign-
ments and vector differential equations together with scalar assignments
and/or differential equations. Different vector-assignment targets and state
vectors can have different dimensions. Scalar expressions can also contain
explicit subscripted variables, provided that their arrays have been declared.
(c) Vectorization and Model Replication—Significant Applications
A given system of n-dimensional vector assignments and n-dimensional vector
differential equations, say
Vector y1 = g1(t; x1, x2; a, alpha)
Vector y2 = g2(t; x1, x2, y1; beta)
Vectr d/dt x1 = f1(t; x1, x2; y1, y2; b, c)
Vectr d/dt x2 = f2(t; x1, x2; gamma)
is compiled into corresponding sets of n scalar operations
y1[i] = g1(t; x1[i], x2[i]; a[i], alpha) (i = 1, 2, …, n)
y2[i] = g2(t; x1[i], x2[i], y1[i]; beta) (i = 1, 2, …, n)
d/d x1[i] = f1(t; x1[i], x2[i]; y1[i], y2[i]; b[i], c[i]) (i = 1, 2, …, n)
d/dt x2[i] = f2(t; x1[i], x2[i]; y1[i]; gamma) (i = 1, 2, …, n)
in that order. The compiler effectively creates n replicated models.
4
These
models have different parameter combinations
a[i], b[i], c[i] defined by the
parameter vectors
a, b, and c, but all n replicated models share the features
represented by the scalar parameters or variables
alpha, beta, and gamma.
5
Vectorization allows one to exercise a possibly large number of models in
a single simulation run. Applications of this extraordinarily powerful simula-
tion technique are the main topic of this book. Specifically,
• Vectorized parameter-influence studies simulate replicated models with
different parameter values (Sections 4-2 and 4-3).
• Vectorized Monte Carlo simulation computes statistics on samples of
models with random parameters or noise inputs (Sections 4-7 to 4-10;
Chapter 5).
62 Programs with Vector/Matrix Operations and Submodels
4
Note that successive operations for different models are interleaved in the computer memory.
5
Scalar quantities are common to all the replicated models and must, therefore, not depend in any
way on the replicated-model vectors. That said, scalars can be defined by the experiment protocol,
by DYNAMIC-segment assignments, or even by differential equations.