-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: uncertainty calculation; fix: various fix
- Loading branch information
Dag Pasca
authored and
Dag Pasca
committed
Jan 23, 2025
1 parent
2952bed
commit 7634f44
Showing
33 changed files
with
1,843 additions
and
1,329 deletions.
There are no files selected for viewing
This file contains 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,93 @@ | ||
|
||
|
||
|
||
|
||
|
||
|
||
import os | ||
import sys | ||
import numpy as np | ||
# Add the directory we executed the script from to path: | ||
sys.path.insert(0, os.path.realpath('__file__')) | ||
|
||
# import the function to generate the example dataset | ||
from pyoma2.functions.gen import example_data | ||
|
||
# generate example data and results | ||
data, ground_truth = example_data() | ||
|
||
# Print the exact results | ||
np.set_printoptions(precision=3) | ||
print(f"the natural frequencies are: {ground_truth[0]} \n") | ||
print(f"the damping is: {ground_truth[2]} \n") | ||
print("the (column-wise) mode shape matrix: \n" | ||
f"{ground_truth[1]} \n") | ||
|
||
|
||
|
||
|
||
|
||
from pyoma2.setup.single import SingleSetup | ||
|
||
simp_5dof = SingleSetup(data, fs=600) | ||
|
||
|
||
|
||
|
||
|
||
# Decimate the data by factor 10 | ||
simp_5dof.decimate_data(q=20) | ||
|
||
|
||
|
||
|
||
|
||
from pyoma2.algorithms.fdd import FDD | ||
from pyoma2.algorithms.ssi import SSIdat | ||
|
||
# Initialise the algorithms | ||
fdd = FDD(name="FDD", nxseg=1024, method_SD="cor") | ||
ssidat = SSIdat(name="SSIdat", br=30, ordmax=30) | ||
|
||
# Add algorithms to the class | ||
simp_5dof.add_algorithms(fdd, ssidat) | ||
|
||
# run | ||
simp_5dof.run_all() | ||
|
||
|
||
|
||
|
||
|
||
# plot singular values of the spectral density matrix | ||
_, _ = fdd.plot_CMIF(freqlim=(0,8)) | ||
|
||
# plot the stabilisation diagram | ||
_, _ = ssidat.plot_stab(freqlim=(0,10),hide_poles=False) | ||
|
||
|
||
|
||
|
||
|
||
# get the modal parameters with the interactive plot | ||
# simp_ex.mpe_from_plot("SSIdat", freqlim=(0,10)) | ||
|
||
# or manually | ||
simp_5dof.mpe("SSIdat", sel_freq=[0.89, 2.598, 4.095, 5.261, 6.], order="find_min") | ||
|
||
|
||
|
||
|
||
|
||
# dict of results | ||
ssidat_res = dict(ssidat.result) | ||
|
||
from pyoma2.functions.plot import plot_mac_matrix | ||
|
||
# print the results | ||
print(f"order out: {ssidat_res['order_out']} \n") | ||
print(f"the natural frequencies are: {ssidat_res['Fn']} \n") | ||
print(f"the dampings are: {ssidat_res['Xi']} \n") | ||
print("the (column-wise) mode shape matrix:") | ||
print(f"{ssidat_res['Phi'].real} \n") | ||
_, _ = plot_mac_matrix(ssidat_res['Phi'].real, ground_truth[1]) |
This file contains 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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.