diff --git a/Project.toml b/Project.toml index 9634f41de..53bc22750 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "ModelPredictiveControl" uuid = "61f9bdb8-6ae4-484a-811f-bbf86720c31c" -version = "1.13.1" +version = "1.13.2" authors = ["Francis Gagnon"] [deps] @@ -24,7 +24,7 @@ SparseMatrixColorings = "0a514795-09f3-496d-8182-132a7b665d35" [compat] ControlSystemsBase = "1.18.2" DAQP = "0.6, 0.7.1" -DifferentiationInterface = "0.6.45, 0.7" +DifferentiationInterface = "0.7.11" Documenter = "1" FiniteDiff = "2" ForwardDiff = "0.10, 1" diff --git a/src/controller/nonlinmpc.jl b/src/controller/nonlinmpc.jl index 7ac5ddc75..31660bcb4 100644 --- a/src/controller/nonlinmpc.jl +++ b/src/controller/nonlinmpc.jl @@ -5,7 +5,7 @@ const DEFAULT_NONLINMPC_JACDENSE = AutoForwardDiff() const DEFAULT_NONLINMPC_JACSPARSE = AutoSparse( AutoForwardDiff(); sparsity_detector=TracerSparsityDetector(), - coloring_algorithm=GreedyColoringAlgorithm(ALL_COLORING_ORDERS), + coloring_algorithm=GreedyColoringAlgorithm(ALL_COLORING_ORDERS, postprocessing=true), ) const DEFAULT_NONLINMPC_HESSIAN = DEFAULT_NONLINMPC_JACSPARSE @@ -291,13 +291,16 @@ NonLinMPC controller with a sample time Ts = 10.0 s: AutoSparse( AutoForwardDiff(); sparsity_detector = TracerSparsityDetector(), - coloring_algorithm = GreedyColoringAlgorithm(( + coloring_algorithm = GreedyColoringAlgorithm( + ( NaturalOrder(), LargestFirst(), SmallestLast(), IncidenceDegree(), DynamicLargestFirst() - )) + ), + postprocessing = true + ) ) ``` that is, it will test many coloring orders at preparation and keep the best. This is diff --git a/src/estimator/mhe/construct.jl b/src/estimator/mhe/construct.jl index 5d7c9120a..3f43aab6f 100644 --- a/src/estimator/mhe/construct.jl +++ b/src/estimator/mhe/construct.jl @@ -5,7 +5,7 @@ const DEFAULT_NONLINMHE_JACOBIAN = AutoForwardDiff() const DEFAULT_NONLINMHE_HESSIAN = AutoSparse( AutoForwardDiff(); sparsity_detector=TracerSparsityDetector(), - coloring_algorithm=GreedyColoringAlgorithm(ALL_COLORING_ORDERS), + coloring_algorithm=GreedyColoringAlgorithm(ALL_COLORING_ORDERS, postprocessing=true), ) @doc raw""" @@ -382,13 +382,16 @@ MovingHorizonEstimator estimator with a sample time Ts = 10.0 s: AutoSparse( AutoForwardDiff(); sparsity_detector = TracerSparsityDetector(), - coloring_algorithm = GreedyColoringAlgorithm(( + coloring_algorithm = GreedyColoringAlgorithm( + ( NaturalOrder(), LargestFirst(), SmallestLast(), IncidenceDegree(), DynamicLargestFirst() - )) + ), + postprocessing = true + ) ) ``` that is, it will test many coloring orders at preparation and keep the best.