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
Unlike the original, notice that this system is *non-autonomous* because the independent variable $a$ appears explicitly in the equations!
116
116
This means that to change the independent variable from $a$ to $b$, we must provide not only the rate of change relation $db(a)/da = \exp(-b)$, but *also* the equation $a(b) = \exp(b)$ so $a$ can be eliminated in favor of $b$:
Transform the independent variable (e.g. ``t``) of the ODE system `sys` to a dependent variable `iv` (e.g. ``u(t)``).
57
-
An equation in `sys` must define the rate of change of the new independent variable (e.g. ``du(t)/dt``).
58
-
This or other additional equations can also be specified through `eqs`.
59
-
60
57
The transformation is well-defined when the mapping between the new and old independent variables are one-to-one.
61
58
This is satisfied if one is a strictly increasing function of the other (e.g. ``du(t)/dt > 0`` or ``du(t)/dt < 0``).
62
59
60
+
Any extra equations `eqs` involving the new and old independent variables will be taken into account in the transformation.
61
+
63
62
# Keyword arguments
64
63
65
-
- `dummies`: Whether derivatives of the new independent variable with respect to the old one are expressed through dummy equations or explicitly inserted into the equations.
66
-
- `add_old_diff`: Whether to add a differential equation for the old independent variable in terms of the new one using the inverse function rule.
64
+
- `add_old_diff`: Whether to add a differential equation for the old independent variable in terms of the new one using the inverse function rule ``dt/du = 1/(du/dt)``.
67
65
- `simplify`: Whether expanded derivative expressions are simplified. This can give a tidier transformation.
68
66
- `fold`: Whether internal substitutions will evaluate numerical expressions.
69
-
Additional keyword arguments `kwargs...` are forwarded to the constructor that rebuilds `sys`.
If `sys` is non-autonomous (i.e. ``t`` appears explicitly in its equations), it is often desirable to also pass an algebraic equation relating the new and old independent variables (e.g. ``t = f(u(t))``).
79
76
Otherwise the transformed system will be underdetermined and cannot be structurally simplified without additional changes.
77
+
If an algebraic relation is not known, consider using `add_old_diff`.
80
78
81
79
# Usage with hierarchical systems
82
80
@@ -91,16 +89,20 @@ By changing the independent variable, it can be reformulated for vertical positi
@set! sys.eqs = [get_eqs(sys); eqs] # add extra equations we derived before starting transformation process
131
+
@set! sys.unknowns = [get_unknowns(sys); [iv1, div2_of_iv1]] # add new variables, will be transformed to e.g. t(u) and uˍt(u) # add dummy variables and old independent variable as a function of the new one
122
132
123
-
# 1) Utility that performs the chain rule on an expression, e.g. (d/dt)(f(t)) -> (d/dt)(f(u(t))) -> df(u(t))/du(t) * du(t)/dt
124
-
functionchain_rule(ex)
133
+
# Create a utility that performs the chain rule on an expression, followed by insertion of the new independent variable
0 commit comments