
Hello, I have calculated the modal frequencies of a part with Sfepy. The results have been compared to Ansys. Unfortunately, the results are different.
I have repeated the calculation by changing the next parameters trying to find stable results. -Solver: eig.scipy/eigsh -Solver:eig.scipy_lobpcg - -i_max(iterations) -Mesh size. I have tested different mesh from 12k cells to 22k cells. -Order
I am not able to get results in a reasonable time by using eig.scipy/eigsh . (as reference for 13k cell, time is around 10 min) The calculation runs with the solver eig.scipy_lobpcg. In all the tests, I am not able to reach good tolerance. So, the results are quite dependent on the number of elements, i_max parameter, and order. On the other hand, if I try to make it more accurate, the time processing is too long.
Could you give any hint or recommendation?
The simulation condition is free, without boundary conditions.The first modes from Ansys are 4746 Hz, 5118 Hz, 5426 Hz, 6906 Hz. The six first modes corresponding to rigid motion have been discarded. The modes with Sfepy are 8710 Hz, 12954 Hz, 13138 Hz , 15213 Hz Ansys use tetrahedrons with quadratic formulation (midside nodes) and fine mesh.
You can find attached code and commands to run it. To run the model write in the terminal: python modal_analysis.py Dummy_Modal_4_1.mesh --solver="eig.scipy_lobpcg,i_max:1000,largest:False" --young 74854 --density 2.7e-9 --poisson 0.3 --order 1 Units: mm, N, MPa, Tn/mm3 Thanks, Jesus S.

Hello Jesus,
On 5/19/23 09:29, J. Sanz wrote:
Hello, I have calculated the modal frequencies of a part with Sfepy. The results have been compared to Ansys. Unfortunately, the results are different.
I have repeated the calculation by changing the next parameters trying to find stable results. -Solver: eig.scipy/eigsh -Solver:eig.scipy_lobpcg - -i_max(iterations) -Mesh size. I have tested different mesh from 12k cells to 22k cells. -Order
I am not able to get results in a reasonable time by using eig.scipy/eigsh . (as reference for 13k cell, time is around 10 min) The calculation runs with the solver eig.scipy_lobpcg. In all the tests, I am not able to reach good tolerance. So, the results are quite dependent on the number of elements, i_max parameter, and order. On the other hand, if I try to make it more accurate, the time processing is too long.
Could you give any hint or recommendation?
The simulation condition is free, without boundary conditions.The first modes from Ansys are 4746 Hz, 5118 Hz, 5426 Hz, 6906 Hz. The six first modes corresponding to rigid motion have been discarded. The modes with Sfepy are 8710 Hz, 12954 Hz, 13138 Hz , 15213 Hz Ansys use tetrahedrons with quadratic formulation (midside nodes) and fine mesh.
You can find attached code and commands to run it. To run the model write in the terminal: python modal_analysis.py Dummy_Modal_4_1.mesh --solver="eig.scipy_lobpcg,i_max:1000,largest:False" --young 74854 --density 2.7e-9 --poisson 0.3 --order 1 Units: mm, N, MPa, Tn/mm3
It is an eigensolver problem - I have tried with 'eig.matlab' (having access to matlab is required), and, importantly, --order=2, and got:
python3 modal_analysis.py Dummy_Modal_4_1.mesh --solver="eig.matlab,method:'eigs',which:'sm',verbose:True" --young 74854 --density 2.7e-9 --poisson 0.3 --order 2 ... sfepy: 12 eigenvalues converged (6 ignored as rigid body modes) sfepy: number | eigenvalue | angular frequency | frequency sfepy: 1 | 8.944602789818e+08 | 2.990752880099e+04 | 4.759931044340e+03 sfepy: 2 | 1.041131441606e+09 | 3.226656848203e+04 | 5.135383870529e+03 sfepy: 3 | 1.176268873292e+09 | 3.429677642713e+04 | 5.458501500495e+03 sfepy: 4 | 1.884228345102e+09 | 4.340769914545e+04 | 6.908549887245e+03 sfepy: 5 | 2.535791079300e+09 | 5.035663888009e+04 | 8.014507995260e+03 sfepy: 6 | 3.427451417525e+09 | 5.854443968069e+04 | 9.317636965726e+03 ... Time: 47.23511600494385
The same results are obtained also in basic units.
For comparison, with order 1 I get:
sfepy: number | eigenvalue | angular frequency | frequency sfepy: 1 | 1.198955924942e+09 | 3.462594294661e+04 | 5.510889979171e+03 sfepy: 2 | 1.303783295802e+09 | 3.610793951200e+04 | 5.746757058198e+03 sfepy: 3 | 1.721276848641e+09 | 4.148827362811e+04 | 6.603063828262e+03 sfepy: 4 | 2.480088143535e+09 | 4.980048336648e+04 | 7.925993096140e+03 sfepy: 5 | 3.422682955312e+09 | 5.850370035572e+04 | 9.311153100779e+03 sfepy: 6 | 4.606673340355e+09 | 6.787247851931e+04 | 1.080224045625e+04
- this gives higher frequencies than order 2.
Unfortunately I do not know about an open source eigenvalue problem solver usable from Python that is as good as eigs() in matlab. Maybe some configuration options of those available via sfepy would lead to results, but I was not successful with your example. Even preconditioning LOBPCG with a linear solve of K have not lead to correct results.
r.

