printing
¶
Printing utilities for expressions and equations of motion.
print_eom(eqns) — display the EOM dict as LaTeX equations print_tree(expr) — display the expression tree structure for debugging render_eom(eqns) — compile EOM to PDF via pdflatex
display_eom(eqns)
¶
Display equations of motion as rendered LaTeX in a Jupyter notebook.
Source code in geomech/utils/printing.py
display_latex(expr)
¶
display_standard_form(sf)
¶
Display standard form as Mddq + Gu + f = 0 in a Jupyter notebook.
Source code in geomech/utils/printing.py
eom_to_latex(eqns)
¶
Return a complete LaTeX document string for the EOM dict.
Source code in geomech/utils/printing.py
print_eom(eqns)
¶
Print equations of motion as LaTeX integral equations.
eqns is the dict returned by compute_eom:
{str(variation_vector): (variation_vector, equation)}
Source code in geomech/utils/printing.py
print_tree(expr, indent=0, label='', style='topdown')
¶
Print the expression tree structure for debugging.
Each node shows its class name, type, and key properties. Children are indented below their parent.
Parameters¶
style : str 'topdown' (default) — graphical top-down tree with / and \ branches. 'indent' — original indented list format.
Source code in geomech/utils/printing.py
render_eom(eqns, output='eom.pdf', open_pdf=True)
¶
Compile EOM to PDF via pdflatex.
Parameters¶
eqns : dict
The dict returned by compute_eom.
output : str
Output PDF path (default: eom.pdf in current directory).
open_pdf : bool
If True, open the PDF after compilation (macOS open).
Source code in geomech/utils/printing.py
repr_str(expr)
¶
Return a human-readable string for the expression (used by repr).
Source code in geomech/utils/printing.py
to_latex(expr)
¶
Convert an expression tree to a LaTeX string.
Returns a string suitable for use with IPython.display.Math() or inside a LaTeX equation environment.
Source code in geomech/utils/printing.py
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 | |
tree_str(expr, indent=0, label='', style='topdown')
¶
Return the expression tree as a string (without printing).