https://github.com/jacubillos10/ruspectroscopy_tools
C extension module (for python) to generate gamma and E matrices in RUS (Resonant Ultrasound Spectroscopy)
https://github.com/jacubillos10/ruspectroscopy_tools
c openmp physics python3 resonant-ultrasound-spectroscopy solid-state-physics
Last synced: 8 months ago
JSON representation
C extension module (for python) to generate gamma and E matrices in RUS (Resonant Ultrasound Spectroscopy)
- Host: GitHub
- URL: https://github.com/jacubillos10/ruspectroscopy_tools
- Owner: jacubillos10
- License: mit
- Created: 2024-02-01T23:13:44.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-10-04T22:35:11.000Z (8 months ago)
- Last Synced: 2025-10-05T00:21:35.409Z (8 months ago)
- Topics: c, openmp, physics, python3, resonant-ultrasound-spectroscopy, solid-state-physics
- Language: Python
- Homepage:
- Size: 26.8 MB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RUSpectroscopy_tools
A C extension module for generating Gamma and Epsilon matrices, in Resonant Ultrasound Spectroscopy.
## Authors
- Alejandro Cubillos - alejandro4cm@outlook.com
- Manuela Rivas
- Julián Rincón
## Import:
```python
from rusmodules import rus
```
## Usage Example
```python
gamma = rus.gamma_matrix(N, C, geometry, shape)
E = rus.E_matrix(N, shape)
```
# Where:
* N represents the maximim grade of the polynomials of the basis functions
* C 6x6 matrix with the elastic constants
* geometry (3,) shape array containing the dimensions of the sample
* shape 0 for parallelepiped, 1 for cylinder and 2 to spheroid
Solve forward problem with scipy:
Eigenvalues return $m\omega^2$
```python
eigenvals, eigenvects = scipy.linalg.eigh(a = gamma, b = E)
omega = (eigenvals[6:]/m)**(1/2) #remember the fisrt 6 eigenvalues must be near zero
frequencies = omega/(2*np.pi)
```
## Installation:
```bash
pip3 install ruspectroscopy-tools