How to continue with the Use_solve_ivp_without_py-pde_wrapper branch? #26
Replies: 4 comments 12 replies
-
We have good reason to expect that implicit solvers would perform better in our case. But updating this branch is also a substantial work commitment so to make the decision we might first investigate the parts of the system that contribute to stiffness. For example, #24 , #21 and #23 , all related to the parameter b, compressibility and hydraulic conductivity. It might be useful to compare the absolute values with those obtained in Fortran. And they, to some extent, can be compared with empirical values. There is still some literature work on my side to be done for this. Permeability and its ~linear function hydraulic conductivity can be measured in sediment and thus give us a way to assess whether we get "physical" values. And they are also the main culprits affecting stability. @HannoSpreeuw mentioned the high memory consumption of |
Beta Was this translation helpful? Give feedback.
-
I have been wondering why this branch is so slow compared to the main branch, so I profiled it using cProfile with visualisation using SnakeViz and found out that most of the time spent is in Numba routines, which should not be the case; Numba should compile the python code for evaluating the rhs once - i.e. shortly after launching the code - and not every time for each call to the rhs function. The repeated Numba compilation does not necessarily explain the memory problem though, but there might be a connection. But no clue about such a connection at this point, I must admit. I will pursue this investigation to get to the cause of the repeated Numba compilation and fix it. Let's then check if that fix has any effect on memory usage. |
Beta Was this translation helpful? Give feedback.
-
Isn't it correct that we know by now? I am not sure if we can classify them as "real" or "artifacts". They are produced by the model, but their existence depends on the size of the system and Based on that I do not agree with:
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
The
Use_solve_ivp_without_py-pde_wrapper
branch was created to make most use of the features of solve_ivp.The py-pde wrapper around
solve_ivp
limits the use of these features, e.g. one cannot use a Jacobian in a functional form.The creation of this branch seemed worthwhile when the integration of the diagenetic equations derailed way before T*; i.e. the integrations seemed stiff and the use of implicit solvers with Jacobians in functional form seemed appropriate.
At a later stage in the project a wrong value of b turned out to be detrimental for the stability of the integrations and much more important than the use of implicit solvers: we can now integrate the diagenetic equations for very long timespans without problems using explicit solvers (
main
branch). The Fiadeiro-Veronis scheme provides for additional stability.So the question is: do we still need a branch that provides for implicit solvers, i.e. solvers for very stiff equations?
If yes, we need to get this branch at the same level as the
main
branch, which would involve most of the code enhancements from PR #15.And possibly a constant porosity diffusion coefficient, which would have an effect on the Jacobian computation as well, since the Jacobian has been derived assuming a varying porosity diffusion coefficient.
Beta Was this translation helpful? Give feedback.
All reactions