Skip to content

Commit 54e5a6f

Browse files
baggepinnenclaude
andcommitted
docs: fix wrapper name in MTK example prose
The prose referred to `discrete_dynamics_mtk` but the code defines the wrapper as `discrete_dynamics_wrapper`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 49e8a04 commit 54e5a6f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎docs/src/examples/modelingtoolkit.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ We then specify the inputs and outputs of this model, since they are arrays in t
5858
```math
5959
\dot x = f(x, u, p, t)
6060
```
61-
from MTK, we call `ModelingToolkit.generate_control_function`. This example assumes that the system model has an external input, ``u``. If your example does not have this, you may leave this argument empty. This returns two versions of this function, where the second one operates in place (modifying its first argument). This function also returns the state variables chosen, the parameters of the model as well as a simplified system with inputs and outputs. The function returned from `ModelingToolkit.generate_control_function` expects all the parameters of the system to be provided, but we only want to optimize a few of them. We thus wrap this function in `discrete_dynamics_mtk` in order to insert the optimized parameters into a parameter array that contains also the non-optimized parameters. We make use of the function `similar` to ensure that the final parameter array has the correct type (Dual numbers for AD will be used).
61+
from MTK, we call `ModelingToolkit.generate_control_function`. This example assumes that the system model has an external input, ``u``. If your example does not have this, you may leave this argument empty. This returns two versions of this function, where the second one operates in place (modifying its first argument). This function also returns the state variables chosen, the parameters of the model as well as a simplified system with inputs and outputs. The function returned from `ModelingToolkit.generate_control_function` expects all the parameters of the system to be provided, but we only want to optimize a few of them. We thus wrap this function in `discrete_dynamics_wrapper` in order to insert the optimized parameters into a parameter array that contains also the non-optimized parameters. We make use of the function `similar` to ensure that the final parameter array has the correct type (Dual numbers for AD will be used).
6262

6363
For good performance, we wrap all the glue code in a function `get_mtk_dynamics` so that we avoid the use of too many global variables.
6464

0 commit comments

Comments
 (0)