tbenthompson / cutde

Python CPU and GPU accelerated TDEs, over 100 million TDEs per second!
MIT License
58 stars 14 forks source link

number precission issue half-space vertically oriented TDE #35

Open hvasbath opened 8 months ago

hvasbath commented 8 months ago

Hi again Ben,

seems like doing source inversion you find the instabilities in the code as the sampler finds the singularities haha. Comparing to matlab I pinned down the issue to num.float32 vs num.float64. For a TDE that is vertically oriented in half-space number precission for GPU of float32 produces instable results.

Just want to report here, I could make a PR with a test-if you deem it useful. I was discussing with Mehdi Nikhoo and we identified the problem to be in this line of the code/equatins: https://github.com/tbenthompson/cutde/blob/master/cutde/common.cu#L527

This exists also in the matlab code. He mentions this goes back to typos in the equations of AngularDislocations and it would require quite some effort to rederive them to find the typo. So likely no easy fix for that one...

Hannes

tbenthompson commented 8 months ago

Thanks!! So it looks like there's no easy solution at the moment? If that's the case, I'll just leave this issue open as a reminder of the problem.

hvasbath commented 8 months ago

Thanks, that was my intention, such that others can also become aware of that. Its a rare configuration of TDEs and does not often cause issues.