Thank you Robert, Could quadratic eigenvalues problem solver (sfepy) be a solution for this problem? What do you think? Thanks, J.Sanz
El vie, 19 may 2023 a las 15:19, Robert Cimrman (<cimrman3@ntc.zcu.cz>) escribió:
Hello Jesus,
On 5/19/23 09:29, J. Sanz wrote:
Hello, I have calculated the modal frequencies of a part with Sfepy. The results have been compared to Ansys. Unfortunately, the results are different.
I have repeated the calculation by changing the next parameters trying to find stable results. -Solver: eig.scipy/eigsh -Solver:eig.scipy_lobpcg - -i_max(iterations) -Mesh size. I have tested different mesh from 12k cells to 22k cells. -Order
I am not able to get results in a reasonable time by using eig.scipy/eigsh . (as reference for 13k cell, time is around 10 min) The calculation runs with the solver eig.scipy_lobpcg. In all the tests, I am not able to reach good tolerance. So, the results are quite dependent on the number of elements, i_max parameter, and order. On the other hand, if I try to make it more accurate, the time processing is too long.
Could you give any hint or recommendation?
The simulation condition is free, without boundary conditions.The first modes from Ansys are 4746 Hz, 5118 Hz, 5426 Hz, 6906 Hz. The six first modes corresponding to rigid motion have been discarded. The modes with Sfepy are 8710 Hz, 12954 Hz, 13138 Hz , 15213 Hz Ansys use tetrahedrons with quadratic formulation (midside nodes) and fine mesh.
You can find attached code and commands to run it. To run the model write in the terminal: python modal_analysis.py Dummy_Modal_4_1.mesh --solver="eig.scipy_lobpcg,i_max:1000,largest:False" --young 74854 --density 2.7e-9 --poisson 0.3 --order 1 Units: mm, N, MPa, Tn/mm3
It is an eigensolver problem - I have tried with 'eig.matlab' (having access to matlab is required), and, importantly, --order=2, and got:
python3 modal_analysis.py Dummy_Modal_4_1.mesh --solver="eig.matlab,method:'eigs',which:'sm',verbose:True" --young 74854 --density 2.7e-9 --poisson 0.3 --order 2 ... sfepy: 12 eigenvalues converged (6 ignored as rigid body modes) sfepy: number | eigenvalue | angular frequency | frequency sfepy: 1 | 8.944602789818e+08 | 2.990752880099e+04 | 4.759931044340e+03 sfepy: 2 | 1.041131441606e+09 | 3.226656848203e+04 | 5.135383870529e+03 sfepy: 3 | 1.176268873292e+09 | 3.429677642713e+04 | 5.458501500495e+03 sfepy: 4 | 1.884228345102e+09 | 4.340769914545e+04 | 6.908549887245e+03 sfepy: 5 | 2.535791079300e+09 | 5.035663888009e+04 | 8.014507995260e+03 sfepy: 6 | 3.427451417525e+09 | 5.854443968069e+04 | 9.317636965726e+03 ... Time: 47.23511600494385
The same results are obtained also in basic units.
For comparison, with order 1 I get:
sfepy: number | eigenvalue | angular frequency | frequency sfepy: 1 | 1.198955924942e+09 | 3.462594294661e+04 | 5.510889979171e+03 sfepy: 2 | 1.303783295802e+09 | 3.610793951200e+04 | 5.746757058198e+03 sfepy: 3 | 1.721276848641e+09 | 4.148827362811e+04 | 6.603063828262e+03 sfepy: 4 | 2.480088143535e+09 | 4.980048336648e+04 | 7.925993096140e+03 sfepy: 5 | 3.422682955312e+09 | 5.850370035572e+04 | 9.311153100779e+03 sfepy: 6 | 4.606673340355e+09 | 6.787247851931e+04 | 1.080224045625e+04
- this gives higher frequencies than order 2.
Unfortunately I do not know about an open source eigenvalue problem solver usable from Python that is as good as eigs() in matlab. Maybe some configuration options of those available via sfepy would lead to results, but I was not successful with your example. Even preconditioning LOBPCG with a linear solve of K have not lead to correct results.
r.
SfePy mailing list -- sfepy@python.org To unsubscribe send an email to sfepy-leave@python.org https://mail.python.org/mailman3/lists/sfepy.python.org/ Member address: jsanz451@gmail.com

