Fractional dynamics
Fractional dynamics: relaxation, oscillators, and chaotic flows whose states have Caputo derivatives of an order.
OscillatorElement(label, visual=None, *, x=1.0, v=0.0, omega=1.0, gamma=0.0)
Bases: Element
Damped linear oscillator x' = v, v' = -omega^2 x - 2 gamma v of two first-order states.
Its fractional subclasses replace both derivatives by Caputo derivatives of one order.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the element. |
required |
visual
|
VisualSpec | None
|
How the element is drawn, or |
None
|
x
|
Annotated[float, StateSpec()]
|
The initial displacement. |
1.0
|
v
|
Annotated[float, StateSpec()]
|
The initial derivative of the displacement. |
0.0
|
omega
|
Annotated[float, ParameterSpec()]
|
The angular frequency. |
1.0
|
gamma
|
Annotated[float, ParameterSpec()]
|
The damping rate. |
0.0
|
Examples:
>>> from skcomplex.models.mathematics.fractional_dynamics import OscillatorElement
>>> OscillatorElement('oscillator', omega=2.0).omega
2.0
Source code in src/skcomplex/models/mathematics/fractional_dynamics/_oscillator.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | |
RelaxationElement(label, visual=None, *, x=1.0, lam=1.0)
Bases: Element
Linear relaxation x' = -lam x, whose fractional subclasses replace the derivative by a Caputo derivative.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the element. |
required |
visual
|
VisualSpec | None
|
How the element is drawn, or |
None
|
x
|
Annotated[float, StateSpec()]
|
The initial value. |
1.0
|
lam
|
Annotated[float, ParameterSpec()]
|
The relaxation rate. |
1.0
|
Examples:
>>> from skcomplex.models.mathematics.fractional_dynamics import RelaxationElement
>>> RelaxationElement('relaxation', lam=2.0).lam
2.0
Source code in src/skcomplex/models/mathematics/fractional_dynamics/_relaxation.py
36 37 38 39 40 41 42 43 44 45 46 | |
VanDerPolElement(label, visual=None, *, x=2.0, y=0.0, mu=1.0)
Bases: Element
Van der Pol oscillator x' = y, y' = mu (1 - x^2) y - x of two first-order states.
Its fractional subclasses replace both derivatives by Caputo derivatives of one order.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the element. |
required |
visual
|
VisualSpec | None
|
How the element is drawn, or |
None
|
x
|
Annotated[float, StateSpec()]
|
The initial displacement. |
2.0
|
y
|
Annotated[float, StateSpec()]
|
The initial derivative of the displacement. |
0.0
|
mu
|
Annotated[float, ParameterSpec()]
|
The strength of the nonlinear damping. |
1.0
|
Examples:
>>> from skcomplex.models.mathematics.fractional_dynamics import VanDerPolElement
>>> VanDerPolElement('oscillator', mu=2.0).mu
2.0
Source code in src/skcomplex/models/mathematics/fractional_dynamics/_van_der_pol.py
41 42 43 44 45 46 47 48 49 50 51 52 53 | |
fractional_lorenz(x=1.0, y=1.0, z=1.0, *, order=0.995, sigma=10.0, rho=28.0, beta=8 / 3)
Return the fractional Lorenz flow of Grigorenko and Grigorenko, chaotic for orders close enough to 1.
Grigorenko and Grigorenko report chaos down to the total order 2.97. With Caputo derivatives from rest and the predictor-corrector, the flow is chaotic for the order 0.995 of every state, a total of 2.985, and settles on a fixed point of the two wings for 0.99 after a chaotic transient.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
float
|
The initial convection intensity. |
1.0
|
y
|
float
|
The initial temperature difference between rising and falling currents. |
1.0
|
z
|
float
|
The initial deviation of the vertical temperature profile. |
1.0
|
order
|
float
|
The order |
0.995
|
sigma
|
float
|
The Prandtl number. |
10.0
|
rho
|
float
|
The Rayleigh number relative to its critical value. |
28.0
|
beta
|
float
|
The geometric factor. |
8 / 3
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The model, with the states |
Examples:
>>> from skcomplex.models.mathematics.fractional_dynamics import fractional_lorenz
>>> fractional_lorenz(rho=20.0).elements[0].rho
20.0
Source code in src/skcomplex/models/mathematics/fractional_dynamics/_fractional.py
284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 | |
fractional_oscillator(x=1.0, v=0.0, *, order=0.8, omega=1.0, gamma=0.0)
Return the fractional damped oscillator D^alpha x = v, D^alpha v = -omega^2 x - 2 gamma v.
With gamma = 0 the system is the fractional oscillation equation of order 2 alpha, whose memory damps the
oscillations for 1/2 < alpha < 1 without any friction. Order 1 gives the harmonic oscillator.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
float
|
The initial displacement. |
1.0
|
v
|
float
|
The initial value of the first state's derivative of order |
0.0
|
order
|
float
|
The order |
0.8
|
omega
|
float
|
The angular frequency. |
1.0
|
gamma
|
float
|
The damping rate. |
0.0
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The model, with the states |
Examples:
>>> from skcomplex.models.mathematics.fractional_dynamics import fractional_oscillator
>>> fractional_oscillator(order=0.9).elements[0].omega
1.0
Source code in src/skcomplex/models/mathematics/fractional_dynamics/_fractional.py
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 | |
fractional_relaxation(x=1.0, *, order=0.6, lam=1.0)
Return fractional relaxation D^alpha x = -lambda x, which decays as the Mittag-Leffler function E_alpha.
The solution x(0) E_alpha(-lambda t^alpha) decays slower than any exponential, as the power law t^(-alpha) at
long times, since the Caputo derivative keeps the memory of the whole past. Order 1 gives exponential decay.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
float
|
The initial value. |
1.0
|
order
|
float
|
The order |
0.6
|
lam
|
float
|
The relaxation rate. |
1.0
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The model, with the state |
Examples:
>>> from skcomplex.models.mathematics.fractional_dynamics import fractional_relaxation
>>> fractional_relaxation(order=0.5).elements[0].lam
1.0
Source code in src/skcomplex/models/mathematics/fractional_dynamics/_fractional.py
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 | |
fractional_van_der_pol(x=2.0, y=0.0, *, order=0.9, mu=1.0)
Return the fractional Van der Pol oscillator D^alpha x = y, D^alpha y = mu (1 - x^2) y - x.
For orders close to 1 the trajectory approaches a closed cycle, and the memory of lower orders shrinks it toward the fixed point at the origin.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
float
|
The initial displacement. |
2.0
|
y
|
float
|
The initial value of the displacement's derivative of order |
0.0
|
order
|
float
|
The order |
0.9
|
mu
|
float
|
The strength of the nonlinear damping. |
1.0
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The model, with the states |
Examples:
>>> from skcomplex.models.mathematics.fractional_dynamics import fractional_van_der_pol
>>> fractional_van_der_pol(mu=2.0).elements[0].mu
2.0
Source code in src/skcomplex/models/mathematics/fractional_dynamics/_fractional.py
247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 | |
lorenz_type(order)
cached
Return the element type of the fractional Lorenz flow, the Lorenz equations with Caputo derivatives of an order.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
order
|
float
|
The order |
required |
Returns:
| Name | Type | Description |
|---|---|---|
element_type |
type[LorenzElement]
|
The subclass of |
Examples:
>>> from skcomplex.models.mathematics.fractional_dynamics import lorenz_type
>>> lorenz_type(0.99).__name__
'FractionalLorenz_0p99'
Source code in src/skcomplex/models/mathematics/fractional_dynamics/_fractional.py
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | |
oscillator_type(order)
cached
Return the element type of the fractional oscillator D^alpha x = v, D^alpha v = -omega^2 x - 2 gamma v.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
order
|
float
|
The order |
required |
Returns:
| Name | Type | Description |
|---|---|---|
element_type |
type[OscillatorElement]
|
The subclass of |
Examples:
>>> from skcomplex.models.mathematics.fractional_dynamics import oscillator_type
>>> oscillator_type(0.8).__name__
'FractionalOscillator_0p8'
Source code in src/skcomplex/models/mathematics/fractional_dynamics/_fractional.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | |
relaxation_type(order)
cached
Return the element type of fractional relaxation D^alpha x = -lambda x of an order.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
order
|
float
|
The order |
required |
Returns:
| Name | Type | Description |
|---|---|---|
element_type |
type[RelaxationElement]
|
The subclass of |
Examples:
>>> from skcomplex.models.mathematics.fractional_dynamics import relaxation_type
>>> relaxation_type(0.5).__name__
'FractionalRelaxation_0p5'
Source code in src/skcomplex/models/mathematics/fractional_dynamics/_fractional.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | |
van_der_pol_type(order)
cached
Return the element type of the fractional Van der Pol system D^alpha x = y, D^alpha y = mu (1 - x^2) y - x.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
order
|
float
|
The order |
required |
Returns:
| Name | Type | Description |
|---|---|---|
element_type |
type[VanDerPolElement]
|
The subclass of |
Examples:
>>> from skcomplex.models.mathematics.fractional_dynamics import van_der_pol_type
>>> van_der_pol_type(0.9).__name__
'FractionalVanDerPol_0p9'
Source code in src/skcomplex/models/mathematics/fractional_dynamics/_fractional.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | |