Skip to content

Commit 90f3626

Browse files
committed
Add augment=true documentation and improve mathematical notation
- Add comprehensive augment=true section in manual-flow-ocp.md - Replace simple example with harmonic oscillator (parameter in dynamics) - Document mathematical background, usage, advantages, and error handling - Use \mathrm{d} for all differentials (mathematical rigor) - Update example-control-free.md with proper differential notation - Update manual-differential-geometry.md with \mathrm{d} notation - Remove @meta Draft blocks (use global draft setting) - Restore private API documentation file
1 parent 1807948 commit 90f3626

4 files changed

Lines changed: 378 additions & 14 deletions

File tree

docs/src/api/private.md

Lines changed: 244 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,244 @@
1+
```@meta
2+
EditURL = nothing
3+
```
4+
5+
# Private API
6+
7+
This page lists **non-exported** (internal) symbols of `OptimalControl`.
8+
9+
10+
---
11+
12+
### From `OptimalControl`
13+
14+
15+
## `DescriptiveMode`
16+
17+
```@docs
18+
OptimalControl.DescriptiveMode
19+
```
20+
21+
22+
## `ExplicitMode`
23+
24+
```@docs
25+
OptimalControl.ExplicitMode
26+
```
27+
28+
29+
## `SolveMode`
30+
31+
```@docs
32+
OptimalControl.SolveMode
33+
```
34+
35+
36+
## `_DEFAULT_DISPLAY`
37+
38+
```@docs
39+
OptimalControl._DEFAULT_DISPLAY
40+
```
41+
42+
43+
## `_DEFAULT_INITIAL_GUESS`
44+
45+
```@docs
46+
OptimalControl._DEFAULT_INITIAL_GUESS
47+
```
48+
49+
50+
## `_INITIAL_GUESS_ALIASES`
51+
52+
```@docs
53+
OptimalControl._INITIAL_GUESS_ALIASES
54+
```
55+
56+
57+
## `_INITIAL_GUESS_ALIASES_ONLY`
58+
59+
```@docs
60+
OptimalControl._INITIAL_GUESS_ALIASES_ONLY
61+
```
62+
63+
64+
## `_ansi_color`
65+
66+
```@docs
67+
OptimalControl._ansi_color
68+
```
69+
70+
71+
## `_ansi_reset`
72+
73+
```@docs
74+
OptimalControl._ansi_reset
75+
```
76+
77+
78+
## `_build_components_from_routed`
79+
80+
```@docs
81+
OptimalControl._build_components_from_routed
82+
```
83+
84+
85+
## `_build_or_use_strategy`
86+
87+
```@docs
88+
OptimalControl._build_or_use_strategy
89+
```
90+
91+
92+
## `_build_partial_description`
93+
94+
```@docs
95+
OptimalControl._build_partial_description
96+
```
97+
98+
99+
## `_build_partial_tuple`
100+
101+
```@docs
102+
OptimalControl._build_partial_tuple
103+
```
104+
105+
106+
## `_build_source_tag`
107+
108+
```@docs
109+
OptimalControl._build_source_tag
110+
```
111+
112+
113+
## `_complete_components`
114+
115+
```@docs
116+
OptimalControl._complete_components
117+
```
118+
119+
120+
## `_complete_description`
121+
122+
```@docs
123+
OptimalControl._complete_description
124+
```
125+
126+
127+
## `_descriptive_action_defs`
128+
129+
```@docs
130+
OptimalControl._descriptive_action_defs
131+
```
132+
133+
134+
## `_descriptive_families`
135+
136+
```@docs
137+
OptimalControl._descriptive_families
138+
```
139+
140+
141+
## `_determine_parameter_display_strategy`
142+
143+
```@docs
144+
OptimalControl._determine_parameter_display_strategy
145+
```
146+
147+
148+
## `_explicit_or_descriptive`
149+
150+
```@docs
151+
OptimalControl._explicit_or_descriptive
152+
```
153+
154+
155+
## `_extract_action_kwarg`
156+
157+
```@docs
158+
OptimalControl._extract_action_kwarg
159+
```
160+
161+
162+
## `_extract_kwarg`
163+
164+
```@docs
165+
OptimalControl._extract_kwarg
166+
```
167+
168+
169+
## `_extract_strategy_parameters`
170+
171+
```@docs
172+
OptimalControl._extract_strategy_parameters
173+
```
174+
175+
176+
## `_has_complete_components`
177+
178+
```@docs
179+
OptimalControl._has_complete_components
180+
```
181+
182+
183+
## `_print_ansi_styled`
184+
185+
```@docs
186+
OptimalControl._print_ansi_styled
187+
```
188+
189+
190+
## `_print_component_with_param`
191+
192+
```@docs
193+
OptimalControl._print_component_with_param
194+
```
195+
196+
197+
## `_route_descriptive_options`
198+
199+
```@docs
200+
OptimalControl._route_descriptive_options
201+
```
202+
203+
204+
## `_unwrap_option`
205+
206+
```@docs
207+
OptimalControl._unwrap_option
208+
```
209+
210+
211+
## `display_ocp_configuration`
212+
213+
```@docs
214+
OptimalControl.display_ocp_configuration
215+
```
216+
217+
218+
## `get_strategy_registry`
219+
220+
```@docs
221+
OptimalControl.get_strategy_registry
222+
```
223+
224+
225+
## `solve_descriptive`
226+
227+
```@docs
228+
OptimalControl.solve_descriptive
229+
```
230+
231+
232+
## `solve_explicit`
233+
234+
```@docs
235+
OptimalControl.solve_explicit
236+
```
237+
238+
239+
## `will_solver_print`
240+
241+
```@docs
242+
OptimalControl.will_solver_print
243+
```
244+

