Skip to content

Commit c0bd006

Browse files
update
1 parent c0445c6 commit c0bd006

File tree

2 files changed

+119
-37
lines changed

2 files changed

+119
-37
lines changed

class01/Manifest.toml

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -797,9 +797,9 @@ version = "2.84.3+0"
797797

798798
[[deps.GracefulPkg]]
799799
deps = ["Compat", "Pkg", "TOML"]
800-
git-tree-sha1 = "eee0ecee0391689c354c03aadc77018ee7bb85fc"
800+
git-tree-sha1 = "698050b04f3cc0906d0817329d6e96484bf238eb"
801801
uuid = "828d9ff0-206c-6161-646e-6576656f7244"
802-
version = "2.2.1"
802+
version = "2.3.0"
803803

804804
[[deps.Graphics]]
805805
deps = ["Colors", "LinearAlgebra", "NaNMath"]
@@ -843,10 +843,10 @@ uuid = "2e76f6c2-a576-52d4-95c1-20adfe4de566"
843843
version = "8.5.1+0"
844844

845845
[[deps.HiGHS]]
846-
deps = ["HiGHS_jll", "MathOptInterface", "PrecompileTools", "SparseArrays"]
847-
git-tree-sha1 = "2aab56d4e161be93c44fc16dfc95940996f84a12"
846+
deps = ["HiGHS_jll", "MathOptIIS", "MathOptInterface", "PrecompileTools", "SparseArrays"]
847+
git-tree-sha1 = "3fae2ee8d6ea22009532d5919ff592fcbcab0ad9"
848848
uuid = "87dc4568-4c63-4d18-b0c0-bb2238e4078b"
849-
version = "1.18.2"
849+
version = "1.19.0"
850850

851851
[[deps.HiGHS_jll]]
852852
deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Zlib_jll"]
@@ -1192,9 +1192,9 @@ version = "3.1.1+0"
11921192

11931193
[[deps.JuMP]]
11941194
deps = ["LinearAlgebra", "MacroTools", "MathOptInterface", "MutableArithmetics", "OrderedCollections", "PrecompileTools", "Printf", "SparseArrays"]
1195-
git-tree-sha1 = "b4da175208e462c5b380f5b4d43dc9101d12c55c"
1195+
git-tree-sha1 = "d05a696a5abaf9d1f8bce948ee53ed1533fadfdb"
11961196
uuid = "4076af6c-e467-56ae-b986-b466b2749572"
1197-
version = "1.27.0"
1197+
version = "1.28.0"
11981198

11991199
[deps.JuMP.extensions]
12001200
JuMPDimensionalDataExt = "DimensionalData"
@@ -1459,11 +1459,17 @@ git-tree-sha1 = "f7d73634acd573bf3489df1ee0d270a5d6d3a7a3"
14591459
uuid = "736d6165-7244-6769-4267-6b50796e6954"
14601460
version = "0.1.2"
14611461

1462+
[[deps.MathOptIIS]]
1463+
deps = ["MathOptInterface"]
1464+
git-tree-sha1 = "31d4a6353ea00603104f11384aa44dd8b7162b28"
1465+
uuid = "8c4f8055-bd93-4160-a86b-a0c04941dbff"
1466+
version = "0.1.1"
1467+
14621468
[[deps.MathOptInterface]]
14631469
deps = ["BenchmarkTools", "CodecBzip2", "CodecZlib", "DataStructures", "ForwardDiff", "JSON3", "LinearAlgebra", "MutableArithmetics", "NaNMath", "OrderedCollections", "PrecompileTools", "Printf", "SparseArrays", "SpecialFunctions", "Test"]
1464-
git-tree-sha1 = "1251fce78b907fe415a2f680291b67cf51360d2a"
1470+
git-tree-sha1 = "ce5a316de39941da67730ffec38e5396f7504853"
14651471
uuid = "b8f27783-ece8-5eb3-8dc8-9495eed66fee"
1466-
version = "1.42.0"
1472+
version = "1.42.1"
14671473

14681474
[[deps.MathTeXEngine]]
14691475
deps = ["AbstractTrees", "Automa", "DataStructures", "FreeTypeAbstraction", "GeometryBasics", "LaTeXStrings", "REPL", "RelocatableFolders", "UnicodeFun"]
@@ -1767,9 +1773,9 @@ version = "0.8.21"
17671773

