From ba8f37386eeaca787c6676e685f1ac027fdf8273 Mon Sep 17 00:00:00 2001 From: Savio Cardoso Date: Sat, 15 Aug 2026 21:06:27 +0200 Subject: [PATCH 1/3] fix: restore CI and documentation rendering --- .github/copilot-instructions.md | 3 ++- .github/workflows/ci.yml | 4 ++-- docs/ai_assisted_development.md | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index a012473..2472a45 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -78,4 +78,5 @@ Before considering a change complete, the project should pass: ruff format --check . ruff check . mypy src -python -m pytest \ No newline at end of file +python -m pytest +``` \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 99b9764..5abef55 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,11 +35,11 @@ jobs: - name: Upgrade pip run: python -m pip install --upgrade pip - - name: Install PyTorch + - name: Install PyTorch run: > python -m pip install torch --index-url https://download.pytorch.org/whl/cpu - + - name: Install CalculiX run: | sudo apt-get update diff --git a/docs/ai_assisted_development.md b/docs/ai_assisted_development.md index 7dd28de..f96e90f 100644 --- a/docs/ai_assisted_development.md +++ b/docs/ai_assisted_development.md @@ -103,4 +103,5 @@ The accepted implementation was verified using: ruff format --check . ruff check . mypy src -python -m pytest \ No newline at end of file +python -m pytest +``` \ No newline at end of file From 9a7dccec47ac3ec91215ca82fcdcd4baf25fb919 Mon Sep 17 00:00:00 2001 From: Savio Cardoso Date: Sat, 15 Aug 2026 21:06:38 +0200 Subject: [PATCH 2/3] fix: harden stochastic and material validation --- src/bodysimpy/analysis/stochastic.py | 9 +++++++++ src/bodysimpy/domain/materials.py | 4 ++-- tests/unit/test_crossmember_model.py | 30 ++++++++++++++++++++++++++++ tests/unit/test_stochastic.py | 19 ++++++++++++++++++ 4 files changed, 60 insertions(+), 2 deletions(-) diff --git a/src/bodysimpy/analysis/stochastic.py b/src/bodysimpy/analysis/stochastic.py index 4267e67..aaaa561 100644 --- a/src/bodysimpy/analysis/stochastic.py +++ b/src/bodysimpy/analysis/stochastic.py @@ -29,6 +29,15 @@ class DistributionSummary: percentile_5: float percentile_95: float + @property + def coefficient_of_variation_percent(self) -> float: + """Return the sample coefficient of variation as a percentage.""" + + if self.mean == 0.0: + raise ValueError("Coefficient of variation is undefined for a zero mean.") + + return abs(self.standard_deviation / self.mean) * 100.0 + @dataclass(frozen=True, slots=True) class SensitivityCoefficient: diff --git a/src/bodysimpy/domain/materials.py b/src/bodysimpy/domain/materials.py index 3f93731..2351435 100644 --- a/src/bodysimpy/domain/materials.py +++ b/src/bodysimpy/domain/materials.py @@ -15,8 +15,8 @@ def __post_init__(self) -> None: if self.youngs_modulus_pa <= 0.0: raise ValueError("Young's modulus must be positive.") - if not 0.0 < self.poisson_ratio < 0.5: - raise ValueError("Poisson ratio must be between 0 and 0.5.") + if not -1.0 < self.poisson_ratio < 0.5: + raise ValueError("Poisson ratio must be between -1.0 and 0.5.") if self.density_kg_m3 <= 0.0: raise ValueError("Density must be positive.") diff --git a/tests/unit/test_crossmember_model.py b/tests/unit/test_crossmember_model.py index 8673628..5a30b42 100644 --- a/tests/unit/test_crossmember_model.py +++ b/tests/unit/test_crossmember_model.py @@ -47,3 +47,33 @@ def test_build_crossmember_model() -> None: assert model.material.youngs_modulus_pa == pytest.approx(210e9) assert model.tip_force_n == pytest.approx(1000.0) assert model.mesh_elements == 20 + + +def test_build_crossmember_model_accepts_valid_negative_poisson_ratio() -> None: + config = SimulationConfig.model_validate( + { + "project": {"name": "auxetic_crossmember"}, + "geometry": { + "type": "rectangular_hollow_section", + "length_m": 1.0, + "width_m": 0.080, + "height_m": 0.040, + "thickness_m": 0.0015, + }, + "material": { + "youngs_modulus_pa": 210e9, + "poisson_ratio": -0.20, + "density_kg_m3": 7850.0, + }, + "loading": {"tip_force_n": 1000.0}, + "mesh": {"elements": 20}, + "analysis": { + "static": True, + "modal": {"modes": 10}, + }, + } + ) + + model = build_crossmember_model(config) + + assert model.material.poisson_ratio == pytest.approx(-0.20) diff --git a/tests/unit/test_stochastic.py b/tests/unit/test_stochastic.py index 0ae2e8e..c7512e1 100644 --- a/tests/unit/test_stochastic.py +++ b/tests/unit/test_stochastic.py @@ -53,6 +53,25 @@ def test_distribution_summary() -> None: assert summary.percentile_95 > summary.mean + assert summary.coefficient_of_variation_percent == pytest.approx( + summary.standard_deviation / summary.mean * 100.0 + ) + + +def test_distribution_summary_rejects_zero_mean_cov() -> None: + values = np.array( + [ + -1.0, + 1.0, + ], + dtype=float, + ) + + summary = summarize_distribution(values) + + with pytest.raises(ValueError, match="zero mean"): + _ = summary.coefficient_of_variation_percent + def test_stochastic_inputs_are_reproducible() -> None: config = build_stochastic_config() From 1893e59fbf08f5203b4443f02c849771153f179c Mon Sep 17 00:00:00 2001 From: Savio Cardoso Date: Sat, 15 Aug 2026 21:06:47 +0200 Subject: [PATCH 3/3] docs: finalize application-ready project showcase --- README.md | 505 ++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 373 insertions(+), 132 deletions(-) diff --git a/README.md b/README.md index 350d8b2..15112a2 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,15 @@ # BodySimPy - ## Python-Driven Structural CAE Workflow Automation for Automotive Body Structures [![CI](https://github.com/savbcar/BodySimPy/actions/workflows/ci.yml/badge.svg)](https://github.com/savbcar/BodySimPy/actions/workflows/ci.yml) -[![Tests](https://img.shields.io/github/actions/workflow/status/savbcar/BodySimPy/ci.yml?branch=main&label=tests)](https://github.com/savbcar/BodySimPy/actions/workflows/ci.yml) ![Python](https://img.shields.io/badge/Python-3.11%20%7C%203.12-blue) +![CalculiX](https://img.shields.io/badge/FEA-CalculiX-2f6f9f) +![PyTorch](https://img.shields.io/badge/ML-PyTorch-ee4c2c) ![License](https://img.shields.io/badge/License-MIT-green) -**BodySimPy** is a Python-based engineering software project for automating structural CAE studies around a simplified automotive body crossmember surrogate. - -The project combines analytical mechanics, CalculiX finite-element analysis, structural dynamics, uncertainty propagation, fatigue assessment, parameter-study automation, PyTorch surrogate modelling, automated reporting, test-driven development, AI-assisted software development, and simulation QA. +BodySimPy is a Python engineering project for automating structural CAE studies around a **simplified automotive body crossmember surrogate**. It combines analytical structural mechanics, CalculiX finite-element analysis, structural dynamics, parameter studies, stochastic simulation, fatigue assessment, PyTorch surrogate modelling, automated reporting, testing, and simulation-quality checks in one reproducible workflow. -The objective is not to reproduce a proprietary vehicle body model. The objective is to demonstrate how Python can be used to build a **reproducible, validated and extensible structural engineering workflow** around an open-source finite-element solver. +The project is intentionally **not** a proprietary or production vehicle-body model. Its purpose is to demonstrate how an engineering simulation workflow can be structured, automated, validated, tested, and extended with Python. --- @@ -36,7 +34,6 @@ flowchart LR E --> K[FEA Dataset] F --> K - K --> L[PyTorch Surrogate] G --> M[Engineering Results] @@ -45,33 +42,232 @@ flowchart LR J --> M L --> M - M --> N[Simulation QA Agent] - M --> O[Automated Reporting] + M --> N[Engineering PDF] + M --> O[Management PPTX] + M --> P[Simulation QA] +``` + +--- + +## What This Project Demonstrates + +| Engineering / software skill | Evidence in BodySimPy | +|---|---| +| Python engineering | Installable `src/` package, typed domain models, reusable workflows, scripts and CLI | +| Structural FEA automation | CalculiX input generation, execution, isolated work directories and result parsing | +| Verification and validation | Analytical cantilever references plus static mesh-convergence studies | +| Structural dynamics | Modal FEA, modal-result parsing and frequency studies | +| Parameter studies | Automated geometry/material sweeps and sensitivity plots | +| Stochastics | Reproducible Monte Carlo sampling, distribution summaries and sensitivity ranking | +| Fatigue | Power-law S-N model and Palmgren-Miner cumulative-damage assessment | +| Machine learning | PyTorch multi-output surrogate trained on FEA-generated data | +| Engineering evaluation | Held-out prediction metrics, sample-efficiency study, runtime benchmark and break-even study | +| Software quality | `pytest`, Ruff, strict `mypy`, GitHub Actions and feature-branch / pull-request workflow | +| AI-assisted development | Repository-level Copilot instructions, bounded prompt record and human validation log | +| Agent-based workflow | Deterministic simulation-QA agent that orchestrates engineering checks | +| Reporting | Automatically generated engineering PDF and management PowerPoint summary | + +--- + +## Representative Results + +The values below are representative outputs committed with the repository and are tied to the simplified crossmember study and its stated assumptions. + +| Study | Representative result | +|---|---:| +| Static FEA mesh convergence | Tip-deflection error: **0.055%** at 160 elements | +| Static stress comparison | Stress error: **4.641%** at 160 elements | +| Structural dynamics | Mode-1 frequency: **49.401 Hz** | +| Stochastic study | **500** Monte Carlo samples | +| Stochastic threshold check | **0 / 500** samples above 350 MPa in the committed study | +| Fatigue demonstration | Miner damage **D = 0.122812** per defined spectrum | +| PyTorch surrogate – stress | Held-out MAPE: **1.06%** | +| PyTorch surrogate – deflection | Held-out MAPE: **1.27%** | +| PyTorch surrogate – mode-1 frequency | Held-out MAPE: **0.39%** | +| Runtime experiment | Approx. **2,870×** median surrogate/FEA evaluation speedup in the committed benchmark | + +> Runtime values are hardware- and methodology-dependent. The stochastic threshold result is a sampled exceedance fraction for the defined input distributions, not a real-world structural failure probability. + +--- + +## 1. Static FEA Verification + +The baseline model is a rectangular hollow-section cantilever surrogate. BodySimPy generates a CalculiX beam model, runs the solver, parses solver outputs, and compares the finite-element response with analytical Euler-Bernoulli reference equations. + +The mesh-convergence study demonstrates that tip deflection converges closely to the analytical reference. Stress recovery shows a small residual difference, which is retained transparently rather than hidden or tuned away. + +![Static mesh convergence](docs/figures/static_mesh_convergence.png) + +### Why the stress error is not forced to zero + +The analytical stress expression and the finite-element stress recovery do not represent an identical numerical procedure. The remaining difference is therefore reported as a model/implementation limitation rather than treated as a calibration target. + +--- + +## 2. Structural Dynamics + +The workflow also executes CalculiX modal analyses and parses the requested eigenfrequencies. The committed baseline study extracts ten modes; the first mode is approximately **49.4 Hz**. + +![Modal frequencies](docs/figures/modal_frequencies.png) + +Material and geometry sensitivities can also be evaluated automatically. + +

