Skip to content

Commit 9d25ef2

Browse files
committed
minor doc correction
1 parent 85e4ac8 commit 9d25ef2

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

docs/src/manual/nonlinmpc.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,6 @@ satisfactory:
130130

131131
```@example 1
132132
res_yd = sim!(nmpc, N, [180.0], plant=plant, x0=[π, 0], x̂0=[π, 0, 0], y_step=[10])
133-
using BenchmarkTools
134-
@btime sim!(nmpc, N, [180.0], plant=plant, x0=[π, 0], x̂0=[π, 0, 0], y_step=[10])
135133
plot(res_yd)
136134
savefig(ans, "plot4_NonLinMPC.svg"); nothing # hide
137135
```
@@ -142,7 +140,7 @@ savefig(ans, "plot4_NonLinMPC.svg"); nothing # hide
142140

143141
Nonlinear MPC are more computationally expensive than [`LinMPC`](@ref). Solving the problem
144142
should always be faster than the sampling time ``T_s = 0.1`` s for real-time operation. For
145-
electronic and mechanical systems like here, this requirement is sometimes harder to achieve
143+
electronic or mechanical systems like here, this requirement is sometimes harder to achieve
146144
because of their fast dynamics. To ease the design and comparison with [`LinMPC`](@ref), the
147145
[`linearize`](@ref) function allows automatic linearization of [`NonLinModel`](@ref) based
148146
on [`ForwardDiff.jl`](https://juliadiff.org/ForwardDiff.jl/stable/). We first linearize
@@ -155,7 +153,7 @@ linmodel = linearize(model, x=[π, 0], u=[0])
155153

156154
It is worth mentionning that the Euler method in `model` object is not the best choice for
157155
linearization since its accuracy is low (i.e. approximation of a bad approximation). A
158-
[`SteadyKalmanFilter`](@ref) and a [`LinMPC`](@ref) is designed from `linmodel`:
156+
[`SteadyKalmanFilter`](@ref) and a [`LinMPC`](@ref) are designed from `linmodel`:
159157

160158
```@example 1
161159
kf = SteadyKalmanFilter(linmodel; σQ, σR, nint_u, σQint_u)
@@ -201,8 +199,6 @@ does improve the rejection of the step disturbance:
201199

202200
```@example 1
203201
res_lin2 = sim!(mpc2, N, [180.0]; plant, x0=[π, 0], y_step=[10])
204-
using BenchmarkTools
205-
@btime sim!(mpc2, N, [180.0]; plant, x0=[π, 0], y_step=[10])
206202
plot(res_lin2)
207203
savefig(ans, "plot6_NonLinMPC.svg"); nothing # hide
208204
```
@@ -211,7 +207,7 @@ savefig(ans, "plot6_NonLinMPC.svg"); nothing # hide
211207

212208
The performance is still lower than the nonlinear controller, as expected, but computations
213209
are about 2000 times faster (0.00002 s versus 0.04 s per time steps on average). Note that
214-
`linmodel` is only valid for angular position near 180°. Multiple linearized models and
210+
`linmodel` is only valid for angular positions near 180°. Multiple linearized models and
215211
controllers are required for large deviations from this operating point. This is known as
216212
gain scheduling.
217213

0 commit comments

Comments
 (0)