This preview shows pages 1–3. Sign up to view the full content.
Control of DiscreteEvent Systems
Introduction
What is simulation and what is it used for
Simulation is a method of predicting the future given the situation set forth in the model. It is used to run a
make believe system in order to predict how the real system will perform. In many application an analytical
solution can not be found and one must resort to simulation. With simulation one only has to specify the
model in terms of how the system works. The constraints do not need to be identified since they are
imbedded in the model. The analytical solution requires identifying and expressing each constraint in a
precise mathematical form.
Deterministic simulation
The first type of simulation that will be looked at is of a simple deterministic model. Deterministic means
that we can determine what the simulation output will be. If we run the simulation two times we get the
same results. No random inputs are used. This type of simulation is used for systems that have no random
events associated with it. On the other hand nondeterministic simulation is when there is a random
component to the model and the exact output can not be determined but rather estimated. This is used to
simulate processes that involve random events.
The following is an example of a deterministic system we wish to analyze. We will use both the analytical
and numerical approach.
Suppose you are to invest $40 per week for a 50week year, a total investment of $2000, to put it into an
IRA account. The IRA account requires a minimum of $2000 so you save the money in a savings account
in the mean time. Since the IRA account has a much higher interest rate than the savings account we will
consider borrowing $2000 to invent, along with the money in the saving account, into the IRA. The
question is when do we make this transaction. Do not consider the deferred tax property of the IRA account
of the effects of compounding the interest.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document Analytical Solution:
IRA
b
s
I
t
I
t
t
tI
t
y
)
1
(
2000
)
1
(
2
)
1
(
2000
2
2000
)
(

+


+
=
s
b
IRA
b
I
I
I
I
T
dt
t
dy


=
⇒
=
0
)
(
if
%
6
%,
8
%,
2
=
=
=
IRA
b
s
I
I
I
then T = 120 days.
This means the optimal time to make the transaction is in 120 days.
Numerical Solution:
We will simulate the system using the algorithm below. The simulation will be given T and the interest
rates and will return the amount of money made. We then run the simulation for several values of T and
chose the best one.
int day = 0;
double
savings = 0;
double
longterm = 0;
double petty = 0;
for (day = 0; day < 365; day++)
{
savings = savings + (2000.0 / 365);
if (savings >= 0)
petty = petty + savings * (IS / 365);
else
petty = petty + savings * (IB / 365);
petty = petty + longterm * (IIRA / 365);
if (day == TDAY)
{
longterm = 2000;
savings = savings  2000;
}
}
Notice that the petty account does not earn interest.
This simulation yields the optimal time to make the transaction is as 121 days.
This is the end of the preview. Sign up
to
access the rest of the document.
This note was uploaded on 09/13/2011 for the course EEL 5937 taught by Professor Staff during the Spring '08 term at University of Central Florida.
 Spring '08
 Staff

Click to edit the document details