+ Young's modulus sensitivity + Density sensitivity +

+ +--- + +## 3. Parameter-Sweep Automation + +BodySimPy automates repeated simulation studies rather than relying on manual solver execution. The parameter-sweep workflow can vary structural inputs, dispatch independent CalculiX runs, collect results, and generate validation data and figures. + +![Thickness versus stress](docs/figures/thickness_vs_stress.png) + +This architecture separates: + +- engineering configuration; +- domain-model construction; +- solver execution; +- result parsing; +- analysis logic; and +- reporting/visualization. + +--- + +## 4. Stochastic Engineering Study + +A reproducible Monte Carlo workflow propagates uncertainty in wall thickness, Young's modulus, and tip load through repeated FEA evaluations. + +The committed study contains **500 samples** and records distributions for maximum stress and first-mode frequency together with standardized linear sensitivity rankings and a correlation matrix. + +

+ Stress histogram + Frequency histogram +

+ +![Stochastic correlation matrix](docs/figures/stochastic_correlation_matrix.png) + +The stochastic module is intended as a transparent engineering uncertainty study. It does not claim production reliability prediction, manufacturing-tolerance validation, or vehicle-level failure probability. + +--- + +## 5. Fatigue Assessment + +The fatigue module implements a simplified power-law S-N relation and Palmgren-Miner cumulative damage: + +$$ +N = N_{ref}\left(\frac{\sigma_{ref}}{\sigma_a}\right)^m +$$ + +and + +$$ +D = \sum_i \frac{n_i}{N_i} +$$ + +For the demonstration spectrum currently defined in the project, the total calculated damage is **0.122812**, corresponding to approximately **8.14 repeats** of that exact spectrum to reach $D=1$ under the model assumptions. The `elevated_load` block contributes the largest damage fraction. + +This is deliberately presented as a methodological demonstration. The project does not introduce unverified material-specific S-N curves, weld classes, mean-stress corrections, rainflow counting, or experimental durability correlation. + +--- + +## 6. PyTorch Structural Surrogate + +BodySimPy includes a PyTorch multi-output regression model trained on FEA-generated data. The surrogate predicts: + +- maximum stress; +- tip deflection; and +- first-mode frequency. + +Held-out evaluation in the committed test set gives approximately **1.06% stress MAPE**, **1.27% deflection MAPE**, and **0.39% frequency MAPE**. + +

