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
Also notice the interesting dynamics taking place towards the end of the integration (in the early universe), which gets compressed into a very small time interval.
@@ -89,22 +98,22 @@ To do this, we will change the independent variable in two stages; from $t$ to $
89
98
Notice that $\mathrm{d}a/\mathrm{d}t > 0$ provided that $\Omega > 0$, and $\mathrm{d}b/\mathrm{d}a > 0$, so the transformation is well-defined.
Unlike the original, notice that this system is *non-autonomous* because the independent variable $a$ appears explicitly in the equations!
95
104
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$:
Copy file name to clipboardExpand all lines: src/systems/diffeqs/basic_transformations.jl
+41-22Lines changed: 41 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -77,6 +77,11 @@ Usage with non-autonomous systems
77
77
If `sys` is 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))``).
78
78
Otherwise the transformed system will be underdetermined and cannot be structurally simplified without additional changes.
79
79
80
+
Usage with hierarchical systems
81
+
===============================
82
+
It is recommended that `iv` is a non-namespaced variable in `sys`.
83
+
This means it can belong to the top-level system or be a variable in a subsystem declared with `GlobalScope`.
84
+
80
85
Example
81
86
=======
82
87
Consider a free fall with constant horizontal velocity.
@@ -102,8 +107,6 @@ function change_independent_variable(sys::AbstractODESystem, iv, eqs = []; dummi
102
107
error("System $(nameof(sys)) is incomplete. Complete it first!")
103
108
elseifisscheduled(sys)
104
109
error("System $(nameof(sys)) is structurally simplified. Change independent variable before structural simplification!")
105
-
elseif!isempty(get_systems(sys))
106
-
error("System $(nameof(sys)) is hierarchical. Flatten it first!") #TODO: implement and allow?
0 commit comments