17681774
[[deps.PlotlyJS]]
17691775
deps = ["Base64", "Blink", "DelimitedFiles", "JSExpr", "JSON", "Kaleido_jll", "Markdown", "Pkg", "PlotlyBase", "PlotlyKaleido", "REPL", "Reexport", "Requires", "WebIO"]
1770-
git-tree-sha1 = "b816b0f301b074e002476159a9ada5691eebaf61"
1776+
git-tree-sha1 = "287e092914da6c91f002aafcf82a2ec065bf94a3"
17711777
uuid = "f0f68f2c-4968-5e81-91da-67840de0976a"
1772-
version = "0.18.16"
1778+
version = "0.18.17"
17731779

17741780
[deps.PlotlyJS.extensions]
17751781
CSVExt = "CSV"
@@ -1823,15 +1829,15 @@ version = "1.2.1"
18231829

18241830
[[deps.PlutoTeachingTools]]
18251831
deps = ["Downloads", "HypertextLiteral", "Latexify", "Markdown", "PlutoUI"]
1826-
git-tree-sha1 = "537c439831c0f8d37265efe850ee5c0d9c7efbe4"
1832+
git-tree-sha1 = "d0f6e09433d14161a24607268d89be104e743523"
18271833
uuid = "661c6b06-c737-4d37-b85c-46df65de6f69"
1828-
version = "0.4.1"
1834+
version = "0.4.4"
18291835

18301836
[[deps.PlutoUI]]
18311837
deps = ["AbstractPlutoDingetjes", "Base64", "ColorTypes", "Dates", "Downloads", "FixedPointNumbers", "Hyperscript", "HypertextLiteral", "IOCapture", "InteractiveUtils", "JSON", "Logging", "MIMEs", "Markdown", "Random", "Reexport", "URIs", "UUIDs"]
1832-
git-tree-sha1 = "ec9e63bd098c50e4ad28e7cb95ca7a4860603298"
1838+
git-tree-sha1 = "2d7662f95eafd3b6c346acdbfc11a762a2256375"
18331839
uuid = "7f904dfe-b85e-4ff6-b463-dae2292396a8"
1834-
version = "0.7.68"
1840+
version = "0.7.69"
18351841

18361842
[[deps.PolyesterWeave]]
18371843
deps = ["BitTwiddlingConvenienceFunctions", "CPUSummary", "IfElse", "Static", "ThreadingUtilities"]
@@ -2201,9 +2207,9 @@ version = "1.2.0"
22012207

22022208
[[deps.SimpleTraits]]
22032209
deps = ["InteractiveUtils", "MacroTools"]
2204-
git-tree-sha1 = "5d7e3f4e11935503d3ecaf7186eac40602e7d231"
2210+
git-tree-sha1 = "be8eeac05ec97d379347584fa9fe2f5f76795bcb"
22052211
uuid = "699a6c99-e7fa-54fc-8d76-47d257e15c1d"
2206-
version = "0.9.4"
2212+
version = "0.9.5"
22072213

22082214
[[deps.SimpleWeightedGraphs]]
22092215
deps = ["Graphs", "LinearAlgebra", "Markdown", "SparseArrays"]
@@ -2222,9 +2228,9 @@ uuid = "6462fe0b-24de-5631-8697-dd941f90decc"
22222228

22232229
[[deps.SortingAlgorithms]]
22242230
deps = ["DataStructures"]
2225-
git-tree-sha1 = "66e0a8e672a0bdfca2c3f5937efb8538b9ddc085"
2231+
git-tree-sha1 = "64d974c2e6fdf07f8155b5b2ca2ffa9069b608d9"
22262232
uuid = "a2af1166-a08f-5f64-846c-94a0d3cef48c"
2227-
version = "1.2.1"
2233+
version = "1.2.2"
22282234

22292235
[[deps.SparseArrays]]
22302236
deps = ["Libdl", "LinearAlgebra", "Random", "Serialization", "SuiteSparse_jll"]
@@ -2299,9 +2305,9 @@ version = "1.7.1"
22992305