+ FEA versus predicted stress + FEA versus predicted deflection + FEA versus predicted frequency +

+ +### Accuracy versus training-data cost + +The repository also contains a repeated-seed sample-efficiency experiment to show how predictive accuracy changes as the number of FEA training designs grows. + +![ML accuracy versus training size](docs/figures/ml_accuracy_vs_training_size.png) + +### Runtime and break-even study + +A separate benchmark compares sequential CalculiX evaluation time with batched surrogate inference and estimates the number of design queries required to recover the cost of generating FEA data and training the surrogate. +

+ ML runtime comparison + ML break-even study +

+The committed benchmark shows a median per-design surrogate speedup of roughly **2,870×** relative to the measured sequential FEA evaluation. This value is an experiment result, not a universal performance claim. -## Software Architecture +--- + +## 7. Simulation QA Agent + +BodySimPy includes a deterministic simulation-QA agent that orchestrates engineering checks over solver status, expected outputs, stress limits, modal shifts, and historical outlier behavior. + +The agent returns explicit states such as `PASS`, `INVESTIGATE`, and `FAILED` together with findings and a recommended action. + +The QA agent is **not** presented as an autonomous engineering authority. It is a tool-orchestration layer that helps surface conditions requiring engineering review. + +See [`docs/simulation_qa_agent.md`](docs/simulation_qa_agent.md). + +--- + +## 8. AI-Assisted Development With Human Validation + +The repository documents bounded use of GitHub Copilot and prompt engineering rather than treating AI output as authoritative code. + +Project-specific instructions define physical and software constraints such as: + +- preserving SI units; +- not inventing solver results or material properties; +- preserving signed loads; +- respecting geometric validity; +- separating analytical references from FEA results; and +- validating AI-generated tests against engineering requirements. + +The repository also contains a recorded prompt for configuration edge cases and a human validation log showing which AI suggestions were accepted, modified, rejected, or deferred. + +See: + +- [`.github/copilot-instructions.md`](.github/copilot-instructions.md) +- [`.github/prompts/configuration-edge-cases.prompt.md`](.github/prompts/configuration-edge-cases.prompt.md) +- [`docs/ai_assisted_development.md`](docs/ai_assisted_development.md) + +--- + +## 9. Software Architecture +```text BodySimPy/ -│ +├── .github/ +│ ├── copilot-instructions.md +│ ├── prompts/ +│ └── workflows/ci.yml ├── configs/ -│ └── simulation and study configurations -│ +│ ├── baseline_crossmember.yaml +│ ├── fatigue_crossmember.yaml +│ ├── simulation_qa.yaml +│ ├── stochastic_crossmember.yaml +│ └── thickness_sweep.yaml ├── data/ -│ └── generated engineering / surrogate datasets -│ +│ └── surrogate/ ├── docs/ │ ├── figures/ │ ├── validation/ │ ├── ai_assisted_development.md │ └── simulation_qa_agent.md -│ ├── reports/ -│ └── automated engineering summaries -│ +│ ├── BodySimPy_Engineering_Summary.pdf +│ └── BodySimPy_Management_Summary.pptx ├── scripts/ -│ └── reproducible study and reporting entry points -│ ├── src/bodysimpy/ │ ├── agents/ │ ├── analysis/ @@ -81,162 +277,207 @@ BodySimPy/ │ ├── modeling/ │ ├── reporting/ │ ├── solvers/ -│ │ └── parsers/ │ └── workflows/ -│ -└── tests/ - ├── integration/ - └── unit/ +├── tests/ +│ ├── integration/ +│ └── unit/ +├── pyproject.toml +└── README.md +``` + +### Design principles + +- **Configuration-driven:** YAML inputs are validated before analysis. +- **Solver-independent domain layer:** engineering objects are separated from CalculiX-specific code. +- **Reusable analysis modules:** scripts orchestrate package functionality instead of duplicating equations. +- **Explicit result parsing:** FEA quantities come from solver-generated files rather than hard-coded outputs. +- **Testable components:** analytical, parsing, configuration, analysis and agent logic are covered by automated tests. +- **Reproducible studies:** committed CSV results and figures provide traceable study outputs. +--- -Development Environment +## 10. Automated Reporting -Primary development workflow: +BodySimPy generates both engineering-facing and management-facing summaries programmatically. -Linux through WSL / Ubuntu; -Python virtual environment; -Visual Studio Code; -Git; -GitHub; -CalculiX; -NumPy; -SciPy; -pandas; -Matplotlib; -Pydantic; -Typer; -pytest; -Ruff; -mypy; -PyTorch; -GitHub Copilot. +- [Engineering Summary PDF](reports/BodySimPy_Engineering_Summary.pdf) +- [Management Summary PowerPoint](reports/BodySimPy_Management_Summary.pptx) -What I Learned +This separates engineering calculations from presentation formatting and demonstrates how simulation results can be transformed into repeatable decision-support artifacts. -BodySimPy reinforced several engineering-development principles. +--- -Automate repetitive engineering work +## 11. Installation -Python provides significantly more value when it controls the complete simulation workflow rather than merely post-processing isolated files. +### Requirements -Validate numerical models +- Linux or WSL recommended +- Python **3.11 or 3.12** +- CalculiX (`ccx`) for FEA/integration studies -Finite-element output should not be accepted only because a solver completed successfully. Analytical references, mesh studies, trend checks and explicit assumptions are essential. +Clone and create a virtual environment: -Separate physics from software infrastructure +```bash +git clone https://github.com/savbcar/BodySimPy.git +cd BodySimPy -Domain models, solver adapters, parsers, analyses and reporting become easier to test when responsibilities are separated. +python -m venv .venv +source .venv/bin/activate +python -m pip install --upgrade pip +python -m pip install -e ".[dev]" +``` -Quantify uncertainty rather than hiding it +Install the optional machine-learning dependency when running the PyTorch studies: -A deterministic baseline gives one answer. Stochastic studies reveal how response distributions change when engineering inputs vary. +```bash +python -m pip install -e ".[ml]" +``` -ML usefulness depends on economics as well as accuracy +On Ubuntu/WSL, CalculiX can be installed with: -A surrogate is valuable only when its prediction quality, training-data cost, evaluation volume and domain of validity make the trade-off worthwhile. +```bash +sudo apt-get update +sudo apt-get install -y calculix-ccx +``` -AI output still requires engineering judgement +Confirm the solver is available: -AI coding tools can accelerate exploration and testing, but physical assumptions, numerical methods and final implementation decisions remain human engineering responsibilities. +```bash +ccx -v +``` -Communication is part of engineering +--- -A technically correct Python workflow is incomplete if its results cannot be communicated clearly to engineers, reviewers and decision-makers. +## 12. Quality Gate -Limitations +Before a change is considered complete, run: -BodySimPy is a portfolio and engineering-method development project. Its results must be interpreted within the assumptions of the implemented model. +```bash +ruff format --check . +ruff check . +mypy src +python -m pytest +``` -Current limitations include: +GitHub Actions executes the same quality workflow on **Python 3.11 and 3.12** and installs CalculiX so solver-dependent integration tests can run in CI. -the structural geometry is a simplified crossmember surrogate rather than a production body-in-white model; -beam idealization does not represent detailed shell geometry, spot welds, adhesives, joints, local stamped features or contact; -materials are currently represented using simplified linear-elastic isotropic behaviour; -boundary conditions and loads are idealized; -finite-element validation is primarily against analytical mechanics rather than physical vehicle-test data; -numerical agreement with the analytical surrogate does not constitute validation of a real automotive structure; -stochastic input distributions are study assumptions rather than measured manufacturing distributions; -sampled threshold-exceedance fractions are not real-world failure probabilities; -simple correlation and regression sensitivity metrics are screening tools rather than full global sensitivity analysis; -the initial fatigue model uses simplified S-N and Palmgren-Miner damage assumptions; -fatigue calculations do not yet model weld classes, notch effects, rainflow counting, mean-stress correction, multiaxial fatigue, low-cycle fatigue or crack growth; -the PyTorch surrogate reproduces the underlying CalculiX model and cannot improve the physical fidelity of its training labels; -ML accuracy has only been demonstrated inside the sampled parameter domain; -surrogate predictions outside that domain should not be treated as validated extrapolation; -runtime comparisons depend on hardware, solver settings and benchmarking methodology; -statistical outlier detection in the QA workflow is a screening heuristic; -Simulation QA statuses support engineering review and do not replace engineering sign-off; -AI-assisted development tools may propose incorrect code or engineering assumptions and therefore require human validation. +--- -These limitations are intentionally documented because acknowledging model boundaries is part of responsible engineering analysis. +## 13. Running Representative Studies -Future Development +Static/FEA validation: -Potential extensions include: +```bash +python scripts/run_fea_validation.py +``` -shell-element automotive structural models; -spot-weld and adhesive-joint representation; -additional static and dynamic load cases; -geometry import and richer meshing workflows; -experimental or high-fidelity reference validation; -nonlinear material behaviour; -buckling analysis; -transient structural dynamics; -rainflow cycle counting; -mean-stress corrections; -welded-joint fatigue classes; -global sensitivity analysis; -correlated manufacturing uncertainty; -optimization loops; -uncertainty-aware ML surrogates; -automatic model-domain checking before surrogate inference; -richer simulation QA tooling; -expanded CLI orchestration; -interactive engineering dashboards. - -Quick Start - -Clone the repository: +Modal analysis: -git clone https://github.com/savbcar/BodySimPy.git -cd BodySimPy +```bash +python scripts/run_modal_analysis.py +``` -Create and activate a virtual environment: +Thickness sweep: -python3.11 -m venv .venv -source .venv/bin/activate +```bash +python scripts/run_thickness_sweep.py +``` -Upgrade pip: +Stochastic study: -python -m pip install --upgrade pip +```bash +python scripts/run_stochastic_study.py +``` -Install BodySimPy and development dependencies: +Fatigue assessment: -python -m pip install -e ".[dev]" +```bash +python scripts/run_fatigue_analysis.py +``` -Install CalculiX on Ubuntu / WSL: +Train and evaluate the surrogate: -sudo apt update -sudo apt install calculix-ccx +```bash +python scripts/train_surrogate.py +python scripts/evaluate_surrogate.py +``` -Run the quality gate: +Generate reports: -ruff format --check . -ruff check . -mypy src -python -m pytest +```bash +python scripts/generate_reports.py +``` + +Run the simulation-QA demonstration: + +```bash +python scripts/run_simulation_qa.py +``` + +--- + +## 14. Development Workflow -Explore the CLI: +The repository is developed through focused feature branches and pull requests. Changes are validated using automated formatting, linting, static typing and tests before they are merged to `main`. -bodysim --help -Project Status +For AI-assisted work, generated suggestions are treated as proposals. Engineering assumptions and tests are reviewed by the developer before implementation, and unsupported physical behavior is rejected rather than implemented simply to satisfy generated code. + +--- -BodySimPy is under active development as a structural CAE and engineering-software portfolio project. +## 15. What I Learned -The focus is on: +This project strengthened my ability to connect mechanical-engineering reasoning with software-engineering practice: -reproducibility, validation, automation, explicit assumptions and engineering interpretation. +- translating structural assumptions into validated software models; +- automating external FEA tools from Python; +- parsing solver outputs and comparing them with analytical references; +- designing reproducible parameter and uncertainty studies; +- implementing simplified fatigue methods without overstating their validity; +- generating machine-learning training data from simulation workflows; +- evaluating surrogate accuracy together with computational cost; +- building CI-tested, typed and modular engineering Python code; and +- using AI development tools while retaining human responsibility for engineering decisions. + +--- + +## 16. Engineering Limitations + +BodySimPy intentionally uses a simplified structural surrogate and should not be interpreted as a vehicle-body durability, crash, NVH, or production-signoff model. + +Key limitations include: + +- beam-level representation rather than shell/solid body-in-white geometry; +- idealized boundary conditions and loading; +- linear-elastic material behavior; +- no contact, joints, spot welds, adhesives or manufacturing effects; +- no experimental correlation; +- simplified analytical references based on beam theory; +- simplified S-N / Palmgren-Miner fatigue assessment; +- Monte Carlo inputs chosen for workflow demonstration rather than validated production tolerances; +- surrogate validity restricted to the sampled design space; and +- runtime benchmarks dependent on hardware, solver setup and measurement methodology. + +These limitations are kept explicit because engineering automation is only useful when the assumptions behind the automation remain visible. + +--- + +## 17. Future Development + +Potential extensions include: + +- shell-element structural models; +- joint/spot-weld representation; +- multiple load cases and load combinations; +- richer structural-dynamics and NVH studies; +- rainflow counting and mean-stress correction for fatigue; +- validated material- and joint-specific fatigue data; +- global sensitivity methods and more formal uncertainty quantification; +- hyperparameter optimization and uncertainty-aware surrogate models; +- experiment tracking and model/version provenance; and +- richer engineering dashboards and report visualizations. + +--- -License +## License -MIT License. \ No newline at end of file +This project is released under the [MIT License](LICENSE).