MatlabDEVS Tbx Exampels

All examples can be found in folder DEVSPATH/02-examples.

Contents

Overview

Discrete Examples

Hybrid Examples

Discrete Examples

All atomic models to compose pure discrete examples are derived from class atomic and coupled models are derived from coupled or are instances of this class. The root coordinator to simulate these models is the pure discrete root coordinator root_model=r_c_discrete(root_model,tstart,tend).

Explore the examples to learn how to model with DEVS Tbx.



Example Description Associated Files Model Classes
Assembly Line Complex model of an assembly line.
Seven generators with different intergeneration times send parts to processing blocks.
Processing blocks assemble two parts and send them to next processing blocks where more parts are added.
A transducer counts completed workpieces.
Folder: DEVSPATH/02-examples/discrete/assembly_line
am_generator
am_proc_block
am_transducer

cm_c13
cm_c2
cm_g
Testcase 2 Outputs to one Input Two generators generate workpieces either of type1 or type2.
Processing block has one input and needs to decide of what type incoming WP is. Two workpieces can arrive at the same time at the same input port. A transducer counts completed workpieces.
Folder: DEVSPATH/02-examples/discrete/2-outputs-to-1-input
am_g_2types
am_double_input
am_t
Single Server Simple model which uses atomic models from the Assembly Line example.
Two generators act as sources for parts which are then assembled by a processing block.
A transducer counts completed workpieces.
Folder: DEVSPATH/02-examples/discrete/single_server
am_generator
am_proc_block
am_transducer
Bouncing Ball QSS A simple model of a ball bouncing up and down.
The gravity is integrated by two connected QSS1 integrators to velocity and to height.
An event detection atomic model determines the points in time when the ball hits the ground and direction of movement has to be reversed and damped.
Folder: DEVSPATH/02-examples/discrete/bouncing_ball_qss
static1
qss1
event_detect
Sine QSS Integrates a sine function to a cosine function.
One example uses a quantized sine source, the other a timed sine source.
Folder: DEVSPATH/02-examples/discrete/sine_qss
sine_qss1
timed_sine_qss1
qss1
Step QSS Integrates a step function by a QSS1 integrator. Time and values for step are customizable.
Folder: DEVSPATH/02-examples/discrete/steps-qss
step_qss1
qss1

Hybrid examples

Hybrid examples are composed from pure discrete and hybrid atomic models. This means that all pure discrete atomic models are derived from class atomic, all hybrid atomic models are derived from class hybrid_atomic. Coupled models are always instances of class hybrid_coupled. The root coordinator to simulate these models is the hybrid root coordinator [root_model,tout,yout,teout,yeout,ieout] = r_c_hybrid(root_model,tstart,tend,plot_params). With help of a wrapping concept between discrete simulation steps Matlab®'s ode45 is called. Contiuous parts of model can be plotted during simualtion via Matlab®'s ODEPlot functionality.

Hybrid PDEVS modeling and simulation is in an experimental status.

Example Description Associated Files Atomic Models
Bouncing Balls Models of bouncing balls which keep continuous variables for velocity and height.
Balls can be activated through a discrete port.
Continuous variables are plotted during simulation.
Folder: DEVSPATH/02-examples/hybrid/bouncing_balls
discrete:
am_ball_starter
am_hit_counter

hybrid:
am_bball
Orange Juice Canning The combined discrete-continuous example "Orange Juice Canning" from "Introduction to Simulation using SIMAN", page 451.
Some atomic components are pure discrete, some are hybrid.
Continuous variables are plotted during simulation.
Folder: DEVSPATH/02-examples/hybrid/orange_juice_canning
discrete:
am_truck_generator
am_fifo_queue
am_dock_undock_server
am_truck_transducer

hybrid:
am_truck
am_tank
am_canner





DEVS Tbx Home      Modelbase           << Back