-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathModelPredictiveControl.jl
More file actions
61 lines (50 loc) · 2.15 KB
/
ModelPredictiveControl.jl
File metadata and controls
61 lines (50 loc) · 2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
module ModelPredictiveControl
using PrecompileTools
using LinearAlgebra
using Random: randn
using RecipesBase
using ProgressLogging
using DifferentiationInterface: ADTypes.AbstractADType, AutoForwardDiff, AutoSparse
using DifferentiationInterface: gradient!, jacobian!, prepare_gradient, prepare_jacobian
using DifferentiationInterface: value_and_gradient!, value_and_jacobian!
using DifferentiationInterface: Constant, Cache
using SparseConnectivityTracer: TracerSparsityDetector
using SparseMatrixColorings: GreedyColoringAlgorithm, sparsity_pattern
import ForwardDiff
import ControlSystemsBase
import ControlSystemsBase: ss, tf, delay
import ControlSystemsBase: Continuous, Discrete
import ControlSystemsBase: StateSpace, TransferFunction, DelayLtiSystem, LTISystem
import ControlSystemsBase: iscontinuous, isdiscrete, sminreal, minreal, c2d, d2c
import JuMP
import JuMP: MOIU, MOI, GenericModel, Model, optimizer_with_attributes, register
import JuMP: @variable, @operator, @constraint, @objective
import OSQP, Ipopt
export SimModel, LinModel, NonLinModel
export DiffSolver, RungeKutta, ForwardEuler
export setop!, setname!
export setstate!, setmodel!, preparestate!, updatestate!, evaloutput, linearize, linearize!
export savetime!, periodsleep
export StateEstimator, InternalModel, Luenberger
export SteadyKalmanFilter, KalmanFilter, UnscentedKalmanFilter, ExtendedKalmanFilter
export MovingHorizonEstimator
export ManualEstimator
export default_nint, initstate!
export PredictiveController, ExplicitMPC, LinMPC, NonLinMPC, setconstraint!, moveinput!
export TranscriptionMethod, SingleShooting, MultipleShooting
export SimResult, getinfo, sim!
include("general.jl")
include("sim_model.jl")
include("state_estim.jl")
include("predictive_control.jl")
include("plot_sim.jl")
@setup_workload begin
# Putting some things in `@setup_workload` instead of `@compile_workload` can reduce the
# size of the precompile file and potentially make loading faster.
@compile_workload begin
# all calls in this block will be precompiled, regardless of whether
# they belong to your package or not (on Julia 1.8 and higher)
include("precompile.jl")
end
end
end