Sei sulla pagina 1di 6

10 10

1 1
System Simulation System Simulation
446 446- -10 10
Prof. Neil A. Duffie Prof. Neil A. Duffie
University of Wisconsin University of Wisconsin- -Madison Madison
Neil A. Duffie, 1996 Neil A. Duffie, 1996
All rights reserved All rights reserved
10 10
2 2
Utility of System Simulation Utility of System Simulation
Understanding system behavior Understanding system behavior
- - tests on actual system may be difficult tests on actual system may be difficult
- - system may not yet exist in hardware system may not yet exist in hardware
Aid in design Aid in design
- - answer what if questions answer what if questions
- - iterate to final system design iterate to final system design
- - verify design before implementation verify design before implementation
Choice of simulation method Choice of simulation method
Correctness of models used Correctness of models used
10 10
3 3
Spring Spring- -Mass Mass- -Damper System Damper System
mass mass
M [kg] M [kg]
damper damper
c [N c [N- -s/m] s/m]
spring spring
k [N/m] k [N/m]
y(t) [m] y(t) [m]
x(t) [m] x(t) [m]
M
d
2
y(t)
dt
2
+ c
dy(t)
dt
+ ky(t) = kx(t)
1

n
2
d
2
y(t)
dt
2
+
2

n
dy(t)
dt
+ y(t) = x(t)
where
n
=
k
M
=
c
2 kM
10 10
4 4
System Damping System Damping
> 1: overdamped > 1: overdamped
(unforced response not oscillatory) (unforced response not oscillatory)
< 1: underdamped < 1: underdamped
(unforced response is oscillatory) (unforced response is oscillatory)
= 1: critically damped = 1: critically damped
(unforced response not oscillatory) (unforced response not oscillatory)
Two examples with Two examples with
n n
= 1.414 rad/s: = 1.414 rad/s:
= 0.3536 (underdamped) = 0.3536 (underdamped)
= 1.0610 (slightly overdamped) = 1.0610 (slightly overdamped)
10 10
5 5
Obtaining Input Obtaining Input- -Ouput Response Ouput Response
Solution of system equations with given Solution of system equations with given
input function for resulting output input function for resulting output
function: function:
- - yields explicit, exact output function yields explicit, exact output function
- - different solution each input function different solution each input function
- - difficult for all but simple input functions difficult for all but simple input functions
Time Time- -based simulation of system: based simulation of system:
- - formulation same for all input functions formulation same for all input functions
- - approximate solution based on time approximate solution based on time
steps and numerical integration steps and numerical integration
10 10
6 6
Spring Spring- -Mass Mass- -Damper Solution Damper Solution
For x(t) = 0 and initial conditions: For x(t) = 0 and initial conditions:
mass position = 0.15 [m] mass position = 0.15 [m]
mass velocity = 0 [m/s] mass velocity = 0 [m/s]
1

n
2
s
2
Y(s) sy(0

) y (0

)
( )
+
2

n
sY(s) y(0

)
( )
+ Y(s) = x(s)
1

n
2
s
2
Y(s) 0.15s
( )
+
2

n
sY(s) 0.15 ( ) + Y(s) = 0
10 10
7 7
Spring Spring- -Mass Mass- -Damper Solution ( Damper Solution ( < 1) < 1)
Y(s) =
0.15
2

n
+
s

n
2








s
2

n
2
+
2s

n
+ 1








=
0.15 s + 2
n
( )
s +
n
( )
2
+ 1
2
( )

n
2
( )
Using table of Laplace transforms: Using table of Laplace transforms:
y(t) = 0.15
1
1
2
e

n
t
sin
n
1
2
t
( )
where = cos
1

10 10
8 8
0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10
- -0.05 0.05
0 0
0.05 0.05
0.1 0.1
0.15 0.15
Time [sec] Time [sec]
y
(
t
)

D
i
s
p
l
a
c
e
m
e
n
t

[
m
]
y
(
t
)

D
i
s
p
l
a
c
e
m
e
n
t

[
m
]
Response Plot: Response Plot:
x(t) = 0 [m], x(t) = 0 [m],
n n
= = 1.414 [rad/s] 1.414 [rad/s], , = 0.3536 = 0.3536
10 10
9 9
Spring Spring- -Mass Mass- -Damper Solution ( Damper Solution ( > 1) > 1)
Using table of Laplace transforms: Using table of Laplace transforms:
y(t) = 0.15
1
b a ( )
a ( )e
at
b ( )e
bt
( )
where = 2
n
Y(s) =
0.15
2

n
+
s