No, the quadratic eigenvalues problem solvers solve another equation, where the eigenvalues occur in both the first and second powers [1], and are even more difficult to solve. There is no damping in your case, so it is the usual linear eigenvalue problem.
I have some other solvers on my list "to try" - I will report back in case of success.
r.
[1] https://en.wikipedia.org/wiki/Quadratic_eigenvalue_problem
On 5/22/23 11:05, J. Sanz wrote:
Thank you Robert, Could quadratic eigenvalues problem solver (sfepy) be a solution for this problem? What do you think? Thanks, J.Sanz
El vie, 19 may 2023 a las 15:19, Robert Cimrman (<cimrman3@ntc.zcu.cz>) escribió:
Hello Jesus,
On 5/19/23 09:29, J. Sanz wrote:
Hello, I have calculated the modal frequencies of a part with Sfepy. The results have been compared to Ansys. Unfortunately, the results are different.
I have repeated the calculation by changing the next parameters trying to find stable results. -Solver: eig.scipy/eigsh -Solver:eig.scipy_lobpcg - -i_max(iterations) -Mesh size. I have tested different mesh from 12k cells to 22k cells. -Order
I am not able to get results in a reasonable time by using eig.scipy/eigsh . (as reference for 13k cell, time is around 10 min) The calculation runs with the solver eig.scipy_lobpcg. In all the tests, I am not able to reach good tolerance. So, the results are quite dependent on the number of elements, i_max parameter, and order. On the other hand, if I try to make it more accurate, the time processing is too long.
Could you give any hint or recommendation?
The simulation condition is free, without boundary conditions.The first modes from Ansys are 4746 Hz, 5118 Hz, 5426 Hz, 6906 Hz. The six first modes corresponding to rigid motion have been discarded. The modes with Sfepy are 8710 Hz, 12954 Hz, 13138 Hz , 15213 Hz Ansys use tetrahedrons with quadratic formulation (midside nodes) and fine mesh.
You can find attached code and commands to run it. To run the model write in the terminal: python modal_analysis.py Dummy_Modal_4_1.mesh --solver="eig.scipy_lobpcg,i_max:1000,largest:False" --young 74854 --density 2.7e-9 --poisson 0.3 --order 1 Units: mm, N, MPa, Tn/mm3
It is an eigensolver problem - I have tried with 'eig.matlab' (having access to matlab is required), and, importantly, --order=2, and got:
python3 modal_analysis.py Dummy_Modal_4_1.mesh --solver="eig.matlab,method:'eigs',which:'sm',verbose:True" --young 74854 --density 2.7e-9 --poisson 0.3 --order 2 ... sfepy: 12 eigenvalues converged (6 ignored as rigid body modes) sfepy: number | eigenvalue | angular frequency | frequency sfepy: 1 | 8.944602789818e+08 | 2.990752880099e+04 | 4.759931044340e+03 sfepy: 2 | 1.041131441606e+09 | 3.226656848203e+04 | 5.135383870529e+03 sfepy: 3 | 1.176268873292e+09 | 3.429677642713e+04 | 5.458501500495e+03 sfepy: 4 | 1.884228345102e+09 | 4.340769914545e+04 | 6.908549887245e+03 sfepy: 5 | 2.535791079300e+09 | 5.035663888009e+04 | 8.014507995260e+03 sfepy: 6 | 3.427451417525e+09 | 5.854443968069e+04 | 9.317636965726e+03 ... Time: 47.23511600494385
The same results are obtained also in basic units.
For comparison, with order 1 I get:
sfepy: number | eigenvalue | angular frequency | frequency sfepy: 1 | 1.198955924942e+09 | 3.462594294661e+04 | 5.510889979171e+03 sfepy: 2 | 1.303783295802e+09 | 3.610793951200e+04 | 5.746757058198e+03 sfepy: 3 | 1.721276848641e+09 | 4.148827362811e+04 | 6.603063828262e+03 sfepy: 4 | 2.480088143535e+09 | 4.980048336648e+04 | 7.925993096140e+03 sfepy: 5 | 3.422682955312e+09 | 5.850370035572e+04 | 9.311153100779e+03 sfepy: 6 | 4.606673340355e+09 | 6.787247851931e+04 | 1.080224045625e+04
- this gives higher frequencies than order 2.
Unfortunately I do not know about an open source eigenvalue problem solver usable from Python that is as good as eigs() in matlab. Maybe some configuration options of those available via sfepy would lead to results, but I was not successful with your example. Even preconditioning LOBPCG with a linear solve of K have not lead to correct results.
r.
SfePy mailing list -- sfepy@python.org To unsubscribe send an email to sfepy-leave@python.org https://mail.python.org/mailman3/lists/sfepy.python.org/ Member address: jsanz451@gmail.com
SfePy mailing list -- sfepy@python.org To unsubscribe send an email to sfepy-leave@python.org https://mail.python.org/mailman3/lists/sfepy.python.org/ Member address: cimrman3@ntc.zcu.cz
participants (2)
-
J. Sanz
-
Robert Cimrman