Skip to content

added: multiple shooting transcription for LinMPC and NonLinMPC #155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 48 commits into from
Feb 28, 2025
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
40570bf
doc: transcription argument
franckgaga Jan 20, 2025
2bc4513
doc: adding info about `NonLinMPC` decision vars
franckgaga Jan 22, 2025
97a3176
Merge branch 'main' into multiple_shooting
franckgaga Feb 2, 2025
c7d7dc8
changed: support multiple shooting in the input conversion matrices
franckgaga Feb 2, 2025
fa386ac
starting `init_predmat` modifications for multiple shooting
franckgaga Feb 2, 2025
1b41286
Merge branch 'main' into multiple_shooting
franckgaga Feb 6, 2025
70de7b6
Merge remote-tracking branch 'origin/main' into multiple_shooting
franckgaga Feb 6, 2025
fa445c7
doc: equations for defects equation and matrices
franckgaga Feb 6, 2025
c37e3d8
doc: change name function
franckgaga Feb 6, 2025
6e2ef10
debug
franckgaga Feb 7, 2025
de9d767
doc: debug latex equation
franckgaga Feb 10, 2025
9e41dfe
added: `Transcription` abstract type
franckgaga Feb 12, 2025
c18cf3b
cont. multiple shooting method
franckgaga Feb 12, 2025
40d1251
Merge branch 'main' into multiple_shooting
franckgaga Feb 15, 2025
098d709
Merge branch 'main' into multiple_shooting
franckgaga Feb 16, 2025
38e051e
test: `verbose` option with `@run_package_tests`
franckgaga Feb 16, 2025
b9a2056
wip multiple shooting
franckgaga Feb 16, 2025
b42e6ab
wip: multiple shooting
franckgaga Feb 17, 2025
0f95475
wip: multiple shooting method
franckgaga Feb 17, 2025
dd15601
debug: `init_defectmat` correct `Eŝ` matrix
franckgaga Feb 17, 2025
918dacd
Merge branch 'main' into multiple_shooting
franckgaga Feb 18, 2025
303c018
wip: multiple shooting transcription
franckgaga Feb 23, 2025
affb5db
wip: multiple shooting transcription
franckgaga Feb 23, 2025
ac38d81
wip: multiple shooting transcription
franckgaga Feb 23, 2025
3db0f96
wip: multiple shooting transcription
franckgaga Feb 23, 2025
8e7b41f
`MultipleShooting` with `LinMPC` starts to work 🎉
franckgaga Feb 24, 2025
a79a42b
remove useless print
franckgaga Feb 24, 2025
65f409b
added: `NonLinMPC` with `LinModel` works with `MultipleShooting`
franckgaga Feb 24, 2025
6d9b296
changed: cleaning up `Project.toml` files
franckgaga Feb 24, 2025
a5bdab5
doc: cleanup transcription method documentation
franckgaga Feb 24, 2025
6601bda
debug: `ExplicitMPC` updates with transcription methods
franckgaga Feb 25, 2025
9c500a3
Merge remote-tracking branch 'origin/main' into multiple_shooting
franckgaga Feb 26, 2025
91b8d46
doc: add prediction matrices for `MultipleShooting`
franckgaga Feb 26, 2025
e6ba1ef
changed: rename conversion matrices to avoid confusion with defect ve…
franckgaga Feb 26, 2025
5339531
changed: conversion matrices with lower case 'u' for readability
franckgaga Feb 26, 2025
dc2a634
doc: additional details
franckgaga Feb 26, 2025
4fd1054
doc: minor improvements
franckgaga Feb 26, 2025
af8de3b
debug: `getinfo!` correct output predictions MPC
franckgaga Feb 26, 2025
b7c919f
debug: `predict` now works
franckgaga Feb 26, 2025
3efa9c4
doc: minor details
franckgaga Feb 27, 2025
7d03630
debug: `predict!` for `NonLinModel` and `MultipleShooting` now works
franckgaga Feb 27, 2025
cf21adb
debug: `MovingHorizonEstimator` force simulation update at first call…
franckgaga Feb 27, 2025
f2a50ea
added: `MultipleShooting` with `NonLinModel` is working 🍾
franckgaga Feb 27, 2025
ccecf56
changed: store `T_lastu0` instead of `T_lastu`
franckgaga Feb 27, 2025
0c1c064
debug: `getinfo` now works
franckgaga Feb 28, 2025
7b3fbac
debug: `ExplicitMPC` method `predict!`
franckgaga Feb 28, 2025
d889314
bump
franckgaga Feb 28, 2025
a868fc4
test: `LinMPC` construction test with `MultipleShooting`
franckgaga Feb 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,34 @@ authors = ["Francis Gagnon"]
version = "1.3.5"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
ControlSystemsBase = "aaaaaaaa-a6ca-5380-bf3e-84a91bcd477e"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
Ipopt = "b6b21f68-93f8-5de0-b562-5493be1d77c9"
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
OSQP = "ab2f91bb-94b4-55e3-9ba0-7f65df51de79"
PreallocationTools = "d236fae5-4411-538c-8e31-a6e3d9e00b46"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
ProgressLogging = "33c8b6b6-d38a-422a-b730-caa89a2f386c"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"

