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

[Bug] r.sim.water: error output is not error but sum of depths? #4799

Open
metzm opened this issue Dec 3, 2024 · 0 comments
Open

[Bug] r.sim.water: error output is not error but sum of depths? #4799

metzm opened this issue Dec 3, 2024 · 0 comments
Labels
bug Something isn't working raster Related to raster data processing
Milestone

Comments

@metzm
Copy link
Contributor

metzm commented Dec 3, 2024

Describe the bug

From the manual:
"Error of the numerical solution can be analyzed using the error raster map (the resulting water depth is an average, and err is its RMSE)."

However, water depth is pow(gama[i][j], 3. / 5.); at https://github.com/OSGeo/grass/blob/main/raster/r.sim/simlib/output.c#L218 with gama[i][j] being the sum of walker weights over a simulation block.

The error output is gammas[i][j] at https://github.com/OSGeo/grass/blob/main/raster/r.sim/simlib/output.c#L246 with gamma being the sum of reduced water depths (walker weights) per simulation block: gammas[k][l] += pow(gama[k][l] * (double)conn, 3. / 5.); at https://github.com/OSGeo/grass/blob/main/raster/r.sim/simlib/hydro.c#L482

In effect, error is identical to water depth for one simulation block and error is larger than water depth for more simulation blocks. According to the code, water depth does not seem to be some average and error is no root mean square error (RMSE). Unfortunately, there is not a lot of documentation in the code to understand what the purpose of this error map should be.

To reproduce

Run rsim.water with a small number of walkers to make sure only one simulation block is needed, then increase the number of walkers such that several simulation blocks are needed. Compare water depth to water error for the two different settings and the error maps of the two different settings.

Expected behavior

The error map supposedly being an RMSE should in most cases be smaller than the water depth. With more simulation blocks, RMSE should become smaller, not larger.

Screenshots

System description

  • Operating System: Linux Fedora 40
  • GRASS GIS version: GRASS GIS 8.5.0dev (7192592)
@metzm metzm added bug Something isn't working raster Related to raster data processing labels Dec 3, 2024
@neteler neteler added this to the 8.5.0 milestone Dec 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working raster Related to raster data processing
Projects
None yet
Development

No branches or pull requests

2 participants