{"id":20947465,"url":"https://github.com/edgar-mendonca/shpb-analysis","last_synced_at":"2025-04-11T16:36:45.090Z","repository":{"id":229566574,"uuid":"777055805","full_name":"Edgar-Mendonca/SHPB-Analysis","owner":"Edgar-Mendonca","description":"Python based SHPB Experimental data analysis","archived":false,"fork":false,"pushed_at":"2024-04-05T05:20:45.000Z","size":1551,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-11T16:36:35.274Z","etag":null,"topics":["matplotlib","numpy","pandas","python","scipy"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Edgar-Mendonca.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-25T05:23:27.000Z","updated_at":"2024-09-30T09:40:50.000Z","dependencies_parsed_at":"2024-04-05T06:26:59.266Z","dependency_job_id":null,"html_url":"https://github.com/Edgar-Mendonca/SHPB-Analysis","commit_stats":null,"previous_names":["edgar-mendonca/shpb-analysis"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Edgar-Mendonca%2FSHPB-Analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Edgar-Mendonca%2FSHPB-Analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Edgar-Mendonca%2FSHPB-Analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Edgar-Mendonca%2FSHPB-Analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Edgar-Mendonca","download_url":"https://codeload.github.com/Edgar-Mendonca/SHPB-Analysis/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248441461,"owners_count":21103996,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["matplotlib","numpy","pandas","python","scipy"],"created_at":"2024-11-19T00:11:28.252Z","updated_at":"2025-04-11T16:36:45.069Z","avatar_url":"https://github.com/Edgar-Mendonca.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SHPB Analysis Tool\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/Edgar-Mendonca/SHPB-Analysis/main/test_data/Figure_1.png\" height=\"300\" width=\"350\" /\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/Edgar-Mendonca/SHPB-Analysis/main/test_data/Figure_2.png\" height=\"300\" width=\"300\" /\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/Edgar-Mendonca/SHPB-Analysis/main/test_data/Figure_3.png\" height=\"300\" width=\"400\" /\u003e\n\u003c/p\u003e\n\nThis Python script analyses Split Hopkinson Pressure Bar (SHPB) experimental data to calculate stress-strain curves and other relevant parameters. Follow the instructions below to use the script with your experimental data.\n\n## Instructions\n\n1. **Install Dependencies:** Make sure you have Python installed on your system. You can install the required Python packages by running the following command:\n\n    ```\n    pip install -r requirements.txt\n    ```\n\n2. **Prepare Experimental Data:**\n\n    - Ensure that your experimental data is stored in a CSV or Excel file.\n    - The file should contain columns for \"Time\", \"Incident\", \"Reflected\", and \"Transmitted\" voltages.\n    - Voltage values should be in volts (V).\n    - Specify the file name in the Python script (`analysis.py`) using the `filename` variable. For example:\n\n    ```python\n    filename = \"path/to/your/data_file.csv\"\n    ```\n\n3. **Customize Input Parameters:**\n\n    - Open the Python script (`analysis.py`) in a text editor.\n    - Update the input parameters according to your experiment setup. Parameters such as Young's modulus, density, initial length, and cross-sectional areas should be adjusted based on your experimental conditions.\n\n4. **Run the Script:**\n\n    - Run the script using the following command:\n\n    ```\n    python analysis.py\n    ```\n\n5. **View Plots and Analyze Results:**\n\n    - After running the script, view the generated plots to analyze the results.\n    - The script will generate plots for filtered voltage data, strain data, stress-strain curve, and true stress-strain curve.\n\n## Example Usage\n\nHere's an example of how to use the script with your experimental data:\n\n1. Ensure that Python and the required dependencies are installed on your system.\n2. Prepare your experimental data in a CSV or Excel file format.\n3. Customize the input parameters in the `analysis.py` script based on your experiment setup.\n4. Specify the file name of your experimental data in the script.\n5. Run the script using `python analysis.py`.\n6. Analyze the generated plots to interpret the results of your SHPB experiment.\n\n\n\n## Explanation for Stress-Strain Calculation in SHPB Experiment\n\nIn the Split Hopkinson Pressure Bar (SHPB) experiment, the characteristic relations associated with one-dimensional elastic wave propagation in the bar provide the basis for calculating stress and strain in the specimen.\n\n1. **Particle Velocity at Specimen/Input-Bar and Specimen/Output-Bar Interface:**\n   - The particle velocity $` v_1(t) `$ at the specimen/input-bar interface is given by:\n     $` v_1(t) = c_b(\\varepsilon_I - \\varepsilon_R) `$ \n   - Here, $` c_b = \\sqrt{\\frac{E_b}{\\rho_b}} `$ represents the bar wave speed, with $` E_b `$ denoting the Young's modulus and $` \\rho_b `$ the density of the bar material.\n   - The particle velocity $` v_2(t) `$ at the specimen/output-bar interface is given by:\n     $` v_2(t) = c_b \\varepsilon_T `$ \n\n2. **Mean Axial Strain Rate in the Specimen:**\n   - The mean axial strain rate $` \\dot{e}_s `$ in the specimen is calculated as:\n     $` \\dot{e}_s = \\frac{c_b}{l_0} (\\varepsilon_I - \\varepsilon_R - \\varepsilon_T) = \\frac{v_1 - v_2}{l_0} `$ \n   - Here, $` l_0 `$ represents the initial specimen length.\n\n3. **Calculation of Bar Stresses and Normal Forces:**\n   - The stresses and normal forces at the specimen/bar interfaces are computed as follows:\n     - $` P_1 = E_b (\\varepsilon_I + \\varepsilon_R) A_b `$ at the specimen/input-bar interface.\n     - $` P_2 = E_b \\varepsilon_T A_b `$ at the specimen/output-bar interface.\n   - Here, $` A_b `$ denotes the cross-sectional area of the bars.\n\n4. **Mean Axial Stress in the Specimen:**\n   - The mean axial stress $` \\bar{S}_s(t) `$ in the specimen is given by:\n     $` \\bar{S}_s(t) = \\frac{(P_1 + P_2)}{2} \\left( \\frac{1}{A_s} \\right) `$ \n   - Here, $` A_s `$ represents the initial cross-sectional area of the specimen.\n\n5. **Stress-Strain Relationship:**\n   - Assuming stress equilibrium, uniaxial stress conditions in the specimen, and one-dimensional elastic stress wave propagation without dispersion in the bars, the nominal strain rate $` \\dot{e}_s `$, nominal strain $` e_s `$, and nominal stress $` S_s `$ in the specimen are estimated using:\n     -  $` \\dot{e}_s(t) = \\frac{2c_b}{l_0} \\varepsilon_R(t) `$ \n     -  $` e_s(t) = \\int_0^t \\dot{e}_s(\\tau) d\\tau `$ \n     -  $` S_s(t) = \\frac{E_b A_b}{A_s} \\varepsilon_T(t) `$\n    \n6. **True Stress-Strain:**\n   - True strain $\\varepsilon_s(t)$ in the specimen is given by:\n      - $\\varepsilon_s(t) = -\\ln(1 - e_s(t))$   \u003cbr /\u003e\n     Here, $e_s(t)$ represents the engineering strain in the specimen.\n\n   - The true strain rate $\\dot{\\varepsilon}_s(t)$ in the specimen is calculated as:\n      - $\\dot{\\varepsilon}_s(t) = \\frac{\\dot{e}_s(t)}{1 - e_s(t)}$\n\n   - The true stress $\\sigma_s(t)$ in the specimen is obtained as:\n        - $\\sigma_s(t) = S_s(t) \\cdot (1 - e_s(t))$    \u003cbr /\u003e\n     Here, $S_s(t)$ represents the nominal stress in the specimen.\n\n# SHPB Cropping Tool\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/Edgar-Mendonca/SHPB-Analysis/main/test_data/Figure_4.png\" height=\"\" width=\"\" /\u003e\n\u003c/p\u003e\n\n1. **Data Preparation:**\n   - Prepare your SHPB data in CSV format. Each CSV file should contain three columns: 'Time' and the respective voltage data (e.g., 'Incident' and  'Transmitted').\n\n2. **Launching the Tool:**\n   - Run the Python script `crop.py`.\n   - The tool will display a graphical interface with multiple subplots.\n\n3. **Selecting Regions:**\n   - For Incident Voltage: Click and drag on the subplot (labelled 'Incident Voltage') to select a region of interest.\n   - For Reflected Voltage: Click and drag on the subplot (labelled 'Reflected Voltage') to select a region of interest.\n   - For Transmitted Voltage: Click and drag on the subplot (labelled 'Transmitted Voltage') to select a region of interest.\n\n4. **Saving Selected Data:**\n   - The selected regions will be displayed on their respective subplots.\n   - The selected data will be saved automatically to CSV files in the same directory as the script.\n     - Selected Incident Voltage data will be saved to `selected_incident.csv`.\n     - Selected Reflected Voltage data will be saved to `selected_reflected.csv`.\n     - Selected Transmitted Voltage data will be saved to `selected_transmitted.csv`.\n\n\n\n### Reference\n\nThe theory and equations used in this project are based on the following sources:\n\n- Ramesh, K.T. (2008). High Rates and Impact Experiments. In: Sharpe, W. (eds) *Springer Handbook of Experimental Solid Mechanics*. Springer Handbooks. Springer, Boston, MA. [DOI: 10.1007/978-0-387-30877-7_33](https://doi.org/10.1007/978-0-387-30877-7_33)\n- Kolsky, H. (1963). Stress Waves in Solids. *United Kingdom: Dover Publications*.\n\n## License\n\nThis project is licensed under the  Apache-2.0 License. - see the [LICENSE](LICENSE) file for details.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedgar-mendonca%2Fshpb-analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedgar-mendonca%2Fshpb-analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedgar-mendonca%2Fshpb-analysis/lists"}