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
function change_independent_variable(sys::AbstractODESystem, iv, eq = nothing; dummies = false, simplify = true, verbose = false, kwargs...)
55
+
56
+
Transform the independent variable (e.g. ``t``) of the ODE system `sys` to a dependent variable `iv` (e.g. ``f(t)``).
57
+
An equation in `sys` must define the rate of change of the new independent variable (e.g. ``df(t)/dt``).
58
+
Alternatively, `eq` can specify such an equation.
59
+
60
+
The transformation is well-defined when the mapping between the new and old independent variables are one-to-one.
61
+
This is satisfied if one is a strictly increasing function of the other (e.g. ``df(t)/dt > 0`` or ``df(t)/dt < 0``).
62
+
63
+
Keyword arguments
64
+
=================
65
+
If `dummies`, derivatives of the new independent variable are expressed through dummy equations; otherwise they are explicitly inserted into the equations.
66
+
If `simplify`, these dummy expressions are simplified and often give a tidier transformation.
67
+
If `verbose`, the function prints intermediate transformations of equations to aid debugging.
68
+
Any additional keyword arguments `kwargs...` are forwarded to the constructor that rebuilds the system.
69
+
70
+
Usage before structural simplification
71
+
======================================
72
+
The variable change must take place before structural simplification.
73
+
Subsequently, consider passing `allow_symbolic = true` to `structural_simplify(sys)` to reduce the number of unknowns, with the understanding that the transformation is well-defined.
74
+
75
+
Example
76
+
=======
77
+
Consider a free fall with constant horizontal velocity.
78
+
The laws of physics naturally describes position as a function of time.
79
+
By changing the independent variable, it can be reformulated for vertical position as a function of horizontal distance:
Mt =ODESystem([D(x) ~2*x], t; name =:M) |> complete#TODO: avoid complete. can avoid it if passing defined $variable directly to change_independent_variable
0 commit comments