@@ -201,7 +201,7 @@ arguments.
201201julia> model = LinModel([tf(3, [30, 1]); tf(-2, [5, 1])], 4);
202202
203203julia> mpc = LinMPC(model, Mwt=[0, 1], Nwt=[0.5], Hp=30, Hc=1)
204- LinMPC{SteadyKalmanFilter} controller with a sample time Ts = 4.0 s and:
204+ LinMPC controller with a sample time Ts = 4.0 s, SteadyKalmanFilter estimator and:
205205 1 manipulated inputs u
206206 4 states x̂
207207 2 measured outputs ym
@@ -229,7 +229,7 @@ Use custom state estimator `estim` to construct `LinMPC`.
229229julia> estim = KalmanFilter(LinModel([tf(3, [30, 1]); tf(-2, [5, 1])], 4), i_ym=[2]);
230230
231231julia> mpc = LinMPC(estim, Mwt=[0, 1], Nwt=[0.5], Hp=30, Hc=1)
232- LinMPC{KalmanFilter} controller with a sample time Ts = 4.0 s and:
232+ LinMPC controller with a sample time Ts = 4.0 s, KalmanFilter estimator and:
233233 1 manipulated inputs u
234234 3 states x̂
235235 1 measured outputs ym
@@ -413,7 +413,15 @@ default arguments.
413413
414414# Examples
415415```jldoctest
416- julia> a = 1;
416+ julia> model = NonLinModel((x,u,_)->0.5x+u, (x,_)->2x, 10, 1, 1, 1);
417+
418+ julia> mpc = NonLinMPC(model, Hp=20, Hc=1, Cwt=1e6)
419+ NonLinMPC controller with a sample time Ts = 10.0 s, UnscentedKalmanFilter{NonLinModel} estimator and:
420+ 1 manipulated inputs u
421+ 2 states x̂
422+ 1 measured outputs ym
423+ 0 unmeasured outputs yu
424+ 0 measured disturbances d
417425```
418426
419427# Extended Help
@@ -431,7 +439,17 @@ Use custom state estimator `estim` to construct `NonLinMPC`.
431439
432440# Examples
433441```jldoctest
434- julia> a = 1;
442+ julia> model = NonLinModel((x,u,_)->0.5x+u, (x,_)->2x, 10, 1, 1, 1);
443+
444+ julia> estim = UnscentedKalmanFilter(model, σQ_int=[0.05]);
445+
446+ julia> mpc = NonLinMPC(estim, Hp=20, Hc=1, Cwt=1e6)
447+ NonLinMPC controller with a sample time Ts = 10.0 s, UnscentedKalmanFilter{NonLinModel} estimator and:
448+ 1 manipulated inputs u
449+ 2 states x̂
450+ 1 measured outputs ym
451+ 0 unmeasured outputs yu
452+ 0 measured disturbances d
435453```
436454"""
437455function NonLinMPC (
@@ -1209,8 +1227,8 @@ repeatdiag(A, n::Int) = kron(I(n), A)
12091227
12101228
12111229function Base. show (io:: IO , mpc:: PredictiveController )
1212- println (io, " $(typeof (mpc)) controller with a sample time " *
1213- " Ts = $(mpc. estim. model. Ts) s and:" )
1230+ println (io, " $(typeof (mpc). name . name ) controller with a sample time " *
1231+ " Ts = $(mpc. estim. model. Ts) s, $( typeof (mpc) . parameters[ 1 ]) estimator and:" )
12141232 println (io, " $(mpc. estim. model. nu) manipulated inputs u" )
12151233 println (io, " $(mpc. estim. nx̂) states x̂" )
12161234 println (io, " $(mpc. estim. nym) measured outputs ym" )
0 commit comments