# Automation of Experimental Modal Analysis Using Bayesian Optimization (AutoEMA)
[DOWNLOAD THE PAPER](https://www.mdpi.com/2076-3417/13/2/949/pdf?version=1673514238)
Implementation of the paper "Automation of Experimental Modal Analysis Using Bayesian Optimization". For further information, please check the publication.
Cite as:
```
@Article{ellinger2023autoema,
AUTHOR = {Ellinger, Johannes and Beck, Leopold and Benker, Maximilian and Hartl, Roman and Zaeh, Michael F.},
TITLE = {Automation of Experimental Modal Analysis Using Bayesian Optimization},
JOURNAL = {Applied Sciences},
VOLUME = {13},
YEAR = {2023},
NUMBER = {2},
ARTICLE-NUMBER = {949},
URL = {https://www.mdpi.com/2076-3417/13/2/949},
ISSN = {2076-3417},
ABSTRACT = {The dynamic characterization of structures by means of modal parameters offers many valuable insights into the vibrational behavior of these structures. However, modal parameter estimation has traditionally required expert knowledge and cumbersome manual effort such as, for example, the selection of poles from a stabilization diagram. Automated approaches which replace the user inputs with a set of rules depending on the input data set have been developed to address this shortcoming. This paper presents an alternative approach based on Bayesian optimization. This way, the possible solution space for the modal parameter estimation is kept as widely open as possible while ensuring a high accuracy of the final modal model. The proposed approach was validated on both a synthetic test data set and experimental modal analysis data of a machine tool. Furthermore, it was benchmarked against a similar tool from a well-known numerical computation software application.},
DOI = {10.3390/app13020949}
}
```
# Installation
Pip is recommended to install this package. See [this](https://pip.pypa.io/en/stable/installation/) for more information.
```
pip install autoema
```
# Quick start
Import the package and load the example:
```python
from AutoEMA import AutoEMA as ae
```
Initializing the OptimizationModel (OptModel) and optimize it:
```python
frf, f = ae.load_example()
model = ae.OptModel(frf=frf, f_axis=f)
model.optimize(n_init=2, n_iter=2) # Do more iterations on real data
```
| iter | target | dist | err_ceta | err_fn | max_ceta | max_norm | min_poles | n_max |
-------------------------------------------------------------------------------------------------------------
| [0m 1 [0m | [0m 0.7799 [0m | [0m 1.901 [0m | [0m 0.158 [0m | [0m 0.001011[0m | [0m 0.2302 [0m | [0m 0.2027 [0m | [0m 0.2369 [0m | [0m 71.18 [0m |
| [0m 2 [0m | [0m 0.7799 [0m | [0m 1.644 [0m | [0m 0.1095 [0m | [0m 0.05434 [0m | [0m 0.2419 [0m | [0m 0.5797 [0m | [0m 0.2818 [0m | [0m 112.7 [0m |
| [0m 3 [0m | [0m 0.7799 [0m | [0m 2.281 [0m | [0m 0.09488 [0m | [0m 0.03839 [0m | [0m 0.2495 [0m | [0m 0.6356 [0m | [0m 0.5874 [0m | [0m 72.3 [0m |
| [0m 4 [0m | [0m 0.7799 [0m | [0m 0.5249 [0m | [0m 0.1351 [0m | [0m 0.01548 [0m | [0m 0.2752 [0m | [0m 0.1158 [0m | [0m 0.2957 [0m | [0m 66.13 [0m |
=============================================================================================================
Visualize the result by plotting the stability diagram:
```python
_ = model.plot_stability_diagram()
```
![png](README_files/README_8_0.png)
Visualize the damping ratios:
```python
model.plot_damping_ratios()
```
![png](README_files/README_10_0.png)
Print the results of the optimized modal analysis:
```python
print(model)
```
Model order: 22
FRAC: 100.0%
Natural frequencies: ['11.2', '33.3', '53.4', '78.4', '96.9', '118.4', '154.6', '167.6', '176.3', '199.4', '233.0', '244.5', '270.3', '284.7', '290.7', '325.3', '338.9', '368.2', '372.1', '377.8', '391.8', '395.4']
Damping ratios: ['0.145', '0.051', '0.035', '0.027', '0.025', '0.023', '0.023', '0.023', '0.024', '0.024', '0.026', '0.027', '0.028', '0.029', '0.029', '0.032', '0.032', '0.034', '0.035', '0.035', '0.036', '0.036']
Get the modal parameters:
```python
reconstructed_frf, freq_axis, nat_freqs, damp_ratios, mode_shapes = model.get_results()
FRAC = model.get_frac()
```
Have a look at the optimized parameter:
```python
optimized_params = model.params
print(optimized_params)
```
{'n_max': 71, 'err_fn': 0.0010113231069171437, 'err_ceta': 0.15804867401632372, 'min_ceta': 0, 'max_ceta': 0.23023325726318397, 'dist': 1.9012792169292663, 'min_poles': 0.23693543790751914, 'max_norm': 0.20272912357197914}
Using the same optimized parameters for another modal analysis without optimizing again:
```python
bmodel = ae.BaseModel(frf=frf, f_axis=f, params=optimized_params)
bmodel.run()
print(bmodel)
```
Model order: 22
FRAC: 100.0%
Natural frequencies: ['11.2', '33.3', '53.4', '78.4', '96.9', '118.4', '154.6', '167.6', '176.3', '199.4', '233.0', '244.5', '270.3', '284.7', '290.7', '325.3', '338.9', '368.2', '372.1', '377.8', '391.8', '395.4']
Damping ratios: ['0.145', '0.051', '0.035', '0.027', '0.025', '0.023', '0.023', '0.023', '0.024', '0.024', '0.026', '0.027', '0.028', '0.029', '0.029', '0.032', '0.032', '0.034', '0.035', '0.035', '0.036', '0.036']
## Advanced
Play around with the regularization parameter when optimizing the model. An increasing regularization parameter leads to a lower model order.
```python
model = ae.OptModel(frf=frf, f_axis=f, reg=0.1, show_progress=False)
model.optimize(n_init=10, n_iter=10)
print(model)
```
Model order: 20
FRAC: 100.0%
Natural frequencies: ['11.2', '33.3', '53.4', '78.4', '96.9', '118.4', '154.6', '167.6', '176.3', '199.4', '233.0', '244.5', '270.3', '284.7', '290.7', '325.3', '338.9', '370.2', '377.8', '393.7']
Damping ratios: ['0.145', '0.051', '0.035', '0.027', '0.025', '0.023', '0.023', '0.023', '0.024', '0.024', '0.026', '0.027', '0.028', '0.029', '0.029', '0.032', '0.032', '0.034', '0.035', '0.036']
Raw data
{
"_id": null,
"home_page": "https://github.com/leo-beck/AutoEMA",
"name": "AutoEMA",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7, <4",
"maintainer_email": "",
"keywords": "EMA,modal,analysis,automated,mechanics,bayes,bayesian,optimization",
"author": "Leopold Beck",
"author_email": "l.beck@tum.de",
"download_url": "https://files.pythonhosted.org/packages/f1/8f/3cb4a038dfe4fc83c3181043e9bc1da5a591fd0bf1ad9e97041de64016d7/AutoEMA-0.0.tar.gz",
"platform": null,
"description": "# Automation of Experimental Modal Analysis Using Bayesian Optimization (AutoEMA)\n[DOWNLOAD THE PAPER](https://www.mdpi.com/2076-3417/13/2/949/pdf?version=1673514238)\n\nImplementation of the paper \"Automation of Experimental Modal Analysis Using Bayesian Optimization\". For further information, please check the publication. \nCite as:\n```\n@Article{ellinger2023autoema,\n AUTHOR = {Ellinger, Johannes and Beck, Leopold and Benker, Maximilian and Hartl, Roman and Zaeh, Michael F.},\n TITLE = {Automation of Experimental Modal Analysis Using Bayesian Optimization},\n JOURNAL = {Applied Sciences},\n VOLUME = {13},\n YEAR = {2023},\n NUMBER = {2},\n ARTICLE-NUMBER = {949},\n URL = {https://www.mdpi.com/2076-3417/13/2/949},\n ISSN = {2076-3417},\n ABSTRACT = {The dynamic characterization of structures by means of modal parameters offers many valuable insights into the vibrational behavior of these structures. However, modal parameter estimation has traditionally required expert knowledge and cumbersome manual effort such as, for example, the selection of poles from a stabilization diagram. Automated approaches which replace the user inputs with a set of rules depending on the input data set have been developed to address this shortcoming. This paper presents an alternative approach based on Bayesian optimization. This way, the possible solution space for the modal parameter estimation is kept as widely open as possible while ensuring a high accuracy of the final modal model. The proposed approach was validated on both a synthetic test data set and experimental modal analysis data of a machine tool. Furthermore, it was benchmarked against a similar tool from a well-known numerical computation software application.},\n DOI = {10.3390/app13020949}\n}\n```\n\n# Installation\n\nPip is recommended to install this package. See [this](https://pip.pypa.io/en/stable/installation/) for more information.\n\n```\npip install autoema\n```\n\n# Quick start\nImport the package and load the example:\n\n\n```python\nfrom AutoEMA import AutoEMA as ae\n```\n\nInitializing the OptimizationModel (OptModel) and optimize it:\n\n\n```python\nfrf, f = ae.load_example() \nmodel = ae.OptModel(frf=frf, f_axis=f) \nmodel.optimize(n_init=2, n_iter=2) # Do more iterations on real data \n```\n\n | iter | target | dist | err_ceta | err_fn | max_ceta | max_norm | min_poles | n_max |\n -------------------------------------------------------------------------------------------------------------\n | \u001b[0m 1 \u001b[0m | \u001b[0m 0.7799 \u001b[0m | \u001b[0m 1.901 \u001b[0m | \u001b[0m 0.158 \u001b[0m | \u001b[0m 0.001011\u001b[0m | \u001b[0m 0.2302 \u001b[0m | \u001b[0m 0.2027 \u001b[0m | \u001b[0m 0.2369 \u001b[0m | \u001b[0m 71.18 \u001b[0m |\n | \u001b[0m 2 \u001b[0m | \u001b[0m 0.7799 \u001b[0m | \u001b[0m 1.644 \u001b[0m | \u001b[0m 0.1095 \u001b[0m | \u001b[0m 0.05434 \u001b[0m | \u001b[0m 0.2419 \u001b[0m | \u001b[0m 0.5797 \u001b[0m | \u001b[0m 0.2818 \u001b[0m | \u001b[0m 112.7 \u001b[0m |\n | \u001b[0m 3 \u001b[0m | \u001b[0m 0.7799 \u001b[0m | \u001b[0m 2.281 \u001b[0m | \u001b[0m 0.09488 \u001b[0m | \u001b[0m 0.03839 \u001b[0m | \u001b[0m 0.2495 \u001b[0m | \u001b[0m 0.6356 \u001b[0m | \u001b[0m 0.5874 \u001b[0m | \u001b[0m 72.3 \u001b[0m |\n | \u001b[0m 4 \u001b[0m | \u001b[0m 0.7799 \u001b[0m | \u001b[0m 0.5249 \u001b[0m | \u001b[0m 0.1351 \u001b[0m | \u001b[0m 0.01548 \u001b[0m | \u001b[0m 0.2752 \u001b[0m | \u001b[0m 0.1158 \u001b[0m | \u001b[0m 0.2957 \u001b[0m | \u001b[0m 66.13 \u001b[0m |\n =============================================================================================================\n\n\nVisualize the result by plotting the stability diagram:\n\n\n```python\n_ = model.plot_stability_diagram() \n```\n\n\n \n![png](README_files/README_8_0.png)\n \n\n\nVisualize the damping ratios:\n\n\n```python\nmodel.plot_damping_ratios()\n```\n\n\n \n![png](README_files/README_10_0.png)\n \n\n\nPrint the results of the optimized modal analysis:\n\n\n```python\nprint(model)\n```\n\n Model order: 22\n FRAC: 100.0%\n Natural frequencies: ['11.2', '33.3', '53.4', '78.4', '96.9', '118.4', '154.6', '167.6', '176.3', '199.4', '233.0', '244.5', '270.3', '284.7', '290.7', '325.3', '338.9', '368.2', '372.1', '377.8', '391.8', '395.4']\n Damping ratios: ['0.145', '0.051', '0.035', '0.027', '0.025', '0.023', '0.023', '0.023', '0.024', '0.024', '0.026', '0.027', '0.028', '0.029', '0.029', '0.032', '0.032', '0.034', '0.035', '0.035', '0.036', '0.036']\n\n\nGet the modal parameters:\n\n\n```python\nreconstructed_frf, freq_axis, nat_freqs, damp_ratios, mode_shapes = model.get_results() \nFRAC = model.get_frac() \n```\n\nHave a look at the optimized parameter:\n\n\n```python\noptimized_params = model.params\nprint(optimized_params)\n```\n\n {'n_max': 71, 'err_fn': 0.0010113231069171437, 'err_ceta': 0.15804867401632372, 'min_ceta': 0, 'max_ceta': 0.23023325726318397, 'dist': 1.9012792169292663, 'min_poles': 0.23693543790751914, 'max_norm': 0.20272912357197914}\n\n\nUsing the same optimized parameters for another modal analysis without optimizing again:\n\n\n```python\nbmodel = ae.BaseModel(frf=frf, f_axis=f, params=optimized_params)\nbmodel.run()\nprint(bmodel)\n```\n\n Model order: 22\n FRAC: 100.0%\n Natural frequencies: ['11.2', '33.3', '53.4', '78.4', '96.9', '118.4', '154.6', '167.6', '176.3', '199.4', '233.0', '244.5', '270.3', '284.7', '290.7', '325.3', '338.9', '368.2', '372.1', '377.8', '391.8', '395.4']\n Damping ratios: ['0.145', '0.051', '0.035', '0.027', '0.025', '0.023', '0.023', '0.023', '0.024', '0.024', '0.026', '0.027', '0.028', '0.029', '0.029', '0.032', '0.032', '0.034', '0.035', '0.035', '0.036', '0.036']\n\n\n## Advanced\nPlay around with the regularization parameter when optimizing the model. An increasing regularization parameter leads to a lower model order.\n\n\n```python\nmodel = ae.OptModel(frf=frf, f_axis=f, reg=0.1, show_progress=False) \nmodel.optimize(n_init=10, n_iter=10)\nprint(model)\n```\n\n Model order: 20\n FRAC: 100.0%\n Natural frequencies: ['11.2', '33.3', '53.4', '78.4', '96.9', '118.4', '154.6', '167.6', '176.3', '199.4', '233.0', '244.5', '270.3', '284.7', '290.7', '325.3', '338.9', '370.2', '377.8', '393.7']\n Damping ratios: ['0.145', '0.051', '0.035', '0.027', '0.025', '0.023', '0.023', '0.023', '0.024', '0.024', '0.026', '0.027', '0.028', '0.029', '0.029', '0.032', '0.032', '0.034', '0.035', '0.036']\n\n",
"bugtrack_url": null,
"license": "",
"summary": "Automated Experimental Modal Analysis using Bayesian Optimization",
"version": "0.0",
"split_keywords": [
"ema",
"modal",
"analysis",
"automated",
"mechanics",
"bayes",
"bayesian",
"optimization"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f18f3cb4a038dfe4fc83c3181043e9bc1da5a591fd0bf1ad9e97041de64016d7",
"md5": "b169ca2ca5f877b56fc8d7d3873513a9",
"sha256": "45a1e4036332a552b2349d03f5895c8c4050a307cb9a9e7e166d5d09be937c68"
},
"downloads": -1,
"filename": "AutoEMA-0.0.tar.gz",
"has_sig": false,
"md5_digest": "b169ca2ca5f877b56fc8d7d3873513a9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7, <4",
"size": 11355,
"upload_time": "2023-01-13T19:43:34",
"upload_time_iso_8601": "2023-01-13T19:43:34.965229Z",
"url": "https://files.pythonhosted.org/packages/f1/8f/3cb4a038dfe4fc83c3181043e9bc1da5a591fd0bf1ad9e97041de64016d7/AutoEMA-0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-13 19:43:34",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "leo-beck",
"github_project": "AutoEMA",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "autoema"
}