23002306
[[deps.StatsBase]]
23012307
deps = ["AliasTables", "DataAPI", "DataStructures", "LinearAlgebra", "LogExpFunctions", "Missings", "Printf", "Random", "SortingAlgorithms", "SparseArrays", "Statistics", "StatsAPI"]
2302-
git-tree-sha1 = "b81c5035922cc89c2d9523afc6c54be512411466"
2308+
git-tree-sha1 = "2c962245732371acd51700dbb268af311bddd719"
23032309
uuid = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
2304-
version = "0.34.5"
2310+
version = "0.34.6"
23052311

23062312
[[deps.StatsFuns]]
23072313
deps = ["HypergeometricFunctions", "IrrationalConstants", "LogExpFunctions", "Reexport", "Rmath", "SpecialFunctions"]
@@ -2369,10 +2375,10 @@ uuid = "19f23fe9-fdab-4a78-91af-e7b7767979c3"
23692375
version = "0.2.2"
23702376

23712377
[[deps.SymbolicUtils]]
2372-
deps = ["AbstractTrees", "ArrayInterface", "Bijections", "ChainRulesCore", "Combinatorics", "ConstructionBase", "DataStructures", "DocStringExtensions", "DynamicPolynomials", "ExproniconLite", "LinearAlgebra", "MultivariatePolynomials", "NaNMath", "Setfield", "SparseArrays", "SpecialFunctions", "StaticArrays", "SymbolicIndexingInterface", "TaskLocalValues", "TermInterface", "TimerOutputs", "Unityper", "WeakValueDicts"]
2373-
git-tree-sha1 = "fa63e8f55e99aee528951ba26544403b09645979"
2378+
deps = ["AbstractTrees", "ArrayInterface", "Bijections", "ChainRulesCore", "Combinatorics", "ConstructionBase", "DataStructures", "DocStringExtensions", "DynamicPolynomials", "ExproniconLite", "LinearAlgebra", "MultivariatePolynomials", "NaNMath", "Setfield", "SparseArrays", "SpecialFunctions", "StaticArrays", "SymbolicIndexingInterface", "TaskLocalValues", "TermInterface", "TimerOutputs", "Unityper"]
2379+
git-tree-sha1 = "cb2beb85947c0a894efa345c436edad20ecec977"
23742380
uuid = "d1185830-fcd6-423d-90d6-eec64667417b"
2375-
version = "3.29.0"
2381+
version = "3.30.0"
23762382

23772383
[deps.SymbolicUtils.extensions]
23782384
SymbolicUtilsLabelledArraysExt = "LabelledArrays"
@@ -2384,9 +2390,9 @@ version = "3.29.0"
23842390

23852391
[[deps.Symbolics]]
23862392
deps = ["ADTypes", "ArrayInterface", "Bijections", "CommonWorldInvalidations", "ConstructionBase", "DataStructures", "DiffRules", "Distributions", "DocStringExtensions", "DomainSets", "DynamicPolynomials", "LaTeXStrings", "Latexify", "Libdl", "LinearAlgebra", "LogExpFunctions", "MacroTools", "Markdown", "NaNMath", "OffsetArrays", "PrecompileTools", "Primes", "RecipesBase", "Reexport", "RuntimeGeneratedFunctions", "SciMLBase", "Setfield", "SparseArrays", "SpecialFunctions", "StaticArraysCore", "SymbolicIndexingInterface", "SymbolicLimits", "SymbolicUtils", "TermInterface"]
2387-
git-tree-sha1 = "6eac6fe46d0e0f21baebc87d97dc118827737e05"
2393+
git-tree-sha1 = "6feaa0f2eb9728a6089ad81e31bf7539d41c8a30"
23882394
uuid = "0c5d862f-8b57-4792-8d23-62f2024744c7"
2389-
version = "6.48.1"
2395+
version = "6.49.0"
23902396

23912397
[deps.Symbolics.extensions]
23922398
SymbolicsD3TreesExt = "D3Trees"
@@ -2520,9 +2526,9 @@ version = "0.4.1"
25202526

