You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ext/plot.jl
+33-29Lines changed: 33 additions & 29 deletions
Original file line number
Diff line number
Diff line change
@@ -1176,61 +1176,61 @@ end
1176
1176
"""
1177
1177
$(TYPEDSIGNATURES)
1178
1178
1179
-
Plot the components of an optimal control `Solution`.
1179
+
Plot the components of an optimal control solution.
1180
1180
1181
1181
This is the main user-facing function to visualize the solution of an optimal control problem
1182
1182
solved with the control-toolbox ecosystem.
1183
1183
1184
-
It generates a plot (or set of subplots) showing the evolution of the state, control, costate,
1185
-
path constraints, and dual variables over time, depending on the user’s choices.
1184
+
It generates a set of subplots showing the evolution of the state, control, costate,
1185
+
path constraints, and dual variables over time, depending on the problem and the user’s choices.
1186
1186
1187
1187
# Arguments
1188
1188
1189
-
- `sol::CTModels.Solution`: The optimal control solution to visualize. Typically the result after solving a problem.
1189
+
- `sol::CTModels.Solution`: The optimal control solution to visualise.
1190
1190
- `description::Symbol...`: A variable number of symbols indicating which components to include in the plot. Common values include:
1191
-
- `:state` – plot the state trajectory.
1192
-
- `:costate` – plot the costate (adjoint) variables.
1193
-
- `:control` – plot the control signal.
1194
-
- `:path` – plot the values of nonlinear path constraints.
1195
-
- `:dual` – plot the dual variables (Lagrange multipliers) associated with path constraints.
1191
+
- `:state` – plot the state.
1192
+
- `:costate` – plot the costate (adjoint).
1193
+
- `:control` – plot the control.
1194
+
- `:path` – plot the path constraints.
1195
+
- `:dual` – plot the dual variables (or Lagrange multipliers) associated with path constraints.
1196
1196
1197
1197
If no symbols are provided, a default set is used based on the problem and styles.
1198
1198
1199
-
# Keyword Arguments
1199
+
# Keyword Arguments (Optional)
1200
1200
1201
1201
- `layout::Symbol = :group`: Specifies how to arrange plots.
1202
1202
- `:group`: Fewer plots, grouping similar variables together (e.g., all states in one subplot).
1203
1203
- `:split`: One plot per variable component, stacked in a layout.
1204
1204
1205
1205
- `control::Symbol = :components`: Defines how to represent control inputs.
1206
1206
- `:components`: One curve per control component.
1207
-
- `:norm`: Single curve showing ‖u(t)‖.
1207
+
- `:norm`: Single curve showing the Euclidean norm ‖u(t)‖.
1208
1208
- `:all`: Plot both components and norm.
1209
1209
1210
-
- `time::Symbol = :default`: Time normalization for plots.
1210
+
- `time::Symbol = :default`: Time normalisation for plots.
1211
1211
- `:default`: Real time scale.
1212
-
- `:normalize` or `:normalise`: Normalized to the interval [0, 1].
1212
+
- `:normalize` or `:normalise`: Normalised to the interval [0, 1].
1213
1213
1214
1214
- `solution_label::String = ""`: Label to annotate this solution in the legend. (Deprecated: use `label` instead)
1215
1215
1216
1216
## Style Options (Optional)
1217
1217
1218
-
All style-related keyword arguments can be either a `NamedTuple` of plotting attributes or the `Symbol` `:none` referring to not plot the associated element. These allow you to customize color, line style, markers, etc.
1218
+
All style-related keyword arguments can be either a `NamedTuple` of plotting attributes or the `Symbol` `:none` referring to not plot the associated element. These allow you to customise color, line style, markers, etc.
1219
1219
1220
-
- `state_style`: Plot style for state components.
1221
-
- `costate_style`: Plot style for costate components.
1222
-
- `control_style`: Plot style for control components.
1223
-
- `dual_style`: Plot style for dual variables.
1224
-
- `path_style`: Plot style for path constraint values.
1220
+
- `time_style`: Style for vertical lines at initial and final time.
1221
+
- `state_style`: Style for state components.
1222
+
- `costate_style`: Style for costate components.
1223
+
- `control_style`: Style for control components.
1224
+
- `path_style`: Style for path constraint values.
1225
+
- `dual_style`: Style for dual variables.
1225
1226
1226
1227
## Bounds Decorations (Optional)
1227
1228
1228
-
Use these options to show bounds on the plots if applicable and defined in the model. If set to `:none` then it is not shown on the plots.
1229
+
Use these options to customise bounds on the plots if applicable and defined in the model. Set to `:none` to hide.
1229
1230
1230
-
- `state_bounds_style`: Style for state variable bounds.
1231
+
- `state_bounds_style`: Style for state bounds.
1231
1232
- `control_bounds_style`: Style for control bounds.
1232
1233
- `path_bounds_style`: Style for path constraint bounds.
1233
-
- `time_style`: Style for vertical lines at initial and final time.
1234
1234
1235
1235
# Returns
1236
1236
@@ -1239,15 +1239,19 @@ Use these options to show bounds on the plots if applicable and defined in the m
0 commit comments