[compat]
julia = "1.10"
LinearAlgebra = "1.10"
Logging = "1.10"
Random = "1.10"
ControlSystemsBase = "1.9"
ForwardDiff = "0.10"
Ipopt = "1"
JuMP = "1.21"
LinearAlgebra = "1.6"
OSQP = "0.8"
PreallocationTools = "0.4.14"
PrecompileTools = "1"
ProgressLogging = "0.1"
Random = "1.6"
RecipesBase = "1"
TestItemRunner = "1.1"
julia = "1.10"

[extras]
DAQP = "c47d62df-3981-49c8-9651-128b1cd08617"
Expand Down
10 changes: 5 additions & 5 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
ControlSystemsBase = "aaaaaaaa-a6ca-5380-bf3e-84a91bcd477e"
DAQP = "c47d62df-3981-49c8-9651-128b1cd08617"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"

[compat]
LinearAlgebra = "1.10"
Logging = "1.10"
ControlSystemsBase = "1"
DAQP = "0.5"
Documenter = "1"
JuMP = "1"
LinearAlgebra = "1.6"
Logging = "1.6"
DAQP = "0.6"
Plots = "1"
ModelingToolkit = "9.50"
7 changes: 6 additions & 1 deletion docs/src/internals/predictive_control.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,32 @@ The prediction methodology of this module is mainly based on Maciejowski textboo
## Controller Construction

```@docs
ModelPredictiveControl.init_ΔUtoU
ModelPredictiveControl.init_ZtoΔU
ModelPredictiveControl.init_ZtoU
ModelPredictiveControl.init_predmat
ModelPredictiveControl.init_defectmat
ModelPredictiveControl.relaxU
ModelPredictiveControl.relaxΔU
ModelPredictiveControl.relaxŶ
ModelPredictiveControl.relaxterminal
ModelPredictiveControl.init_quadprog
ModelPredictiveControl.init_stochpred
ModelPredictiveControl.init_matconstraint_mpc
ModelPredictiveControl.init_nonlincon!
```

## Update Quadratic Optimization

```@docs
ModelPredictiveControl.initpred!(::PredictiveController, ::LinModel, ::Any, ::Any, ::Any, ::Any)
ModelPredictiveControl.linconstraint!(::PredictiveController, ::LinModel)
ModelPredictiveControl.linconstrainteq!
```

## Solve Optimization Problem

```@docs
ModelPredictiveControl.optim_objective!(::PredictiveController)
ModelPredictiveControl.set_warmstart!
ModelPredictiveControl.getinput
```
20 changes: 20 additions & 0 deletions docs/src/public/predictive_control.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,23 @@ NonLinMPC
```@docs
moveinput!
```

## Direct Transcription Methods

### TranscriptionMethod

```@docs
ModelPredictiveControl.TranscriptionMethod
```

### SingleShooting

```@docs
SingleShooting
```

### MultipleShooting

```@docs
MultipleShooting
```
1 change: 1 addition & 0 deletions src/ModelPredictiveControl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export SteadyKalmanFilter, KalmanFilter, UnscentedKalmanFilter, ExtendedKalmanFi
export MovingHorizonEstimator
export default_nint, initstate!
export PredictiveController, ExplicitMPC, LinMPC, NonLinMPC, setconstraint!, moveinput!
export SingleShooting, MultipleShooting
export SimResult, getinfo, sim!

include("general.jl")
Expand Down
Loading