PersistentMotion and spatial re-scaling
Suppose you want to simulate cells with PersistentMotion and later change the spatial resolution of the lattice but keep the same motility.
(With changing the spatial resolution of the lattice I mean interpreting each lattice node as 2 micron instead of 1 micron).
To do this, you need to:
- recalculate the new target volume, e.g. 78 -> 314
- adapt the MCSDuration, e.g. 1 -> 0.25 (to have 4 times as many MCS updates to simulate the same physical time).
While this works fine for simple CPM simulations (I extensively tested this), this does not work with PersistentMotion.
I am confused how to fix this. The plugin accounts for CPM::getMCSDuration()
(temporal resolution) in line 51:
https://gitlab.com/morpheus.lab/morpheus/blob/master/morpheus/plugins/motility/persistent_motion.cpp#L51
However, it does not account for SIM::NodeLength()
(spatial resolution) in e.g. calculating the shift
:
https://gitlab.com/morpheus.lab/morpheus/blob/master/morpheus/plugins/motility/persistent_motion.cpp#L55
or the update_direction
:
https://gitlab.com/morpheus.lab/morpheus/blob/master/morpheus/plugins/motility/persistent_motion.cpp#L66
Also, I suspect that the scaling of the energy with the cell volume in line 70 is not correct (shouldn't this rather be the cell diameter?): https://gitlab.com/morpheus.lab/morpheus/blob/master/morpheus/plugins/motility/persistent_motion.cpp#L70