docs/src/example-control-free.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Consider a system with exponential growth:
2626
where $\lambda$ is an unknown growth rate parameter. We have observed data with some perturbations and want to estimate $\lambda$ by minimizing the squared error:
2727

2828
```math
29-
\min_{\lambda} \int_0^{2} (x(t) - x_{\text{obs}}(t))^2 \, dt
29+
\min_{\lambda} \int_0^{2} (x(t) - x_{\text{obs}}(t))^2 \, \mathrm{d}t
3030
```
3131

3232
The underlying model has $\lambda = 0.5$, but the observed data includes perturbations.
@@ -94,17 +94,17 @@ To handle the variable parameter $\lambda$, we treat it as an additional state w
9494

9595
```math
9696
\begin{aligned}
97-
\frac{dx}{dt} &= \frac{\partial H}{\partial p} = \lambda x \\
98-
\frac{d\lambda}{dt} &= 0 \quad \text{(constant parameter)} \\
99-
\frac{dp}{dt} &= -\frac{\partial H}{\partial x} = -p\lambda + 2(x - x_{\text{obs}}(t)) \\
100-
\frac{dp_\lambda}{dt} &= -\frac{\partial H}{\partial \lambda} = -px
97+
\frac{\mathrm{d}x}{\mathrm{d}t} &= \frac{\partial H}{\partial p} = \lambda x \\
98+
\frac{\mathrm{d}\lambda}{\mathrm{d}t} &= 0 \quad \text{(constant parameter)} \\
99+
\frac{\mathrm{d}p}{\mathrm{d}t} &= -\frac{\partial H}{\partial x} = -p\lambda + 2(x - x_{\text{obs}}(t)) \\
100+
\frac{\mathrm{d}p_\lambda}{\mathrm{d}t} &= -\frac{\partial H}{\partial \lambda} = -px
101101
\end{aligned}
102102
```
103103

104104
The transversality condition for the variable parameter requires $p_\lambda(t_f) - p_\lambda(t_0) = 0$. Assuming $p_\lambda(t_0) = 0$, we have to satisfy:
105105

106106
```math
107-
p_\lambda(t_f) = -\int_{t_0}^{t_f} \frac{\partial H}{\partial \lambda}(t, x(t), p(t), \lambda) \, dt = 0
107+
p_\lambda(t_f) = -\int_{t_0}^{t_f} \frac{\partial H}{\partial \lambda}(t, x(t), p(t), \lambda) \, \mathrm{d}t = 0
108108
```
109109

110110
We use CTFlows' `augment=true` feature to automatically compute $p_\lambda(t_f)$ without manually constructing the augmented system.
@@ -271,12 +271,12 @@ To handle the variable parameter $\omega$, we treat it as an additional state wi
271271

272272
```math
273273
\begin{aligned}
274-
\frac{dq}{dt} &= \frac{\partial H}{\partial p_1} = v \\
275-
\frac{dv}{dt} &= \frac{\partial H}{\partial p_2} = -\omega^2 q \\
276-
\frac{d\omega}{dt} &= 0 \quad \text{(constant parameter)} \\
277-
\frac{dp_1}{dt} &= -\frac{\partial H}{\partial q} = \omega^2 p_2 \\
278-
\frac{dp_2}{dt} &= -\frac{\partial H}{\partial v} = -p_1 \\
279-
\frac{dp_\omega}{dt} &= -\frac{\partial H}{\partial \omega} = 2\omega q p_2
274+
\frac{\mathrm{d}q}{\mathrm{d}t} &= \frac{\partial H}{\partial p_1} = v \\
275+
\frac{\mathrm{d}v}{\mathrm{d}t} &= \frac{\partial H}{\partial p_2} = -\omega^2 q \\
276+
\frac{\mathrm{d}\omega}{\mathrm{d}t} &= 0 \quad \text{(constant parameter)} \\
277+
\frac{\mathrm{d}p_1}{\mathrm{d}t} &= -\frac{\partial H}{\partial q} = \omega^2 p_2 \\
278+
\frac{\mathrm{d}p_2}{\mathrm{d}t} &= -\frac{\partial H}{\partial v} = -p_1 \\
279+
\frac{\mathrm{d}p_\omega}{\mathrm{d}t} &= -\frac{\partial H}{\partial \omega} = 2\omega q p_2
280280
\end{aligned}
281281
```
282282

@@ -289,7 +289,7 @@ p_\omega(t_f) - p_\omega(t_0)= -\frac{\partial g}{\partial \omega} = -2\omega
289289
Assuming $p_\omega(t_0) = 0$, we have:
290290

291291
```math
292-
p_\omega(t_f) = -\int_{t_0}^{t_f} \frac{\partial H}{\partial \omega}(t, x(t), p(t), \omega) \, dt = -2\omega
292+
p_\omega(t_f) = -\int_{t_0}^{t_f} \frac{\partial H}{\partial \omega}(t, x(t), p(t), \omega) \, \mathrm{d}t = -2\omega
293293
```
294294

295295
We use CTFlows' `augment=true` feature to automatically compute $p_\omega(t_f)$ without manually constructing the augmented system:

docs/src/manual-differential-geometry.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ dg(3, [1, 2], [4, 5])
607607
For a non-autonomous Hamiltonian $H(t, x, p)$ and a function $G(t, x, p)$, the **total time derivative** along the Hamiltonian flow is:
608608

609609
```math
610-
\frac{d}{dt} G(t, x(t), p(t)) = \partial_t G + \{H, G\}.
610+
\frac{\mathrm{d}}{\mathrm{d}t} G(t, x(t), p(t)) = \partial_t G + \{H, G\}.
611611
```
612612

613613
This is the sum of:

0 commit comments

Comments
 (0)