Skip to content

Commit 8748808

Browse files
committed
manual restructure
1 parent e1e6f55 commit 8748808

File tree

3 files changed

+19
-14
lines changed

3 files changed

+19
-14
lines changed

docs/src/manual/linmpc.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# [Manual](@id my_manual)
22

3-
## Linear model and controller
3+
## Linear Model
44

55
The example considers a well-stirred tank with a cold and hot water inlet as a plant. The
66
water flows out of an opening at the bottom of the tank. The manipulated inputs are the cold
@@ -38,14 +38,6 @@ the following linear model accurately describes the plant dynamics:
3838
\end{bmatrix}
3939
```
4040

41-
We want to design a predictive feedback that controls both the water level ``y_L`` and
42-
temperature ``y_T`` in the tank, at a sampling time of 4 s. The tank level should also never
43-
fall below 45:
44-
45-
```math
46-
y_L ≥ 45
47-
```
48-
4941
We first need to construct a [`LinModel`](@ref) objet with [`setop!`](@ref) to handle the
5042
operating points:
5143

@@ -58,8 +50,19 @@ model = setop!(LinModel(sys, Ts), uop=[10, 10], yop=[50, 30])
5850
```
5951

6052
The `model` object will be used for two purposes : to construct our controller, and as a
61-
plant simulator to test the design. We design our [`LinMPC`](@ref) controllers by including
62-
the level constraint with [`setconstraint!`](@ref):
53+
plant simulator to test the design.
54+
55+
## Linear Predictive Controller
56+
57+
A predictive feedback will control both the water level ``y_L`` and temperature ``y_T`` in
58+
the tank, at a sampling time of 4 s. The tank level should also never fall below 45:
59+
60+
```math
61+
y_L ≥ 45
62+
```
63+
64+
We design our [`LinMPC`](@ref) controllers by including the level constraint with
65+
[`setconstraint!`](@ref):
6366

6467
```@example 1
6568
mpc = setconstraint!(LinMPC(model, Hp=15, Hc=2), ŷmin=[45, -Inf])

docs/src/manual/nonlinmpc.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Manual
22

3-
## Nonlinear model and controller
3+
## Nonlinear Model
44

55
In this example, the goal is to control the angular position ``θ`` of a pendulum
66
attached to a motor. If the manipulated input is the motor torque ``τ``, the vectors
@@ -54,6 +54,8 @@ u = [0.5] # τ = 0.5 N m
5454
plot(sim!(model, 60, u), plotu=false)
5555
```
5656

57+
## Nonlinear Predictive Controller
58+
5759
An [`UnscentedKalmanFilter`](@ref) estimates the plant state :
5860

5961
```@example 1

example/juMPC.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ function test_mpc(model, mpc)
153153
end
154154

155155
using PlotThemes, Plots
156-
#theme(:default)
157-
theme(:dark)
156+
theme(:default)
157+
#theme(:dark)
158158
default(fontfamily="Computer Modern"); scalefontsizes(1.1)
159159

160160
test_mpc(linModel4 , mpc)

0 commit comments

Comments
 (0)