25212527
[[deps.Unitful]]
25222528
deps = ["Dates", "LinearAlgebra", "Random"]
2523-
git-tree-sha1 = "d2282232f8a4d71f79e85dc4dd45e5b12a6297fb"
2529+
git-tree-sha1 = "6258d453843c466d84c17a58732dda5deeb8d3af"
25242530
uuid = "1986cc42-f94f-5a68-af5c-568840ba703d"
2525-
version = "1.23.1"
2531+
version = "1.24.0"
25262532
weakdeps = ["ConstructionBase", "ForwardDiff", "InverseFunctions", "Printf"]
25272533

25282534
[deps.Unitful.extensions]
@@ -2566,11 +2572,6 @@ git-tree-sha1 = "96478df35bbc2f3e1e791bc7a3d0eeee559e60e9"
25662572
uuid = "a2964d1f-97da-50d4-b82a-358c7fce9d89"
25672573
version = "1.24.0+0"
25682574

2569-
[[deps.WeakValueDicts]]
2570-
git-tree-sha1 = "98528c2610a5479f091d470967a25becfd83edd0"
2571-
uuid = "897b6980-f191-5a31-bcb0-bf3c4585e0c1"
2572-
version = "0.1.0"
2573-
25742575
[[deps.WebIO]]
25752576
deps = ["AssetRegistry", "Base64", "Distributed", "FunctionalCollections", "JSON", "Logging", "Observables", "Pkg", "Random", "Requires", "Sockets", "UUIDs", "WebSockets", "Widgets"]
25762577
git-tree-sha1 = "0eef0765186f7452e52236fa42ca8c9b3c11c6e3"

class01/class01_intro.jl

Lines changed: 85 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ end
2020
begin
2121
import Pkg
2222
Pkg.activate(".")
23+
Pkg.instantiate()
2324
# Pkg.status()
2425
using PlutoUI
2526
using Random
@@ -38,11 +39,89 @@ using ForwardDiff
3839
# ╔═╡ ec473e69-d5ec-4d6a-b868-b89dadb85705
3940
ChooseDisplayMode()
4041

