homotopy(actual, simplified) declares that simplified is an easy to
solve approximation of actual. Wherever the operator is evaluated
numerically it is actual. A HomotopyProblem() built from a system
that contains the operator replaces every node by the blend
(1 - lambda) * simplified + lambda * actual and is solved by sweeping
lambda from 0 to 1, which walks from the easy solution to the true one.
Usage
homotopy(actual, simplified)
HomotopyCtx
homotopy_enabled(sys)
strip_homotopy(sys)
HomotopyCtx is the metadata key, a string.
Arguments
- actual
The real expression.
- simplified
An approximation whose solution is easy to reach.
- sys
A System.
Value
A sym expression; a System for strip_homotopy(); a logical
for homotopy_enabled().
Details
strip_homotopy(sys) replaces every node by its actual branch and
records FALSE under the metadata key HomotopyCtx, which
homotopy_enabled(sys) reads; in ModelingToolkit this is what
mtkcompile(sys; homotopy = false) does.