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
LQRegulatorGains
AffineStateSpaceModel
OutputResponse
StateResponse
Related Categories
Control Systems
Engineering
Physics
System Modeling
Levitate a Ball about a Nominal Position
Design a control system for an electromagnet
Example Notebook
Open in Cloud
Download Notebook
The magnetic field generated by the electromagnet is controlled by the voltage input v.
S
e
t
u
p
t
h
e
e
q
u
a
t
i
o
n
s
t
h
a
t
d
e
s
c
r
i
b
e
t
h
e
e
l
e
c
t
r
o
m
a
g
n
e
t
i
c
l
e
v
i
t
a
t
i
o
n
o
f
a
m
e
t
a
l
b
a
l
l
,
u
s
i
n
g
t
h
e
f
o
l
l
o
w
i
n
g
v
a
r
i
a
b
l
e
s
:
v
i
n
p
u
t
v
o
l
t
a
g
e
r
c
o
i
l
r
e
s
i
s
t
a
n
c
e
l
i
n
d
u
c
t
a
n
c
e
o
f
c
o
i
l
i
c
o
i
l
c
u
r
r
e
n
t
c
m
a
g
n
e
t
i
c
f
o
r
c
e
c
o
n
s
t
a
n
t
m
b
a
l
l
m
a
s
s
k
m
a
g
n
e
t
i
c
c
o
n
s
t
a
n
t
g
g
r
a
v
i
t
y
a
c
c
e
l
e
r
a
t
i
o
n
x
p
o
s
i
t
i
o
n
o
f
b
a
l
l
x
0
b
a
l
l
n
o
m
i
n
a
l
p
o
s
i
t
i
o
n
I
n
[
1
]
:
=
e
q
n
s
=
m
′
′
x
[
t
]
g
m
-
k
2
i
[
t
]
2
x
[
t
]
,
v
[
t
]
r
i
[
t
]
+
l
′
i
[
t
]
;
A set of numerical values for the model parameters:
I
n
[
2
]
:
=
p
a
r
s
=
{
r
1
0
,
m
0
.
0
5
,
k
1
,
l
0
.
0
5
,
g
9
.
8
,
x
0
0
.
5
}
;
Solve for the value of
x
0
=
0
.
5
:
I
n
[
3
]
:
=
i
0
=
x
0
m
g
k
,
v
0
=
r
x
0
m
g
k
/
.
p
a
r
s
O
u
t
[
3
]
=
{
0
.
3
5
,
3
.
5
}
An affine state space model of the system:
I
n
[
4
]
:
=
a
s
s
m
=
A
f
f
i
n
e
S
t
a
t
e
S
p
a
c
e
M
o
d
e
l
[
e
q
n
s
,
{
{
x
[
t
]
,
x
0
}
,
x
'
[
t
]
,
{
i
[
t
]
,
i
0
}
}
,
{
{
v
[
t
]
,
v
0
}
}
,
x
[
t
]
,
t
]
/
.
p
a
r
s
O
u
t
[
4
]
=
{
x
[
t
]
,
0
.
5
}
x
.
1
[
t
]
0
x
.
1
[
t
]
2
0
.
0
.
4
9
-
2
i
[
t
]
2
x
[
t
]
0
{
i
[
t
]
,
0
.
3
5
}
-
2
0
.
(
-
3
.
5
+
1
0
i
[
t
]
)
2
0
.
x
[
t
]
0
The balls falls down without feedback control:
I
n
[
5
]
:
=
O
u
t
p
u
t
R
e
s
p
o
n
s
e
[
{
a
s
s
m
,
{
R
a
n
d
o
m
I
n
t
e
g
e
r
[
{
1
,
1
0
}
]
,
0
,
0
}
}
,
0
,
{
t
,
0
,
5
}
]
;
P
l
o
t
[
%
,
{
t
,
0
,
5
}
]
O
u
t
[
5
]
=
Set the voltage as the sole feedback input:
I
n
[
6
]
:
=
s
s
p
e
c
=
"
I
n
p
u
t
M
o
d
e
l
"
A
f
f
i
n
e
S
t
a
t
e
S
p
a
c
e
M
o
d
e
l
[
a
s
s
m
,
A
u
t
o
m
a
t
i
c
,
A
u
t
o
m
a
t
i
c
,
A
u
t
o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t
,
0
,
2
}
,
p
l
o
t
O
p
t
s
O
u
t
[
9
]
=
The velocity of the ball and current of the electromagnet:
I
n
[
1
0
]
:
=
T
a
b
l
e
P
l
o
t
j
1
,
{
t
,
0
,
2
}
,
p
l
o
t
O
p
t
s
,
{
j
,
T
h
r
e
a
d
[
{
s
r
〚
2
;
;
3
〛
,
{
x
'
,
i
}
}
]
}
O
u
t
[
1
0
]
=
Obtain the controller model:
I
n
[
1
1
]
:
=
c
m
=
[
"
C
o
n
t
r
o
l
l
e
r
M
o
d
e
l
"
]
O
u
t
[
1
1
]
=
(
1
.
u
.
1
+
1
.
(
-
7
.
0
0
1
0
6
-
0
.
6
2
8
3
0
7
i
+
1
4
.
4
4
1
9
x
+
2
.
3
1
0
8
8
x
.
1
)
)
The control effort:
I
n
[
1
2
]
:
=
O
u
t
p
u
t
R
e
s
p
o
n
s
e
[
c
m
,
J
o
i
n
[
{
0
}
,
s
r
]
,
{
t
,
0
,
2
}
]
;
P
l
o
t
[
%
,
{
t
,
0
,
2
}
,
P
l
o
t
R
a
n
g
e
A
l
l
]
O
u
t
[
1
2
]
=
Related Symbols
LQRegulatorGains
AffineStateSpaceModel
OutputResponse
StateResponse
Publisher Information
Contributed by:
Wolfram Controls Team