germannp / yalla

Spheroid models of morphogenesis for the GPU.
https://doi.org/10.1016/j.cels.2019.02.007
MIT License
38 stars 8 forks source link

Adaptive time step #16

Open germannp opened 5 years ago

germannp commented 5 years ago

Certain reaction-diffusion systems, like Turing systems, require very small time steps at some times and thus profit a lot from adaptive time steps.

germannp commented 5 years ago

For now e95b44b in an experimental adaptive branch adds two additional methods to Solution, take_rk12_step() and take_rk12_rd_step(). The latter does not use friction and does not update the velocities after accepting a step. Both can incorporate noise, which can also help Turing systems converge faster.

This way reaction-diffusion (rd) equations can separated from mechanics. However, the treatment of friction is very tricky and we hope that in the future Runge-Kutta-1-2 can be used with both, mechanics and rd in one step the following ways:

Solution<Pt, Heun, Tile> cells{n};
Solution<Pt, Rk12, Grid> cells2{n};
...

If separating mechanics from rd should turn out to be required because the changes in neighborhood keep the time steps much smaller than required for the rd terms, then take_rk12_rd_step() should enforce that the positions are left untouched.

germannp commented 5 years ago

If the changes in neighborhood should turn out to be problematic, maybe switching from the simple ReLU potentials to some smooth 3rd order polynomial might help? I attached some python stuff I did when I played with potentials.

Potentials.zip

Also, the step function from diffusion might be a problem for the time stepper. I don't think weighing by distance would help given that essentially only nearest neighbours are considered, but maybe a smooth transition when two cells get close enough to become neighbours might be required.