42+
# ╔═╡ 1f774f46-d57d-4668-8204-dc83d50d8c94
43+
md"# Intro - Optimal Control and Learning
44+
45+
In this course, we are interested in problems with the following structure:
46+
47+
```math
48+
\begin{equation}
49+
\!\!\!\!\!\!\!\!\min_{\substack{(\mathbf y_1,\mathbf x_1)\\\mathrm{s.t.}}}
50+
\!\underset{%
51+
\phantom{\substack{(\mathbf y_1,\mathbf x_1)\\\mathrm{s.t.}}}%
52+
\!\!\!\!\!\!\!\!\!\!(\mathbf y_1,\mathbf x_1)\in\mathcal X_1(\mathbf x_0)%
53+
}{%
54+
\!\!\!\!f(\mathbf x_1,\mathbf y_1)%
55+
}
56+
+\mathbb{E}_1\Bigl[
57+
\quad \cdots
58+
59+
\;+\;\mathbb{E}_t\Bigl[
60+
\min_{\substack{(\mathbf y_t,\mathbf x_t)\\\mathrm{s.t.}}}
61+
\!\underset{%
62+
\phantom{\substack{(\mathbf y_t,\mathbf x_t)\\\mathrm{s.t.}}}%
63+
\!\!\!\!(\mathbf y_t,\mathbf x_t)\in\mathcal X_t(\mathbf x_{t-1},w_t)%
64+
}{%
65+
\!\!\!\!\!\!\!\!\!\!f(\mathbf x_t,\mathbf y_t)%
66+
}
67+
+\mathbb{E}_{t+1}[\cdots]
68+
\Bigr].
69+
\end{equation}
70+
```
71+
which minimizes a first stage cost function $f(\mathbf{x}_1,
72+
\mathbf{y}_1)$ and the expected value of future costs over possible
73+
values of the exogenous stochastic variable $\{w_{t}\}_{t=2}^{T} \in
74+
\Omega$.
75+
76+
Here, $\mathbf{x}_0$ is the initial system state and the
77+
control decisions $\mathbf{y}_t$ are obtained at every period $t$
78+
under a feasible region defined by the incoming state
79+
$\mathbf{x}_{t-1}$ and the realized uncertainty $w_t$. $\mathbf{E}_t$ represents the expected value over future uncertainties $\{w_{\tau}\}_{\tau=t}^{T}$. This
80+
optimization program assumes that the system is entirely defined by
81+
the incoming state, a common modeling choice in many frameworks (e.g.,
82+
MDPs). This is without loss of generality,
83+
since any information can be appended in the state. The system
84+
constraints can be generally posed as:
85+
86+
```math
87+
\begin{align}
88+
&\mathcal{X}_t(\mathbf{x}_{t-1}, w_t)=
89+
\begin{cases}
90+
\mathcal{T}(\mathbf{x}_{t-1}, w_t, \mathbf{y}_t) = \mathbf{x}_t \\
91+
h(\mathbf{x}_t, \mathbf{y}_t) \geq 0
92+
\end{cases}
93+
\end{align}
94+
```
95+
"
96+
97+
# ╔═╡ a0f71960-c97c-40d1-8f78-4b1860d2e0a2
98+
md"""
99+
where the outgoing state of the system $\mathbf{x}_t$ is a
100+
transformation based on the incoming state, the realized uncertainty,
101+
and the control variables. $h(\mathbf{x}_t, \mathbf{y}_t) \geq 0$
102+
captures the state constraints. Markov Decision Process (MDPs) refer
103+
to $\mathcal{T}$ as the "transition kernel" of the system. State and
104+
control variables are restricted further by additional constraints
105+
captured by $h(\mathbf{x}_t, \mathbf{y}_t) \geq 0$. We
106+
consider policies that map the past information into decisions. In
107+
period $t$, an optimal policy is given by the solution of the dynamic
108+
equations:
109+
110+
```math
111+
\begin{align}
112+
V_{t}(\mathbf{x}_{t-1}, w_t) = &\min_{\mathbf{x}_t, \mathbf{y}_t} \quad \! \! f(\mathbf{x}_t, \mathbf{y}_t) + \mathbf{E}[V_{t+1}(\mathbf{x}_t, w_{t+1})] \\
113+
& \text{ s.t. } \quad\mathbf{x}_t = \mathcal{T}(\mathbf{x}_{t-1}, w_t, \mathbf{y}_t) \nonumber \\
114+
& \quad \quad \quad \! \! h(\mathbf{x}_t, \mathbf{y}_t) \geq 0. \nonumber
115+
\end{align}
116+
```
117+
"""
118+
41119
# ╔═╡ 52005382-177b-4a11-a914-49a5ffc412a3
42-
md"# 101 (Continuous-Time) Dynamics
43-
#### A Crash Course
120+
section_outline(md"A Crash Course:",md" (Continuous-Time) Dynamics
121+
")
44122

45-
General form for a smooth system:
123+
# ╔═╡ 8ea866a6-de0f-4812-8f59-2aebec709243
124+
md"General form for a smooth system:
46125
47126
```math
48127
\dot{x} = f(x,u) \quad \text{First-Order Ordinary Differential Equation (ODE)}
@@ -56,7 +135,6 @@ u \in \mathbb{R}^{m} & \text{Control} \\
56135
\dot{x} \in \mathbb{R}^{n} & \text{Time derivative of } x \\
57136
\end{cases}
58137
```
59-
60138
"
61139

62140
# ╔═╡ 2be161cd-2d4c-4778-adca-d45f8ab05f98
@@ -951,7 +1029,10 @@ end
9511029
# ╔═╡ Cell order:
9521030
# ╟─13b12c00-6d6e-11f0-3780-a16e73360478
9531031
# ╟─ec473e69-d5ec-4d6a-b868-b89dadb85705
1032+
# ╟─1f774f46-d57d-4668-8204-dc83d50d8c94
1033+
# ╟─a0f71960-c97c-40d1-8f78-4b1860d2e0a2
9541034
# ╟─52005382-177b-4a11-a914-49a5ffc412a3
1035+
# ╟─8ea866a6-de0f-4812-8f59-2aebec709243
9551036
# ╟─2be161cd-2d4c-4778-adca-d45f8ab05f98
9561037
# ╟─b452ee52-ee33-44ad-a980-6a6e90954ee1
9571038
# ╟─9f62fae9-283c-44c3-8d69-29bfa90faf29

0 commit comments

Comments
 (0)