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.systems.mathematics.fractional_dynamics import OscillatorElement
>>> OscillatorElement('oscillator', omega=2.0).omega
2.0
Source code in src/skcomplex/systems/mathematics/fractional_dynamics/_fractional.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | |
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.systems.mathematics.fractional_dynamics import RelaxationElement
>>> RelaxationElement('relaxation', lam=2.0).lam
2.0
Source code in src/skcomplex/systems/mathematics/fractional_dynamics/_fractional.py
100 101 102 103 104 105 106 107 108 109 110 | |
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.systems.mathematics.fractional_dynamics import VanDerPolElement
>>> VanDerPolElement('oscillator', mu=2.0).mu
2.0
Source code in src/skcomplex/systems/mathematics/fractional_dynamics/_fractional.py
153 154 155 156 157 158 159 160 161 162 163 164 165 | |
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 system, with the states |
Examples:
>>> from skcomplex.systems.mathematics.fractional_dynamics import fractional_lorenz
>>> fractional_lorenz(rho=20.0).elements[0].rho
20.0
Source code in src/skcomplex/systems/mathematics/fractional_dynamics/_fractional.py
446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 | |
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 system, with the states |
Examples:
>>> from skcomplex.systems.mathematics.fractional_dynamics import fractional_oscillator
>>> fractional_oscillator(order=0.9).elements[0].omega
1.0
Source code in src/skcomplex/systems/mathematics/fractional_dynamics/_fractional.py
362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 | |
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 system, with the state |
Examples:
>>> from skcomplex.systems.mathematics.fractional_dynamics import fractional_relaxation
>>> fractional_relaxation(order=0.5).elements[0].lam
1.0
Source code in src/skcomplex/systems/mathematics/fractional_dynamics/_fractional.py
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | |
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 system, with the states |
Examples:
>>> from skcomplex.systems.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/systems/mathematics/fractional_dynamics/_fractional.py
409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 | |
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.systems.mathematics.fractional_dynamics import lorenz_type
>>> lorenz_type(0.99).__name__
'FractionalLorenz_0p99'
Source code in src/skcomplex/systems/mathematics/fractional_dynamics/_fractional.py
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 | |
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.systems.mathematics.fractional_dynamics import oscillator_type
>>> oscillator_type(0.8).__name__
'FractionalOscillator_0p8'
Source code in src/skcomplex/systems/mathematics/fractional_dynamics/_fractional.py
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 | |
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.systems.mathematics.fractional_dynamics import relaxation_type
>>> relaxation_type(0.5).__name__
'FractionalRelaxation_0p5'
Source code in src/skcomplex/systems/mathematics/fractional_dynamics/_fractional.py
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 | |
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.systems.mathematics.fractional_dynamics import van_der_pol_type
>>> van_der_pol_type(0.9).__name__
'FractionalVanDerPol_0p9'
Source code in src/skcomplex/systems/mathematics/fractional_dynamics/_fractional.py
259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 | |