Graphics Programs Reference
In-Depth Information
menu of the SIMULINK model, to distinguish quantities that are vectors
from those that are scalars. The dimension 5 on most of the lines is
the value of N , the number of cars. Most of the model is like the example in
Chapter 8, except that our unknown function (called u ), representing the car
positions, is vector-valued and not scalar-valued. The major exceptions are
these:
1. We need to incorporate the reaction-time delay, so we've inserted a
Transport Delay block from the Continuous block library.
2. The parameter λ shows up as the value of the gain in the sensitivity
parameter Gain block in the upper right.
3. Plotting car positions by themselves is not terribly useful, since only the
relative positions matter. So before outputting the car positions to the
Scope block labeled “relative car positions,” we've subtracted off a
constant linear function (corresponding to uniform motion at the
average car speed) created by the Ramp block from the Sources block
library.
4. We've made use of the option in the Integrator blocks to input the initial
conditions, instead of having them built into the block. This makes the
logical structure a little clearer.
5. We've used the subsystem feature of SIMULINK. If you enclose a bunchof
blocks with the mouse and then click on “Create subsystem” in the
model's Edit menu, SIMULINK will package them as a subsystem. This
is helpful if your model is large or if there is some combination of blocks
that you expect to use more than once. Our subsystem sends a vector v to
( S I ) v = S v v . A Sum block (with one of the signs changed to a )is
used for vector subtraction. To model the action of S , we've used the
Demux and Mux blocks from the Signals and Systems block library. The
Demux block, with“number of outputs” parameter set to [4, 1], splits a
five-dimensional vector into a pair consisting of a four-dimensional vector
and a scalar (corresponding to the last car). Then we reverse the order
and put them back together with the Mux block, with “number of inputs”
parameter set to [1, 4].
Once the model is assembled, it can be run with various inputs. The
following pictures show the two scope windows with a set of conditions
corresponding to stable flow (though, to be honest, we've let two cars cross
througheachother briefly!):
Search WWH ::




Custom Search