Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Energy-based truncator in ROM code leading to divide-by-zero error #53

Open
ikalash opened this issue Feb 15, 2025 · 0 comments
Open

Energy-based truncator in ROM code leading to divide-by-zero error #53

ikalash opened this issue Feb 15, 2025 · 0 comments
Assignees

Comments

@ikalash
Copy link
Collaborator

ikalash commented Feb 15, 2025

It looks like the EnergyBasedTruncater in norma-opinf is leading to a divide-by-zero error in some cases. The problem can be reproduced by running:

https://github.com/sandialabs/Norma.jl/blob/main/examples/ahead/single/clamped/dynamic-opinf-fom/make_op_inf_models.py

with this line uncommented: https://github.com/sandialabs/Norma.jl/blob/main/examples/ahead/single/clamped/dynamic-opinf-fom/make_op_inf_models.py#L28 . The error looks like:

/usr/local/lib/python3.9/site-packages/romtools/vector_space/utils/truncater.py:154: RuntimeWarning: invalid value encountered in divide
  energy = np.cumsum(singular_values**2)/np.sum(singular_values**2)

To reproduce, you first need to run https://github.com/sandialabs/Norma.jl/blob/main/examples/ahead/single/clamped/dynamic-opinf-fom/clamped.yaml . I suggest changing final time to 5.0e-5 so that the problem doesn't take as long to run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants