

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Figure 1. Smoking Addiction Process
Hint: We don’t have to simulate this example using real-time so let’s define ta(s)=0.1 sec in ODEVS. We
need to perform 40-times transition for a run. Thus simulation ending time should be 0.1*40=4 and we can
control it using pause_at 4 .1. Then we can get the result of a simulation run by 4 seconds.
To determine the next stat according to each transition’s probability, we should use inverse transformation
of pmf (see Chapter 8 of Lecture Note).
N, ta(N) I, ta(I)^ E, ta(E)
S, ta(S) (^) A, ta(A)
Q, ta(Q)
!oy1, 0.
!oy2,
!oy4,
!oy1,
!oy1, 0.
!oy4,
!oy4,
!oy4,
!oy4,
!oy4,
!oy3,
!oy3,
we want to generate its random variant X for the following U~U[0, 1]. (20 pts = 4 * 5
pts)
(a) U=0.2, (b) U=0.4, (c) U=0.6, (d) U=0.
Figure 2. Triangular pdf
Hint: Recall the inverse transformation procedure is (1) Make F(x) and (2) Make F
transformation for U[a,b] from U[0,1] in Chapter 8 of Lecture Note.
(^1 )
1
x
f(x)