Kuramoto-Sivashinsky (1-D)
The Kuramoto-Sivashinsky equation is a one-dimensional partial differential equation that is chaotic even in the simplest, most weakly nonlinear regime, which makes it a standard testbed for reduced-order modelling and data assimilation of spatiotemporal chaos,
with periodic boundary conditions. The second-order term is destabilizing,
the fourth-order term is a stabilizing hyperviscosity, and the nonlinear
term transfers energy between scales; together they produce a cascade that
saturates into sustained spatiotemporal chaos. The state, psi0, is the
field in Fourier space, and the equation is solved with the fourth-order
exponential time-differencing scheme (ETDRK4) of Kassam & Trefethen.

Space-time diagram of \(u(x,t)\) at \(\nu=0.08\) (equivalently \(L=2\pi/\sqrt{\nu}\) at \(\nu=1\)), past the transient: colour encodes the field, red and blue the positive and negative extremes. The cellular pattern that drifts and merges across the domain is the model's chaotic attractor.
Quickstart
from dynamodels.physical import KS
model = KS(Nx=256, nu=0.08, dt=0.25)
psi, t = model.time_integrate(Nt=4000)
model.update_history(psi, t)
model.visualize_spatiotemporal_hist()
model.close()
nu and L are independent: give nu alone for the standard
nondimensionalization (\(L=2\pi/\sqrt{\nu}\), integrated at \(\nu=1\)), L alone
for \(\nu=1\) on that domain, or both for the general two-parameter form. See
the class docstring below for the exact resolution rule and the rescaling
that relates the two.
Nonlinear diagnostics

