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

Throwing errors after 1000 time steps simulation #736

Open
ErikQ97 opened this issue Feb 26, 2025 · 2 comments
Open

Throwing errors after 1000 time steps simulation #736

ErikQ97 opened this issue Feb 26, 2025 · 2 comments

Comments

@ErikQ97
Copy link

ErikQ97 commented Feb 26, 2025

Hi there,

I am running a simulation with Trixi.jl and I want to obtain the gradients of the parameters. When I took different trials I found that the algorithm works well when the total time step is less than 1000, however, if the total time steps exceed 1000 there would be an error throwed as

ERROR: MethodError: no method matching Float64(::ForwardDiff.Dual{ForwardDiff.Tag{typeof(predict), Float64}, Float64, 1}) The type Float64 exists, but no method is defined for this combination of argument types when trying to construct it.

Any comments or suggestions would be highly appreciated.

Thank you!

@KristofferC
Copy link
Collaborator

See https://juliadiff.org/ForwardDiff.jl/dev/user/limitations/.

The code has to be generic, apparently it does something on the 1000 step which is not. Impossible to say what with the information provided here.

@mcabbott
Copy link
Member

The authors of Trixi.jl may be able to say something, if you post the entire stack trace -- not just the first line.

The error shown is (as Kristoffer says) the usual error when you try to write a Dual number into a non-Dual container. But someone needs to figure out why exactly something is doing that at the 1000th step, and knowing what function is being called may help.

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

3 participants