Refactors code to use constants and formulas

Replaces hardcoded numerical values with symbolic Python variables derived from defined constants and formulas.

This improves code maintainability and consistency, ensuring calculations are based on accurate and up-to-date physical values.
This commit is contained in:
Vijay Janapa Reddi
2026-02-03 19:48:11 -05:00
parent fc1321ff85
commit 05a184459d
49 changed files with 6978 additions and 3362 deletions

View File

@@ -3,13 +3,13 @@ import sys
import os
import matplotlib.pyplot as plt
# Setup path to import from quarto/calc
# Setup path to import from quarto/physx
project_root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(os.path.join(project_root, 'quarto'))
from calc import viz
from calc import ch_hw_acceleration
from calc import ch_appendix_algorithm
from physx import viz
from physx import ch_hw_acceleration
from physx import ch_appendix_algorithm
def generate_preview_assets():
output_dir = os.path.join(project_root, "quarto/assets/images/generated")

View File

@@ -2,9 +2,10 @@ import sys
import os
import matplotlib.pyplot as plt
# Add calc directory to path
sys.path.append(os.path.abspath('book/quarto/calc'))
import viz
# Add physx directory to path
project_root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(os.path.join(project_root, 'quarto'))
from physx import viz
# Output directory
OUTPUT_DIR = "book/quarto/assets/preview_plots"

View File

@@ -2,9 +2,10 @@ import sys
import os
import matplotlib.pyplot as plt
# Add calc directory to path
sys.path.append(os.path.abspath('book/quarto/calc'))
import viz
# Add physx directory to path
project_root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(os.path.join(project_root, 'quarto'))
from physx import viz
# Output directory
OUTPUT_DIR = "book/quarto/assets/preview_plots"