viz/simulations.py¶
VizSimulations
¶
flowchart TD
wmbe.viz.simulations.VizSimulations[VizSimulations]
wmbe.viz.base.VizBase[VizBase]
wmbe.viz.base.VizBase --> wmbe.viz.simulations.VizSimulations
click wmbe.viz.simulations.VizSimulations href "" "wmbe.viz.simulations.VizSimulations"
click wmbe.viz.base.VizBase href "" "wmbe.viz.base.VizBase"
Numerical simulation visualization class.
Methods:
-
create_figure–Initialize a Pyplot figure.
-
erosion_rate_steadystate_W–Plot the 1d model steady-state erosion rate \(\nu_s\) versus weathering
-
erosion_rate_steadystate_W_transition–Plot the steady-state erosion rate \(\nu_s\) relative to its asymptotic
-
front_speed_evolution–Plot time-evolution of dimensionless erosion rate \(\nu(\tau)\).
-
ref_erosion_rate_vs_ref_weathering_rate–Plot baseline erosion rate versus baseline weathering rate.
-
ref_erosion_rate_vs_ref_weathering_rate_steadystate–Plot baseline erosion rate versus surface weakness at steady-state.
-
stability_check–Visualize stability of numerical solution.
-
weakness_evolution–Plot 1d evolution of weathering profile \({\omega}(\chi,\tau)\)
-
weakness_steadystate–Plot steady-state solution of weakness \({\omega}_s\).
-
weakness_steadystate_setW–Plot a set of steady-state solutions of weakness \({\omega}_s\).
Source code in wmbe/viz/base.py
create_figure
¶
create_figure(
name: str, size: tuple[float, float] | None = None, dpi: int | None = None
) -> Figure
Initialize a Pyplot figure.
Set its size and DPI. Append it to the figures dictionary.
Parameters:
-
(name¶str) –name of figure; used as key in figures dictionary
-
(size¶tuple[float, float] | None, default:None) –optional width and height of figure in inches
-
(dpi¶int | None, default:None) –rasterization resolution
Returns:
-
Figure–reference to MatPlotLib/Pyplot figure
Source code in wmbe/viz/base.py
erosion_rate_steadystate_W
¶
erosion_rate_steadystate_W(
name: str,
title: str | None = None,
eqns: Equations | None = None,
do_loglog: bool = True,
numerical_models: Sequence | None = None,
text_label: Sequence | None = None,
fig_size: tuple[float, float] = (6, 4),
) -> None
Plot the 1d model steady-state erosion rate \(\nu_s\) versus weathering number \({\mathcal{W}}\).
Graph the functional dependence of dimensionless steady-state erosion rate \(\nu_s\) as a function of versus weathering number \({\mathcal{W}}\) for the 1d weathering-mediated erosion model. The analytical solution is plotted as a black curve; numerical solutions are plotted as black circles; asymptotic behavior for low and high \({\mathcal{W}}\) are shown as dashed lines.
Parameters:
-
(name¶str) –key for figure dictionary
-
(title¶str | None, default:None) –optional title for figure
-
(eqns¶Equations | None, default:None) –instance of 1d weathering-mediated erosion theory class
-
(do_loglog¶bool, default:True) –flag whether to use log scales on both axes
-
(numerical_models¶Sequence | None, default:None) –sequence of numerical solutions of \(\nu_s\)
-
(text_label¶Sequence | None, default:None) –text annotation as tuple of form (x-y coordinate, string, font size)
-
(fig_size¶tuple[float, float], default:(6, 4)) –tuple (x,y) in inches (!)
Source code in wmbe/viz/simulations.py
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 | |
erosion_rate_steadystate_W_transition
¶
erosion_rate_steadystate_W_transition(
name: str,
title: str | None = None,
eqns: Equations | None = None,
text_label: Sequence | None = None,
fig_size: tuple[float, float] = (6, 4),
) -> None
Plot the steady-state erosion rate \(\nu_s\) relative to its asymptotic behavior.
Visualize the transitional behavior of the steady-state erosion rate \(\nu_s\) at intermediate weathering numbers \(W\) by plotting how asymptotes at low and high \(W\) deviate from the full model.
Parameters:
-
(name¶str) –key for figure dictionary
-
(title¶str | None, default:None) –optional title for figure
-
(eqns¶Equations | None, default:None) –instance of 1d weathering-mediated erosion theory class
-
(text_label¶Sequence | None, default:None) –text annotation as tuple of form (x-y coordinate, string, font size)
-
(fig_size¶tuple[float, float], default:(6, 4)) –tuple (x,y) in inches (!)
Source code in wmbe/viz/simulations.py
578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 | |
front_speed_evolution
¶
front_speed_evolution(
name: str,
title: str | None = None,
nm: NumericalModel | None = None,
fig_size: tuple[float, float] = (6, 4),
) -> None
Plot time-evolution of dimensionless erosion rate \(\nu(\tau)\).
Generate graph of numerical solutions \(j\) of dimensionless rock-surface
erosion rate \(\nu_i^j\) over dimensionless time \(\tau^j\).
These solutions are provided in the class instance
:class:~.solve1d.ErosionWeathering.
Legend-label by weathering number for this instance.
Parameters:
-
(name¶str) –key for figure dictionary
-
(title¶str | None, default:None) –optional title for figure
-
(nm¶NumericalModel | None, default:None) –instance of 1d weathering-mediated erosion NumericalModel class
-
(fig_size¶tuple[float, float], default:(6, 4)) –tuple (x,y) in inches (!)
Source code in wmbe/viz/simulations.py
ref_erosion_rate_vs_ref_weathering_rate
¶
ref_erosion_rate_vs_ref_weathering_rate(
name: str,
title: str | None = None,
eqns: Equations | None = None,
k: float = 1,
fig_size: tuple[float, float] = (6, 4),
) -> None
Plot baseline erosion rate versus baseline weathering rate.
Parameters:
-
(name¶str) –key for figure dictionary
-
(title¶str | None, default:None) –optional title for figure
-
(eqns¶Equations | None, default:None) –instance of 1d weathering-mediated erosion theory class
-
(k¶float, default:1) –weathering-depth model \(k\) value
-
(fig_size¶tuple[float, float], default:(6, 4)) –tuple (x,y) in inches (!)
Source code in wmbe/viz/simulations.py
ref_erosion_rate_vs_ref_weathering_rate_steadystate
¶
ref_erosion_rate_vs_ref_weathering_rate_steadystate(
name: str,
title: str | None = None,
eqns: Equations | None = None,
fig_size: tuple[float, float] = (6, 4),
) -> None
Plot baseline erosion rate versus surface weakness at steady-state.
Parameters:
-
(name¶str) –key for figure dictionary
-
(title¶str | None, default:None) –optional title for figure
-
(eqns¶Equations | None, default:None) –instance of 1d weathering-mediated erosion theory class
-
(fig_size¶tuple[float, float], default:(6, 4)) –tuple (x,y) in inches (!)
Source code in wmbe/viz/simulations.py
stability_check
¶
stability_check(
name: str,
title: str | None = None,
tau: NDArray | None = None,
nu: NDArray | None = None,
fig_size: tuple[float, float] = (6, 4),
) -> None
Visualize stability of numerical solution.
Check numerical stability of time-stepping by plotting a close-up of the erosion front speed over time.
Parameters:
-
(name¶str) –key for figure dictionary
-
(title¶str | None, default:None) –optional title for figure
-
(tau¶NDArray | None, default:None) –time slices \(\tau^j\) of numerical solution
-
(nu¶NDArray | None, default:None) –speed of erosion front \(\nu^j\) at each time slice \(\tau^j\)
-
(fig_size¶tuple[float, float], default:(6, 4)) –tuple (x,y) in inches (!)
Source code in wmbe/viz/simulations.py
weakness_evolution
¶
weakness_evolution(
name: str,
title: str | None = None,
nm: NumericalModel | None = None,
tc: float = 40,
nd: int = 2,
text_label: Sequence | None = None,
fig_size: tuple[float, float] = (6, 4),
) -> None
Plot 1d evolution of weathering profile \({\omega}(\chi,\tau)\) undergoing erosion.
Generate graph of selected solutions \(j\) of 1d weathering-mediated erosion model weakness \({\omega}_i^j = {\omega}(\chi_i,\tau^j)\). This series of time slices shows the propagation and development of a steady-state form of the weathering depth-profile as the rock surface is eroded. Quantities are all dimensionless.
Parameters:
-
(name¶str) –key for figure dictionary
-
(title¶str | None, default:None) –optional title for figure
-
(nm¶NumericalModel | None, default:None) –instance of 1d weathering-mediated erosion NumericalModel class
-
(tc¶int, default:40) –\(\tau^j\) slicing "rate"
-
(nd¶int, default:2) –number of decimal places in \(\tau\) legend label
-
(text_label¶Sequence | None, default:None) –text annotation as tuple of form (x-y coordinate, string, font size)
-
(fig_size¶tuple[float, float], default:(6, 4)) –tuple (x,y) in inches (!)
Source code in wmbe/viz/simulations.py
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 | |
weakness_steadystate
¶
weakness_steadystate(
name: str,
title: str | None = None,
nm: NumericalModel | None = None,
fig_size: tuple[float, float] = (6, 4),
) -> None
Plot steady-state solution of weakness \({\omega}_s\).
Graph the numerical solution of the 1d weathering-mediated erosion model for weakness \({\omega}_s(\chi_i | {\mathcal{W}})\) as a function of depth from the rock surface \(\chi_i\) for a given value of the weathering number \({\mathcal{W}}\).
Parameters:
-
(name¶str) –key for figure dictionary
-
(title¶str | None, default:None) –optional title for figure
-
(nm¶NumericalModel | None, default:None) –instance of 1d weathering-mediated erosion NumericalModel class
-
(fig_size¶tuple[float, float], default:(6, 4)) –tuple (x,y) in inches (!)
Source code in wmbe/viz/simulations.py
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 | |
weakness_steadystate_setW
¶
weakness_steadystate_setW(
name: str,
title: str | None = None,
numerical_models: Sequence | None = None,
chi_max: float = 8,
fig_size: tuple[float, float] = (6, 4),
) -> None
Plot a set of steady-state solutions of weakness \({\omega}_s\).
Graph a set of numerical solution of the 1d weathering-mediated erosion model for weakness \({\omega}_s(\chi_i | {\mathcal{W}})\) as a function of depth from the rock surface \(\chi_i\) for a set of weathering numbers \({\mathcal{W}}\).
Parameters:
-
(name¶str) –key for figure dictionary
-
(title¶str | None, default:None) –optional title for figure
-
(numerical_models¶Sequence | None, default:None) –sequence of instances of 1d weathering-mediated erosion NumericalModel class
-
(chi_max¶float, default:8) –maximum \(\chi\) on x axis
-
(fig_size¶tuple[float, float], default:(6, 4)) –tuple (x,y) in inches (!)
Source code in wmbe/viz/simulations.py
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 | |