38
MONTE
CARLO
AND
GRIDBASED
TECHNIQUES
FOR
STOCHASTIC
SIMULATION
145
38
Monte
Carlo
and
GridBased
Techniques
for
Stochas
tic
Simulation
In
this
problem
you
will
compare
the
performance
of
random
vs.
regular
sampling
on
a
specific
stochastic
dynamics
problem.
The system we are
considering
is
a
simple
rotary
mass,
controlled
by
a
motor:
Jφ
¨
=
τ
=
k
t
i,
where
J
is
the
mass
moment
of
inertia,
φ
is
its
angular
position,
τ
is
the
control
torque,
k
t
is
the
torque
constant
of
the
motor,
and
i
is
the
electrical
current
applied.
While
this
is
a
simple
control
design
problem
for
given
values
of
J
and
k
t
,
the
situation
we
study
here
is
when
these
are
each
only
known
within
a
range
of
values.
In
particular,
J
is
described
as
a
uniform
random
variable
in
the
range
[5
,
15]
kg
·
m
2
, and
k
t
is
a
uniform
random
variable
in
the
range
[4
,
6]
Nm/A
.
The
basic
question
we
ask
is:
if
the
control
system
is
designed
for
a
nominal
condition,
say
J
= 10
kg
·
m
2
and
k
t
= 5
Nm/A
,
how
will
the
closedloop
system
vary
in
its
response,
for
all
the
possible
J
and
k
t
?
This
is
a
question
of
stochastic
simulation,
that
is,
finding
the
statistics
of
a
function
output,
given
the
statistics
of
its
input.
The
code
fragment
provided
below
applies
Monte
Carlo
and
gridbased
approaches
to
find
the
mean
and
variance
of
the
function
cos(
y
),
when
y
is
uniformly
distributed
in
the
range
[2
,
5].
Try
running
this
a
few
times
and
notice
the
effects
of
changing
N
.
The
gridbased
approach
is
clearly
giving
a
good
result
with
far
less
work
than
MC
 for
this
example
with
only
one
random
dimension.
In
general,
the
gridbased
methods
suffer
greatly
as
the
d
dimension
increases;
for
trapezoidal
integration,
the
error
goes
as
1
/N
2
/d
,
whereas
for
Monte
Carlo
it
is
simply
1
/N
1
/
2
for
any
d
!
1.
For
the
nominal
system
model
(as
above)
design
a
proportionalderivative
controller
so
that
the
closedloop
step
response
reaches
the
commanded
angle
for
the
first
time
in
about
one
second
and
the
maximum
overshoot
is
twenty
percent.
The
closedloop
system
equation
is
Jφ
¨
=
k
t
(
−
k
p
(
φ
−
φ
desired
)
−
k
d
φ
˙
)
−→
Jφ
¨
+
k
t
k
d
φ
˙
+
k
t
k
p
φ
=
k
t
k
p
φ
desired
.
Remember
that
if
you
write
the
lefthand
side
of
the
equation
as
φ
¨
+2
ζω
n
+
ω
n
2
, you
can
tune
this
up
quite
easily
because
the
overshoot
scales
directly
with
damping
ratio
ζ
,
and
you
can
then
adjust
ω
n
to
get
the
right
rise
time.
Show
a
plot
of
the
step
response
and
list
your
two
gains
k
p
and
k
d
.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '05
 GeorgeKocur
 Variance, Randomness, gridbased techniques

Click to edit the document details