bcam-indar 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- bcam_indar-1.0.0/.gitignore +5 -0
- bcam_indar-1.0.0/LICENSE.txt +9 -0
- bcam_indar-1.0.0/PKG-INFO +52 -0
- bcam_indar-1.0.0/README.md +6 -0
- bcam_indar-1.0.0/environment.yml +26 -0
- bcam_indar-1.0.0/pyproject.toml +38 -0
- bcam_indar-1.0.0/requirements-test.in +1 -0
- bcam_indar-1.0.0/requirements-test.txt +16 -0
- bcam_indar-1.0.0/requirements.in +9 -0
- bcam_indar-1.0.0/requirements.txt +68 -0
- bcam_indar-1.0.0/src/bcam/indar/__init__.py +6 -0
- bcam_indar-1.0.0/src/bcam/indar/core/__init__.py +6 -0
- bcam_indar-1.0.0/src/bcam/indar/core/functions.py +141 -0
- bcam_indar-1.0.0/src/bcam/indar/dde/__init__.py +5 -0
- bcam_indar-1.0.0/src/bcam/indar/dde/matrices.py +646 -0
- bcam_indar-1.0.0/src/bcam/indar/ema/__init__.py +8 -0
- bcam_indar-1.0.0/src/bcam/indar/ema/derivatives.py +241 -0
- bcam_indar-1.0.0/src/bcam/indar/ema/helpers.py +53 -0
- bcam_indar-1.0.0/src/bcam/indar/ema/lti.py +292 -0
- bcam_indar-1.0.0/src/bcam/indar/ema/mechanical.py +1944 -0
- bcam_indar-1.0.0/src/bcam/indar/ema/pole_fitting.py +1100 -0
- bcam_indar-1.0.0/src/bcam/indar/ema/systems.py +204 -0
- bcam_indar-1.0.0/src/bcam/indar/ema/tests/__init__.py +0 -0
- bcam_indar-1.0.0/src/bcam/indar/ema/tests/test_lti.py +29 -0
- bcam_indar-1.0.0/src/bcam/indar/ema/tests/test_modes.py +413 -0
- bcam_indar-1.0.0/src/bcam/indar/ema/tests/test_pole_fitting.py +301 -0
- bcam_indar-1.0.0/src/bcam/indar/ema/tests/visual.py +139 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025, Basque Center for Applied Mathematics.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: bcam-indar
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Resources for the analysis of vibrations.
|
|
5
|
+
Project-URL: Repository, https://gitlab.bcamath.org/fponce/indar.git
|
|
6
|
+
Author-email: Felipe Ponce-Vanegas <fponce@bcamath.org>
|
|
7
|
+
License-Expression: MIT AND (Apache-2.0 OR BSD-2-Clause)
|
|
8
|
+
License-File: LICENSE.txt
|
|
9
|
+
Keywords: input/output,modal analysis,stability,vibration
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Intended Audience :: Science/Research
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Topic :: Scientific/Engineering
|
|
15
|
+
Requires-Python: >=3.13
|
|
16
|
+
Requires-Dist: attrs==26.1.0
|
|
17
|
+
Requires-Dist: contourpy==1.3.3
|
|
18
|
+
Requires-Dist: cycler==0.12.1
|
|
19
|
+
Requires-Dist: fonttools==4.62.1
|
|
20
|
+
Requires-Dist: jinja2==3.1.6
|
|
21
|
+
Requires-Dist: jitcode==1.7.3
|
|
22
|
+
Requires-Dist: jitcxde-common==1.5.6
|
|
23
|
+
Requires-Dist: joblib==1.5.3
|
|
24
|
+
Requires-Dist: kiwisolver==1.5.0
|
|
25
|
+
Requires-Dist: markupsafe==3.0.3
|
|
26
|
+
Requires-Dist: matplotlib==3.10.9
|
|
27
|
+
Requires-Dist: mpmath==1.3.0
|
|
28
|
+
Requires-Dist: numpy==2.4.4
|
|
29
|
+
Requires-Dist: packaging==26.2
|
|
30
|
+
Requires-Dist: pillow==12.2.0
|
|
31
|
+
Requires-Dist: pyparsing==3.3.2
|
|
32
|
+
Requires-Dist: python-dateutil==2.9.0.post0
|
|
33
|
+
Requires-Dist: scikit-learn==1.8.0
|
|
34
|
+
Requires-Dist: scipy==1.17.1
|
|
35
|
+
Requires-Dist: six==1.17.0
|
|
36
|
+
Requires-Dist: symengine==0.14.1
|
|
37
|
+
Requires-Dist: sympy==1.14.0
|
|
38
|
+
Requires-Dist: threadpoolctl==3.6.0
|
|
39
|
+
Provides-Extra: test
|
|
40
|
+
Requires-Dist: iniconfig==2.3.0; extra == 'test'
|
|
41
|
+
Requires-Dist: packaging==26.2; extra == 'test'
|
|
42
|
+
Requires-Dist: pluggy==1.6.0; extra == 'test'
|
|
43
|
+
Requires-Dist: pygments==2.20.0; extra == 'test'
|
|
44
|
+
Requires-Dist: pytest==9.0.3; extra == 'test'
|
|
45
|
+
Description-Content-Type: text/markdown
|
|
46
|
+
|
|
47
|
+
## Indar
|
|
48
|
+
|
|
49
|
+
Indar is an open-source Python package that provides algorithms and methods developed at the Basque Center for Applied Mathematics (BCAM)
|
|
50
|
+
for analyzing vibrations and assessing the stability of manufacturing operations in the aeronautics sector.
|
|
51
|
+
|
|
52
|
+
Contributions, feedback, and support are welcome.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
## Indar
|
|
2
|
+
|
|
3
|
+
Indar is an open-source Python package that provides algorithms and methods developed at the Basque Center for Applied Mathematics (BCAM)
|
|
4
|
+
for analyzing vibrations and assessing the stability of manufacturing operations in the aeronautics sector.
|
|
5
|
+
|
|
6
|
+
Contributions, feedback, and support are welcome.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# To use:
|
|
2
|
+
#
|
|
3
|
+
# $ mamba env create -f environment.yml # `conda` works too for this command
|
|
4
|
+
# $ mamba activate numpy-dev
|
|
5
|
+
#
|
|
6
|
+
name: indar-dev
|
|
7
|
+
channels:
|
|
8
|
+
- conda-forge
|
|
9
|
+
- defaults
|
|
10
|
+
dependencies:
|
|
11
|
+
- python>=3.13
|
|
12
|
+
- attrs
|
|
13
|
+
- pytest
|
|
14
|
+
- numpy
|
|
15
|
+
- scipy
|
|
16
|
+
- scikit-learn
|
|
17
|
+
- pandas
|
|
18
|
+
- matplotlib
|
|
19
|
+
- sympy
|
|
20
|
+
- pip>=23.1
|
|
21
|
+
- pip:
|
|
22
|
+
- hatch
|
|
23
|
+
- hatch-requirements-txt
|
|
24
|
+
- jitcode
|
|
25
|
+
- symengine
|
|
26
|
+
- pip-tools
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling >= 1.27.0", "hatch-requirements-txt"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[tool.hatch.build.targets.wheel]
|
|
6
|
+
packages = ["src/bcam"]
|
|
7
|
+
|
|
8
|
+
[project]
|
|
9
|
+
name = "bcam-indar"
|
|
10
|
+
version = "1.0.0"
|
|
11
|
+
authors = [
|
|
12
|
+
{ name = "Felipe Ponce-Vanegas", email = "fponce@bcamath.org"},
|
|
13
|
+
]
|
|
14
|
+
description = "Resources for the analysis of vibrations."
|
|
15
|
+
keywords = [
|
|
16
|
+
"vibration", "input/output", "stability", "modal analysis"
|
|
17
|
+
]
|
|
18
|
+
classifiers = [
|
|
19
|
+
"Development Status :: 4 - Beta",
|
|
20
|
+
"Intended Audience :: Science/Research",
|
|
21
|
+
"License :: OSI Approved :: MIT License",
|
|
22
|
+
"Programming Language :: Python :: 3",
|
|
23
|
+
"Topic :: Scientific/Engineering",
|
|
24
|
+
]
|
|
25
|
+
requires-python = ">= 3.13"
|
|
26
|
+
dynamic = ["dependencies", "optional-dependencies"]
|
|
27
|
+
readme = "README.md"
|
|
28
|
+
license = "MIT AND (Apache-2.0 OR BSD-2-Clause)"
|
|
29
|
+
license-files = ["LICEN[CS]E*"]
|
|
30
|
+
|
|
31
|
+
[tool.hatch.metadata.hooks.requirements_txt]
|
|
32
|
+
files = ["requirements.txt"]
|
|
33
|
+
|
|
34
|
+
[tool.hatch.metadata.hooks.requirements_txt.optional-dependencies]
|
|
35
|
+
test = ["requirements-test.txt"]
|
|
36
|
+
|
|
37
|
+
[project.urls]
|
|
38
|
+
Repository = "https://gitlab.bcamath.org/fponce/indar.git"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pytest
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#
|
|
2
|
+
# This file is autogenerated by pip-compile with Python 3.13
|
|
3
|
+
# by the following command:
|
|
4
|
+
#
|
|
5
|
+
# pip-compile requirements-test.in
|
|
6
|
+
#
|
|
7
|
+
iniconfig==2.3.0
|
|
8
|
+
# via pytest
|
|
9
|
+
packaging==26.2
|
|
10
|
+
# via pytest
|
|
11
|
+
pluggy==1.6.0
|
|
12
|
+
# via pytest
|
|
13
|
+
pygments==2.20.0
|
|
14
|
+
# via pytest
|
|
15
|
+
pytest==9.0.3
|
|
16
|
+
# via -r requirements-test.in
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
#
|
|
2
|
+
# This file is autogenerated by pip-compile with Python 3.13
|
|
3
|
+
# by the following command:
|
|
4
|
+
#
|
|
5
|
+
# pip-compile requirements.in
|
|
6
|
+
#
|
|
7
|
+
attrs==26.1.0
|
|
8
|
+
# via -r requirements.in
|
|
9
|
+
contourpy==1.3.3
|
|
10
|
+
# via matplotlib
|
|
11
|
+
cycler==0.12.1
|
|
12
|
+
# via matplotlib
|
|
13
|
+
fonttools==4.62.1
|
|
14
|
+
# via matplotlib
|
|
15
|
+
jinja2==3.1.6
|
|
16
|
+
# via jitcxde-common
|
|
17
|
+
jitcode==1.7.3
|
|
18
|
+
# via -r requirements.in
|
|
19
|
+
jitcxde-common==1.5.6
|
|
20
|
+
# via jitcode
|
|
21
|
+
joblib==1.5.3
|
|
22
|
+
# via scikit-learn
|
|
23
|
+
kiwisolver==1.5.0
|
|
24
|
+
# via matplotlib
|
|
25
|
+
markupsafe==3.0.3
|
|
26
|
+
# via jinja2
|
|
27
|
+
matplotlib==3.10.9
|
|
28
|
+
# via -r requirements.in
|
|
29
|
+
mpmath==1.3.0
|
|
30
|
+
# via sympy
|
|
31
|
+
numpy==2.4.4
|
|
32
|
+
# via
|
|
33
|
+
# -r requirements.in
|
|
34
|
+
# contourpy
|
|
35
|
+
# jitcode
|
|
36
|
+
# jitcxde-common
|
|
37
|
+
# matplotlib
|
|
38
|
+
# scikit-learn
|
|
39
|
+
# scipy
|
|
40
|
+
packaging==26.2
|
|
41
|
+
# via matplotlib
|
|
42
|
+
pillow==12.2.0
|
|
43
|
+
# via matplotlib
|
|
44
|
+
pyparsing==3.3.2
|
|
45
|
+
# via matplotlib
|
|
46
|
+
python-dateutil==2.9.0.post0
|
|
47
|
+
# via matplotlib
|
|
48
|
+
scikit-learn==1.8.0
|
|
49
|
+
# via -r requirements.in
|
|
50
|
+
scipy==1.17.1
|
|
51
|
+
# via
|
|
52
|
+
# -r requirements.in
|
|
53
|
+
# jitcode
|
|
54
|
+
# scikit-learn
|
|
55
|
+
six==1.17.0
|
|
56
|
+
# via python-dateutil
|
|
57
|
+
symengine==0.14.1
|
|
58
|
+
# via
|
|
59
|
+
# -r requirements.in
|
|
60
|
+
# jitcode
|
|
61
|
+
# jitcxde-common
|
|
62
|
+
sympy==1.14.0
|
|
63
|
+
# via -r requirements.in
|
|
64
|
+
threadpoolctl==3.6.0
|
|
65
|
+
# via scikit-learn
|
|
66
|
+
|
|
67
|
+
# The following packages are considered to be unsafe in a requirements file:
|
|
68
|
+
# setuptools
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class Rational:
|
|
5
|
+
|
|
6
|
+
def __init__(
|
|
7
|
+
self,
|
|
8
|
+
poles,
|
|
9
|
+
a,
|
|
10
|
+
d=None
|
|
11
|
+
):
|
|
12
|
+
self.poles = np.atleast_1d(poles)
|
|
13
|
+
self.a = np.atleast_2d(a)
|
|
14
|
+
self.d = np.atleast_1d(d) if d is not None else None
|
|
15
|
+
|
|
16
|
+
if poles.ndim > 1:
|
|
17
|
+
msg = 'Expected a 1D-array for poles.'
|
|
18
|
+
raise ValueError(msg)
|
|
19
|
+
|
|
20
|
+
if a.shape[-1] != len(poles):
|
|
21
|
+
msg = 'The last dimension of a should match the length of poles.'
|
|
22
|
+
raise ValueError(msg)
|
|
23
|
+
|
|
24
|
+
if (self.d is not None) and (self.d.shape != a.shape[:-1]):
|
|
25
|
+
msg = 'The shape of d should match the shape of a without the last dimension.'
|
|
26
|
+
raise ValueError(msg)
|
|
27
|
+
|
|
28
|
+
def __call__(self, z):
|
|
29
|
+
z = np.atleast_1d(z)
|
|
30
|
+
if z.ndim > 1:
|
|
31
|
+
msg = f'Expected a 1D array for z, got an array of dimension {z.ndim}.'
|
|
32
|
+
raise ValueError(msg)
|
|
33
|
+
|
|
34
|
+
r = np.einsum(
|
|
35
|
+
'...j,kj->...k',
|
|
36
|
+
self.a,
|
|
37
|
+
1 / (z[:, np.newaxis] - self.poles[np.newaxis, :]),
|
|
38
|
+
dtype=complex)
|
|
39
|
+
|
|
40
|
+
if self.d is not None:
|
|
41
|
+
return r + self.d[..., np.newaxis]
|
|
42
|
+
else:
|
|
43
|
+
return r
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class ExpSum:
|
|
47
|
+
|
|
48
|
+
def __init__(
|
|
49
|
+
self,
|
|
50
|
+
exps,
|
|
51
|
+
amps
|
|
52
|
+
):
|
|
53
|
+
self.exps = np.atleast_1d(exps)
|
|
54
|
+
self.amps = np.atleast_2d(amps)
|
|
55
|
+
|
|
56
|
+
if exps.ndim > 1:
|
|
57
|
+
msg = 'Expected a 1D-array for exps.'
|
|
58
|
+
raise ValueError(msg)
|
|
59
|
+
|
|
60
|
+
if amps.shape[-1] != len(exps):
|
|
61
|
+
msg = 'The last dimension of amps should match the length of exps.'
|
|
62
|
+
raise ValueError(msg)
|
|
63
|
+
|
|
64
|
+
def __call__(self, t):
|
|
65
|
+
t = np.atleast_1d(t)
|
|
66
|
+
if t.ndim > 1:
|
|
67
|
+
msg = f'Expected a 1D array for t, got an array of dimension {t.ndim}.'
|
|
68
|
+
raise ValueError(msg)
|
|
69
|
+
|
|
70
|
+
r = np.einsum(
|
|
71
|
+
'...j,tj->...t',
|
|
72
|
+
self.amps,
|
|
73
|
+
np.exp(self.exps[np.newaxis, :]*t[:, np.newaxis]),
|
|
74
|
+
dtype=complex)
|
|
75
|
+
|
|
76
|
+
return r
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
class Kernel:
|
|
80
|
+
|
|
81
|
+
def __init__(
|
|
82
|
+
self,
|
|
83
|
+
roots,
|
|
84
|
+
amps,
|
|
85
|
+
fs:float=1.0,
|
|
86
|
+
response:str='a',
|
|
87
|
+
discrete:str='delta'
|
|
88
|
+
):
|
|
89
|
+
self.roots = np.atleast_1d(roots)
|
|
90
|
+
self.amps = np.atleast_2d(amps)
|
|
91
|
+
self.response = response
|
|
92
|
+
self.discrete = discrete
|
|
93
|
+
|
|
94
|
+
if roots.ndim > 1:
|
|
95
|
+
msg = 'Expected a 1D-array for roots.'
|
|
96
|
+
raise ValueError(msg)
|
|
97
|
+
|
|
98
|
+
if amps.shape[-1] != len(roots):
|
|
99
|
+
msg = 'The last dimension of amps should match the length of roots.'
|
|
100
|
+
raise ValueError(msg)
|
|
101
|
+
|
|
102
|
+
if response not in ['d', 'v', 'a']:
|
|
103
|
+
msg = f'Unknown response type: {response}'
|
|
104
|
+
raise ValueError(msg)
|
|
105
|
+
|
|
106
|
+
if discrete not in ['delta', 'step']:
|
|
107
|
+
msg = f'Unknown discrete type: {discrete}'
|
|
108
|
+
raise ValueError(msg)
|
|
109
|
+
|
|
110
|
+
self._factor = np.ones_like(self.roots)
|
|
111
|
+
if discrete == 'delta':
|
|
112
|
+
if response == 'd':
|
|
113
|
+
pass
|
|
114
|
+
elif response == 'v':
|
|
115
|
+
self._factor *= self.roots
|
|
116
|
+
elif response == 'a':
|
|
117
|
+
self._factor *= self.roots**2
|
|
118
|
+
elif discrete == 'step':
|
|
119
|
+
self._factor *= (np.exp(self.roots/fs) - 1)*fs
|
|
120
|
+
if response == 'd':
|
|
121
|
+
self._factor *= 1 / self.roots
|
|
122
|
+
elif response == 'v':
|
|
123
|
+
pass
|
|
124
|
+
elif response == 'a':
|
|
125
|
+
self._factor *= self.roots
|
|
126
|
+
|
|
127
|
+
def __call__(self, t):
|
|
128
|
+
t = np.atleast_1d(t)
|
|
129
|
+
if t.ndim > 1:
|
|
130
|
+
msg = f'Expected a 1D array for times, got an array of dimension {t.ndim}.'
|
|
131
|
+
raise ValueError(msg)
|
|
132
|
+
|
|
133
|
+
K = np.einsum(
|
|
134
|
+
'...j,tj->...t',
|
|
135
|
+
self.amps,
|
|
136
|
+
self._factor[np.newaxis, :]*np.exp(self.roots[np.newaxis, :]*t[:, np.newaxis]),
|
|
137
|
+
dtype=complex
|
|
138
|
+
)
|
|
139
|
+
K = np.imag(K)
|
|
140
|
+
|
|
141
|
+
return K
|