@@ -3,7 +3,7 @@ Abstract supertype of all predictive controllers.
33
44---
55
6- (mpc::PredictiveController)(ry, d=Float64 []; kwargs...)
6+ (mpc::PredictiveController)(ry, d=[]; kwargs...)
77
88Functor allowing callable `PredictiveController` object as an alias for [`moveinput!`](@ref).
99
@@ -50,7 +50,7 @@ struct ControllerConstraint
5050end
5151
5252@doc raw """
53- setconstraint!(mpc::PredictiveController; <keyword arguments>)
53+ setconstraint!(mpc::PredictiveController; <keyword arguments>) -> mpc
5454
5555Set the constraint parameters of `mpc` predictive controller.
5656
@@ -241,7 +241,7 @@ setnonlincon!(::PredictiveController, ::SimModel) = nothing
241241 moveinput!(
242242 mpc::PredictiveController,
243243 ry = mpc.estim.model.yop,
244- d = Float64 [];
244+ d = [];
245245 R̂y = repeat(ry, mpc.Hp),
246246 D̂ = repeat(d, mpc.Hp),
247247 ym = nothing
@@ -277,7 +277,7 @@ julia> ry = [5]; u = moveinput!(mpc, ry); round.(u, digits=3)
277277function moveinput! (
278278 mpc:: PredictiveController ,
279279 ry:: Vector = mpc. estim. model. yop,
280- d :: Vector = Float64[] ;
280+ d :: Vector = empty (mpc . estim . x̂) ;
281281 R̂y:: Vector = repeat (ry, mpc. Hp),
282282 D̂ :: Vector = repeat (d, mpc. Hp),
283283 ym:: Union{Vector, Nothing} = nothing
@@ -357,22 +357,22 @@ Set the estimate at `mpc.estim.x̂`.
357357setstate! (mpc:: PredictiveController , x̂) = (setstate! (mpc. estim, x̂); return mpc)
358358
359359@doc raw """
360- initstate!(mpc::PredictiveController, u, ym, d=Float64 [])
360+ initstate!(mpc::PredictiveController, u, ym, d=[]) -> x̂
361361
362362Init the states of `mpc.estim` [`StateEstimator`](@ref) and warm start `mpc.ΔŨ` at zero.
363363"""
364- function initstate! (mpc:: PredictiveController , u, ym, d= Float64[] )
364+ function initstate! (mpc:: PredictiveController , u, ym, d= empty (mpc . estim . x̂) )
365365 mpc. ΔŨ .= 0
366366 return initstate! (mpc. estim, u, ym, d)
367367end
368368
369369
370370"""
371- updatestate!(mpc::PredictiveController, u, ym, d=Float64 []) -> x̂
371+ updatestate!(mpc::PredictiveController, u, ym, d=[]) -> x̂
372372
373373Call [`updatestate!`](@ref) on `mpc.estim` [`StateEstimator`](@ref).
374374"""
375- updatestate! (mpc:: PredictiveController , u, ym, d= Float64[] ) = updatestate! (mpc. estim,u,ym,d)
375+ updatestate! (mpc:: PredictiveController , u, ym, d= empty (mpc . estim . x̂) ) = updatestate! (mpc. estim,u,ym,d)
376376updatestate! (:: PredictiveController , _ ) = throw (ArgumentError (" missing measured outputs ym" ))
377377
378378function validate_setpointdist (mpc:: PredictiveController , ry, d, R̂y, D̂)
@@ -1051,7 +1051,7 @@ end
10511051" Functor allowing callable `PredictiveController` object as an alias for `moveinput!`."
10521052function (mpc:: PredictiveController )(
10531053 ry:: Vector = mpc. estim. model. yop,
1054- d :: Vector = Float64[] ;
1054+ d :: Vector = empty (mpc . estim . x̂) ;
10551055 kwargs...
10561056)
10571057 return moveinput! (mpc, ry, d; kwargs... )
0 commit comments