Repository navigation
Size the trap example to a few hundred cells and fix the implicit signal floor - #49
Merged
Merged
Conversation
The implicit signal solve raises its absolute tolerance to a float32 floor of epsilon times the right-hand side's RMS. The residual is the right-hand side minus the implicit operator applied to the iterate, so its rounding error also grows with the operator's diagonal. On a lattice that is fine along one axis, or under a strong affine loss, the floor sat below what single precision can reach and a step that had little left to resolve ran to the iteration limit and failed. The floor is now multiplied by the largest diagonal entry of the implicit operator. The Danino clock, which stopped at 1,024 cells as its first AHL pulse raised the loss, runs through it.
The trap was 120 by 30 by 6 micrometers, six cell layers deep, and held several thousand cells before any could leave it, so a run slowed long before it reached a steady state. It is now 40 by 20 by 1.5 beside a 20-wide channel, on a lattice whose fluid sites span the device exactly. Growth is multiplied by a compression factor that falls to zero as a cell's deepest overlap with a neighbor reaches a fifth of its diameter. Without it the packed colony keeps elongating into itself faster than contact relaxation can push cells out of the trap mouth. With it the trap holds about 280 cells, sheds cells into the channel continuously, and settles near 320 in total.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
examples/microfluidic_trap.pyis the model the README opens in the viewer. Its trap was 120 × 30 × 6 µm: six cell layers deep, with room for several thousand cells before any could leave. A run reached about 8,000 cells by t = 20 and slowed to a crawl without ever reaching a steady state.Resizing it exposed a solver defect that also explains the Danino clock failure noted in #48, so both are here.
Changes
Implicit signal solver (CPU, Metal, CUDA). The solve raises its absolute tolerance to a float32 floor of
epsilon * rms(right_hand_side). The residual's rounding error also scales with the implicit operator's diagonal, so on a lattice that is fine along one axis, or under a strong affine loss, that floor was below what single precision can reach, and a step with little left to resolve ran to the iteration limit and failed withImplicit coupled signal solve did not converge after 10000 iterations. The floor is now multiplied by the operator's largest diagonal entry.Trap example.
MODEL_VERSIONis 5, so checkpoints of the previous trap do not resume.Tests, tutorials, and the README text follow the new geometry.
TrapChannelDevicedefaults are unchanged, so the Danino clock keeps its device.Why the compression rule
Resizing alone was not enough. With the Monod rate only, the small trap settled at about 1,850 cells in a space for roughly 230, with most pairs overlapping by three quarters of a diameter: growth is applied regardless of crowding, and contact relaxation cannot push cells out of the mouth fast enough to keep up. With the rule, the trap holds about 280 cells, sheds cells into the channel continuously, and the total settles near 320.
Coupling growth to the contact solve in the engine would be the general answer and is what #41 attempts. This PR does not do that; the rule lives in the example.
Verification
A new solver test settles a stiff lattice to its steady profile; it aborts without the floor change and passes with it. A new trap test checks that the trap fills, keeps shedding cells, holds a steady population, and keeps every cell inside the walls.
Not covered
🤖 Generated with Claude Code