Wolfram.com
WolframAlpha.com
WolframCloud.com
Wolfram Language
Example Repository
Ready-to-use examples for the Wolfram Language
Primary Navigation
Categories
Astronomy
Audio Processing
Calculus
Cellular Automata
Chemistry
Complex Systems
Computer Science
Computer Vision
Control Systems
Creative Arts
Data Science
Engineering
Finance & Economics
Finite Element Method
Food & Nutrition
Geography
Geometry
Graphs & Networks
Image Processing
Life Sciences
Machine Learning
Mathematics
Optimization
Physics
Puzzles and Recreation
Quantum Computation
Signal Processing
Social Sciences
System Modeling
Text & Language Processing
Time-Related Computation
Video Processing
Visualization & Graphics
Alphabetical List
Submit a New Resource
Learn More about
Wolfram Language
Related Pages
Related Symbols
StateFeedbackGains
AffineStateSpaceModel
StateSpaceModel
OutputResponse
StateResponse
Related Categories
Control Systems
Model and Regulate a Wilberforce Pendulum
Model a rotating mass suspended from a spring
Example Notebook
Open in Cloud
Download Notebook
S
e
t
u
p
t
h
e
L
a
g
r
a
n
g
i
a
n
f
o
r
t
h
e
s
y
s
t
e
m
,
u
s
i
n
g
t
h
e
f
o
l
l
o
w
i
n
g
s
y
m
b
o
l
s
:
S
y
m
b
o
l
D
e
s
c
r
i
p
t
i
o
n
z
m
a
s
s
v
e
r
t
i
c
a
l
p
o
s
i
t
i
o
n
θ
m
a
s
s
a
n
g
u
l
a
r
p
o
s
i
t
i
o
n
m
m
a
s
s
w
e
i
g
h
t
ℐ
m
o
m
e
n
t
o
f
i
n
e
r
t
i
a
k
s
p
r
i
n
g
c
o
n
s
t
a
n
t
δ
s
p
r
i
n
g
t
o
r
s
i
o
n
c
o
n
s
t
a
n
t
ϵ
c
o
u
p
l
i
n
g
c
o
n
s
t
a
n
t
I
n
[
1
]
:
=
ℒ
=
1
2
(
m
2
z
'
[
t
]
-
k
2
z
[
t
]
+
ℐ
2
θ
'
[
t
]
-
δ
2
θ
[
t
]
-
ϵ
z
[
t
]
θ
[
t
]
)
;
The equations of motion are derived using the Euler-Lagrange formula:
I
n
[
2
]
:
=
e
q
n
s
=
T
a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r
s
,
S
y
s
t
e
m
s
M
o
d
e
l
L
a
b
e
l
s
{
{
f
,
τ
}
,
{
z
,
θ
}
,
{
z
,
z
'
,
θ
,
θ
'
}
}
]
O
u
t
[
5
]
=
f
τ
z
0
1
.
0
0
0
0
′
z
-
2
4
.
0
-
8
.
0
2
0
.
0
θ
0
0
0
1
.
0
0
′
θ
-
0
.
0
6
3
6
8
4
1
0
-
0
.
1
1
9
4
0
8
0
0
0
.
1
5
9
2
1
z
1
0
0
0
0
0
θ
0
0
1
0
0
0
Simulate the output response of the affine model to a disturbance in the angle
θ
:
I
n
[
6
]
:
=
O
u
t
p
u
t
R
e
s
p
o
n
s
e
[
{
a
s
s
m
,
{
0
,
0
,
0
.
1
,
0
}
}
,
{
0
,
0
}
,
{
t
,
0
,
3
0
}
]
;
P
l
o
t
[
%
,
{
t
,
0
,
3
0
}
,
P
l
o
t
R
a
n
g
e
A
l
l
,
P
l
o
t
L
e
g
e
n
d
s
{
z
,
θ
}
]
O
u
t
[
6
]
=
Find the eigenvalues of the linear system:
I
n
[
7
]
:
=
E
i
g
e
n
v
a
l
u
e
s
[
F
i
r
s
t
@
N
o
r
m
a
l
@
s
s
m
]
/
/
C
h
o
p
O
u
t
[
7
]
=
{
0
.
+
4
.
9
0
1
1
5
,
0
.
-
4
.
9
0
1
1
5
,
0
.
+
0
.
3
1
3
1
9
7
,
0
.
-
0
.
3
1
3
1
9
7
}
The system is controllable with f and
θ
:
I
n
[
8
]
:
=
T
a
b
l
e
[
C
o
n
t
r
o
l
l
a
b
l
e
M
o
d
e
l
Q
[
S
y
s
t
e
m
s
M
o
d
e
l
E
x
t
r
a
c
t
[
s
s
m
,
i
]
]
,
{
i
,
{
A
l
l
,
1
,
2
}
}
]
O
u
t
[
8
]
=
{
T
r
u
e
,
T
r
u
e
,
T
r
u
e
}
Set f as the sole feedback input and
θ
as a disturbance input:
I
n
[
9
]
:
=
s
s
p
e
c
=
"
I
n
p
u
t
M
o
d
e
l
"
s
s
m
,
"
F
e
e
d
b
a
c
k
I
n
p
u
t
s
"
1
,
"
E
x
o
g
e
n
o
u
s
I
n
p
u
t
s
"
2
;
Compute a pole placement controller that places the poles at the specified locations:
I
n
[
1
0
]
:
=
=
S
t
a
t
e
F
e
e
d
b
a
c
k
G
a
i
n
s
[
s
s
p
e
c
,
{
-
2
,
-
3
,
-
3
.
5
,
-
4
}
,
"
D
a
t
a
"
]
O
u
t
[
1
0
]
=
S
y
s
t
e
m
s
M
o
d
e
l
C
o
n
t
r
o
l
l
e
r
D
a
t
a
D
e
s
i
g
n
:
p
o
l
e
p
l
a
c
e
m
e
n
t
»
F
e
e
d
b
a
c
k
i
n
p
u
t
s
c
o
u
n
t
:
1
Connect the controller to the affine model to obtain the closed-loop system:
I
n
[
1
1
]
:
=
c
s
y
s
=
[
{
"
C
l
o
s
e
d
L
o
o
p
S
y
s
t
e
m
"
,
"
I
n
p
u
t
M
o
d
e
l
"
a
s
s
m
}
]
O
u
t
[
1
1
]
=
z
[
t
]
0
.
+
1
.
x
.
1
[
t
]
0
0
x
.
1
[
t
]
0
.
-
2
4
.
z
[
t
]
-
8
.
θ
[
t
]
+
2
0
.
(
0
.
-
1
.
6
6
9
0
3
z
[
t
]
+
6
0
.
9
7
1
1
θ
[
t
]
-
0
.
6
2
5
x
.
1
[
t
]
+
8
9
.
1
1
7
5
x
.
2
[
t
]
)
2
0
.
0
θ
[
t
]
0
.
+
1
.
x
.
2
[
t
]
0
0
x
.
2
[
t
]
0
.
-
0
.
0
6
3
6
8
4
1
z
[
t
]
-
0
.
1
1
9
4
0
8
θ
[
t
]
0
0
.
1
5
9
2
1
0
.
+
1
.
z
[
t
]
0
0
0
.
+
1
.
θ
[
t
]
0
0
The mass's position and angle are regulated with respect to non-zero initial conditions:
I
n
[
1
2
]
:
=
s
r
1
=
S
t
a
t
e
R
e
s
p
o
n
s
e
[
{
c
s
y
s
,
{
0
.
1
,
0
,
0
.
2
,
0
}
}
,
{
0
,
0
}
,
{
t
,
0
,
1
0
0
}
]
;
P
l
o
t
[
E
v
a
l
u
a
t
e
@
%
〚
{
1
,
3
}
〛
,
{
t
,
0
,
1
0
}
,
P
l
o
t
R
a
n
g
e
A
l
l
,
P
l
o
t
L
e
g
e
n
d
s
{
z
,
θ
}
]
O
u
t
[
1
2
]
=
It is also regulated to an external disturbance on its angular position:
I
n
[
1
3
]
:
=
s
r
2
=
S
t
a
t
e
R
e
s
p
o
n
s
e
c
s
y
s
,
0
,
U
n
i
t
B
o
x
t
2
-
1
,
{
t
,
0
,
1
0
0
}
;
P
l
o
t
[
E
v
a
l
u
a
t
e
@
%
〚
{
1
,
3
}
〛
,
{
t
,
0
,
1
0
}
,
P
l
o
t
R
a
n
g
e
A
l
l
,
P
l
o
t
L
e
g
e
n
d
s
{
z
,
θ
}
]
O
u
t
[
1
3
]
=
The control effort:
I
n
[
1
4
]
:
=
T
a
b
l
e
[
P
l
o
t
[
-
[
"
F
e
e
d
b
a
c
k
G
a
i
n
s
"
]
.
s
r
,
{
t
,
0
,
1
0
}
,
P
l
o
t
R
a
n
g
e
A
l
l
]
,
{
s
r
,
{
s
r
1
,
s
r
2
}
}
]
O
u
t
[
1
4
]
=
External Links
Prof. Vladimir Dobrushkin, MATHEMATICA TUTORIAL for the Second Course. Part III: Spring Pendulum
Related Symbols
StateFeedbackGains
AffineStateSpaceModel
StateSpaceModel
OutputResponse
StateResponse
Publisher Information
Contributed by:
Wolfram Controls Team