-
Notifications
You must be signed in to change notification settings - Fork 5
Add Testing Documentation for Standalone Detailed Inspection #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
+130
−0
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7590d04
atc-138matlab with redtag fix
wangz539 9fdf134
Revert "atc-138matlab with redtag fix"
wangz539 30edff3
Merge branch 'main' of https://github.com/hgp297/Functional-Recovery-…
wangz539 d6d7502
Add testing markdown doc for standalone detailed inspection
wangz539 7c9f06c
Add testing markdown doc for standalone detailed inspection
wangz539 c666181
Merge branch 'testing-doc' of https://github.com/hgp297/Functional-Re…
wangz539 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,130 @@ | ||
| { | ||
| "cells": [ | ||
| { | ||
| "cell_type": "markdown", | ||
| "id": "c60b39da", | ||
| "metadata": {}, | ||
| "source": [ | ||
| "### ATC-138 Python Numerical Validation Testing Against MATLAB\n", | ||
| "\n", | ||
| "#### 1. Overview\n", | ||
| "\n", | ||
| "This documentation provides instructions on how to validate ATC-138 Python implementation against the original MATLAB framework for numerical consistency and correct reproduction of calculations.\n", | ||
| "\n", | ||
| "The focus is on the standalone use of the comparison engine (`compare_runs.py`) for users who need to validate their own Python and MATLAB models.\n", | ||
| "\n", | ||
| "The goal is to:\n", | ||
| "- Explain the testing metrics used\n", | ||
| "- Outline the testing workflow\n", | ||
| "\n", | ||
| "This workflow is independent of the integration tests and can be applied to any model. Two example models are included here for demonstration purposes.\n", | ||
| "\n", | ||
| "#### 2. Example Models Used \n", | ||
| "\n", | ||
| "| Model | Description |\n", | ||
| "|------|-------------|\n", | ||
| "| ICSB | 6-story special moment frame |\n", | ||
| "| haseltonRCMF_4story | 4-story reinforced concrete moment frame building |\n", | ||
| "\n", | ||
| "\n", | ||
| "#### 3. Validation Workflow\n", | ||
| "\n", | ||
| "1. Run the MATLAB ATC-138 implementation using the provided example inputs.\n", | ||
| "2. Run the Python ATC-138 implementation using the same demand/data. \n", | ||
| "3. Extract both output files `recovery_outputs`. \n", | ||
| "4. Compare Python and MATLAB outputs using quantitative metrics using `compare_runs.py`.\n", | ||
| "5. Evaluate whether results fall within acceptable tolerance thresholds.\n", | ||
| "\n", | ||
| "#### 4. Comparison Metrics\n", | ||
| "\n", | ||
| "Four quantitative metrics are used to evaluate agreement between MATLAB and Python results:\n", | ||
| "\n", | ||
| "</br>\n", | ||
| "\n", | ||
| "**Metric 1 — Absolute difference of mean functional recovery time**\n", | ||
| "\n", | ||
| "```| mean_FR_python − mean_FR_matlab |```\n", | ||
| "\n", | ||
| "Units: ```days```\n", | ||
| "\n", | ||
| "Threshold: ```≤ 2 days```\n", | ||
| "\n", | ||
| "</br>\n", | ||
| "\n", | ||
| "**Metric 2 — Relative difference of mean functional recovery time**\n", | ||
| "\n", | ||
| "```| mean_FR_python − mean_FR_matlab | / mean_FR_matlab```\n", | ||
| "\n", | ||
| "Units: ```percent```\n", | ||
| "\n", | ||
| "Threshold: ```≤ 4 %```\n", | ||
| "\n", | ||
| "</br>\n", | ||
| "\n", | ||
| "**Metric 3 — Worst system mean absolute error (MAE)**\n", | ||
| "\n", | ||
| "System-level wise, the maximum MAE of the fraction of unresolved damage over time, across all functional-recovery and reoccupancy systems. \n", | ||
| "\n", | ||
| "Threshold: ```≤ 0.02``` (maximum mean difference of 2% unresolved fraction)\n", | ||
| "\n", | ||
| "</br>\n", | ||
| "\n", | ||
| "**Metric 4 — Worst system 95th percentile absolute error**\n", | ||
| "\n", | ||
| "System-level wise, the maximum 95th percentile aboslute error of the fraction of unresolved damage over time, across all functional-recovery and reoccupancy systems. \n", | ||
| "\n", | ||
| "Threshold: ```≤ 0.04``` (maximum mean difference of 4% unresolved fraction)\n", | ||
| "\n", | ||
| "</br>\n", | ||
| "\n", | ||
| "#### 5. Recovery Trajectory and System-Level Recovery Comparison\n", | ||
| "\n", | ||
| "For each model, plots of recovery trajectories and system-level recovery curves are saved: \n", | ||
| "\n", | ||
| "- `recovery_trajectory.jpg`\n", | ||
| "- `system_breakdowns_functional.jpg`\n", | ||
| "- `system_breakdowns_reoccupancy.jpg`\n", | ||
| "\n", | ||
| "\n", | ||
| "#### 6. Validation Results\n", | ||
| "\n", | ||
| "The comparison results for the two example models are summarized below. Twenty batch runs were carried out for each model, and the mean values are compared against the defined metrics.\n", | ||
| "\n", | ||
| "| Model | Absolute difference (days) | Relative difference (%) | Worst system MAE | Worst system P95 |\n", | ||
| "|------|------|------|------|------|\n", | ||
| "| ICSB | 1.38 | 0.241 | 0.015 | 0.030 |\n", | ||
| "| haseltonRCMF_4story | 1.74 | 1.61 | 0.007 | 0.027 |\n", | ||
| "\n", | ||
| "\n", | ||
| "All comparison metrics here fall within the defined tolerance thresholds." | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
| "id": "0d7cebb0", | ||
| "metadata": {}, | ||
| "source": [] | ||
| } | ||
| ], | ||
| "metadata": { | ||
| "kernelspec": { | ||
| "display_name": "Python 3", | ||
| "language": "python", | ||
| "name": "python3" | ||
| }, | ||
| "language_info": { | ||
| "codemirror_mode": { | ||
| "name": "ipython", | ||
| "version": 3 | ||
| }, | ||
| "file_extension": ".py", | ||
| "mimetype": "text/x-python", | ||
| "name": "python", | ||
| "nbconvert_exporter": "python", | ||
| "pygments_lexer": "ipython3", | ||
| "version": "3.11.9" | ||
| } | ||
| }, | ||
| "nbformat": 4, | ||
| "nbformat_minor": 5 | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.