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: docs/src/basics/FAQ.md
+54-1Lines changed: 54 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,5 +41,58 @@ ERROR: TypeError: non-boolean (Num) used in boolean context
41
41
42
42
then it's likely you are trying to trace through a function which cannot be
43
43
directly represented in Julia symbols. The techniques to handle this problem,
44
-
such as `@register_symbolic`, are described in detail
44
+
such as `@register_symbolic`, are described in detail
45
45
[in the Symbolics.jl documentation](https://symbolics.juliasymbolics.org/dev/manual/faq/#Transforming-my-function-to-a-symbolic-equation-has-failed.-What-do-I-do?-1).
46
+
47
+
## Using ModelingToolkit with Optimization / Automatic Differentiation
48
+
49
+
If you are using ModelingToolkit inside of a loss function and are having issues with
50
+
mixing MTK with automatic differentiation, getting performance, etc... don't! Instead, use
51
+
MTK outside of the loss function to generate the code, and then use the generated code
52
+
inside of the loss function.
53
+
54
+
For example, let's say you were building ODEProblems in the loss function like:
0 commit comments