Diagnostics from ntsa.characterize on a single grid
point, left to right: the observable time series with a zoomed inset; power
spectral density; the 3-D delay-embedded portrait; the first-return map of
the maxima; a plane-crossing Poincare section; a recurrence plot; a 3-D
classical-MDS embedding of the full spectral state; and the leading Lyapunov
exponent, estimated Jacobian-free from perturbation growth since KS steps
with time_step rather than time_derivative.
Reference
Kuramoto, Y., & Tsuzuki, T. (1976). Persistent propagation of concentration waves in dissipative media far from thermal equilibrium. Progress of Theoretical Physics, 55(2), 356-369.
Kassam, A.-K., & Trefethen, L. N. (2005). Fourth-order time-stepping for stiff PDEs. SIAM Journal on Scientific Computing, 26(4), 1214-1233.
API
dynamodels.physical.kuramoto_sivashinsky.KS
Bases: Model
Kuramoto-Sivashinsky equation.
with periodic boundary conditions \(u(t, 0) = u(t, L)\), \(u_x(t, 0) = u_x(t, L)\). Solved with the ETDRK4 scheme in Fourier space, where the Fourier transform pair is
On the \(N_x\)-point grid the wavenumbers are \(\alpha_j = 2\pi j / L\), so the (diagonal) linear operator is \(\alpha_j^2 - \nu\,\alpha_j^4\) and the nonlinear term \(u\,u_x\) is computed in physical space and transformed back to Fourier space at every stage.
Parametrization (\(\nu\), \(L\)). The pair is independent: whichever of the two is given fixes that side of the operator.
nuonly (the default): the domain follows the standard nondimensionalization \(L = 2\pi/\sqrt{\nu}\), and the equation is then integrated in its \(\nu = 1\) form on that domain -- soself.nuis 1 afterwards and the stored \((N_x, \nu, L)\) always describes the operator that was actually integrated (this is what makesntsa.respawn, which rebuilds fromfixed_params, bit-faithful).Lonly: \(\nu = 1\) on the given domain.- both: both are honoured as given, i.e. the genuine two-parameter system \(u_t + u_{xx} + \nu u_{xxxx} + u u_x = 0\) on \((0, L]\).
The one- and two-parameter forms are related by \(v(x', t') = \sqrt{\nu}\,u(x, t)\)
with \(x = \sqrt{\nu}\,x'\) and \(t = \nu\,t'\): KS(Nx, L=Lx, nu=visc, dt=dt) and
KS(Nx, L=Lx/sqrt(visc), dt=dt/visc) describe the same physical system.
Source code in dynamodels/physical/kuramoto_sivashinsky.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 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 61 62 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 95 96 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 128 129 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 164 165 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 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 223 224 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 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 282 283 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 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 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 407 408 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 444 445 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 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 | |
__init__(**model_dict)
Initialize the KS model.
Sets up the spatial grid, wavenumbers, sensor locations, and initial state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**model_dict
|
Model parameters; supported keys are:
|
{}
|
Source code in dynamodels/physical/kuramoto_sivashinsky.py
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 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 128 129 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 164 165 | |
get_observables(Nt=1, loc=None, **kwargs)
Get the observable state in physical space at specified sensor locations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
Nt
|
int
|
Number of time steps to retrieve. Default is 1. |
1
|
loc
|
array - like or str
|
Sensor locations to retrieve observables from. If 'all', returns observables at all spatial points. If None, returns observables at the predefined sensor locations. |
None
|
Source code in dynamodels/physical/kuramoto_sivashinsky.py
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 | |
__nonlinear_operator(u_hat)
Compute the nonlinear term N(u) = -u * u_x in Fourier space. F[-u * u_x] = F[1/2(u * u)_x] Input: (N_x, m)
rfft outputs the positive frequencies n/2+1 if even, (n+1)/2 if odds
Source code in dynamodels/physical/kuramoto_sivashinsky.py
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 257 258 259 260 261 262 263 264 265 266 267 268 269 270 | |
ETDRK4_step(u_hat, nonlinear_operator, E, E2, Q, f1, f2, f3)
staticmethod
Standard Kassam-Trefethen ETDRK4 step:
a_n = exp(L h / 2) u_n + Q N(u_n) b_n = exp(L h / 2) u_n + Q N(a_n) c_n = exp(L h / 2) a_n + Q (2 N(b_n) - N(u_n))
u_{n+1} = exp(L h) u_n + f1 N(u_n) + 2 f2 (N(a_n) + N(b_n)) + f3 N(c_n)
where h is the timestep, L the (diagonal) linear operator, N the nonlinear operator, and Q, f1, f2, f3 the contour-integrated phi-function coefficients (see ETDRK4_f_terms). The linear part is integrated exactly; the nonlinear terms with fourth-order accuracy.
Source code in dynamodels/physical/kuramoto_sivashinsky.py
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 | |
time_step(Nt=10, averaged=False, alpha=None)
Integrator for the KS model that supports ensembles and averaged ensemble propagation. Matches interface conventions of other models.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
Nt
|
int
|
Number of time steps to integrate. |
10
|
averaged
|
bool
|
If True, integrates the mean state and broadcasts ensemble deviations. |
False
|
alpha
|
optional
|
Additional model parameters. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
psi |
ndarray
|
Forecasted state array of shape (Nt, Nphi, m). |
t |
ndarray
|
Time vector corresponding to each forecasted state. |
Source code in dynamodels/physical/kuramoto_sivashinsky.py
360 361 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 407 408 409 410 411 | |
get_energy(Nt=0, u=None)
Compute the L2 energy of the solution: E = (1/L) * integral(u^2)dx
Returns:
float L2 energy
Source code in dynamodels/physical/kuramoto_sivashinsky.py
415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 | |
get_enstrophy(Nt=0, u_hat=None)
Compute the enstrophy (integral of (u_x)^2).
Returns:
float Enstrophy
Source code in dynamodels/physical/kuramoto_sivashinsky.py
438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 | |
visualize_spatiotemporal_hist(y_hist=None, t=None, nrows=None, averaged=False, **kwargs)
Visualize the spatiotemporal evolution of the KS model in the physical space.
Source code in dynamodels/physical/kuramoto_sivashinsky.py
485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 | |