n
2








s
2

n
2
+
2s

n
+ 1








=
0.15 s + 2
n
( )
s + a ( ) s + b ( )
where a,b =
n

n

2
1
10 10
10 10
0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10
0 0
0.02 0.02
0.04 0.04
0.06 0.06
0.08 0.08
0.1 0.1
0.12 0.12
0.14 0.14
Time [sec] Time [sec]
y
(
t
)

D
i
s
p
l
a
c
e
m
e
n
t

[
m
]
y
(
t
)

D
i
s
p
l
a
c
e
m
e
n
t

[
m
]
Response Plot: Response Plot:
x(t) = 0 [m], x(t) = 0 [m],
n n
= = 1.414 [rad/s] 1.414 [rad/s], , = 1.0610 = 1.0610
10 10
11 11
Spring Spring- -Mass Damper Simulation Mass Damper Simulation
d y (t)
dt
=
n
2
x(t)
2

n
y (t) y(t)






dy(t)
dt
= y (t)
State equations: State equations:
Example: Euler integration with time step t Example: Euler integration with time step t
y (t + t) y (t) +
n
2
x(t)
2

n
y (t) y(t)





t
y(t + t) y(t) + y (t)t
10 10
12 12
Choice of Time Step t Choice of Time Step t
Choose time step so that t is shorter Choose time step so that t is shorter
than the (significant) characteristic times than the (significant) characteristic times
of the system to be simulated. of the system to be simulated.
Characteristic times: Characteristic times:
- - process and controller time constants process and controller time constants
- - process delays process delays
- - closed closed- -loop system time constants loop system time constants
- - damped natural frequencies damped natural frequencies

c
=
1

d
=
1

n
1
2
10 10
13 13
Spring Spring- -Mass Mass- -Damper Time Step Damper Time Step

n
= 1.414 [rad/ s], = 0.3536:

d
=
n
1
2
= 1.323 [rad/ s]
t <<
1

d
= 0.756 [s]

n
= 1.414 [rad/ s], = 1.0610:
a,b =
n

n

2
1= 2,1
t << min
1
a
,
1
b






= min
1
2
,
1
1






= 0.5 [s]
Use t = 0.01 [s]. Compare to t = 0.001 [s]. Use t = 0.01 [s]. Compare to t = 0.001 [s].
10 10
14 14
0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10
- -0.05 0.05
0 0
0.05 0.05
0.1 0.1
0.15 0.15
Time [sec] Time [sec]
y
(
t
)

D
i
s
p
l
a
c
e
m
e
n
t

[
m
]
y
(
t
)

D
i
s
p
l
a
c
e
m
e
n
t

[
m
]
Response Plot: Response Plot:
x(t) = 0 [m], x(t) = 0 [m],
n n
= = 1.414 [rad/s] 1.414 [rad/s], , = 0.3536 = 0.3536
10 10
15 15
0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10
0 0
0.02 0.02
0.04 0.04
0.06 0.06
0.08 0.08
0.1 0.1
0.12 0.12
0.14 0.14
Time [sec] Time [sec]
y
(
t
)

D
i
s
p
l
a
c
e
m
e
n
t

[
m
]
y
(
t
)

D
i
s
p
l
a
c
e
m
e
n
t

[
m
]
Response Plot: Response Plot:
x(t) = 0 [m], x(t) = 0 [m],
n n
= = 1.414 [rad/s] 1.414 [rad/s], , = 1.0610 = 1.0610
10 10
16 16
Position Control Simulation Position Control Simulation
mass mass
M [kg] M [kg]
damper damper
c [N c [N- -s/m] s/m]
spring spring
k [N/m] k [N/m]
y(t) [m] y(t) [m]
x(t) [m] x(t) [m]
x(t) = k
c
r(t) y(t) ( )dt
0
t

Actuator Actuator
Integral control: Integral control:
x(t + t) x(t) + k
c
r(t) y(t) [ ]t
y (t + t) y (t) +
n
2
x(t)
2

n
y (t) y(t)





t
y(t + t) y(t) + y (t)t
10 10
17 17
0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10
0 0
0.05 0.05
0.1 0.1
0.15 0.15
0.2 0.2
Time [sec] Time [sec]
y
(
t
)

D
i
s
p
l
a
c
e
m
e
n
t

[
m
]
y
(
t
)

D
i
s
p
l
a
c
e
m
e
n
t

[
m
]
Underdamped System Step Response Underdamped System Step Response
(overdamped process) (overdamped process)
r(t) r(t)
y(t) y(t)

Potrebbero piacerti anche