Open 1fish2 opened 6 years ago
I'm not sure if it's really an issue, or, further, whether it can be fixed. Part of the issue is that the constraint matrix is ill-conditioned - can't change that too much, although some minor rescaling is possible. Second, I think the kinetics violation penalties are so small that some are probably underflowing, which the solver might see as numerical instability. I don't know whether the solver is running 32-bit or 64-bit floats but I suspect it's the former, which probably aggravates the problem. Finally, the first few timesteps are a mess due to initialization challenges. During this period, metabolism is behaving unusually while it tries to settle out. The homeostatic objective and partitioning add complexities that make it difficult to properly initialize.
There are other types of solvers that might work better. At the moment I don't think it's really broken, but identifying what causes the instability could be illuminating.
This might be an issue we need to address - running the simulation with seed values 54, 86, 102, 122, 129, 187, 190 currently results in an (almost?) infinite loop of numerical instability warnings after 4-5 timesteps of the first generation. For seed values 154 and 211, the same thing happens at the fourth and seventh generation, respectively.
Time (s) Dry mass Dry mass Protein RNA Small mol Expected
(fg) fold change fold change fold change fold change fold change
======== ======== =========== =========== =========== =========== ===========
0.00 374.83 1.000 1.000 1.000 1.000 1.000
0.20 374.93 1.000 1.000 1.000 1.001 1.000
0.40 374.99 1.000 1.000 1.000 1.001 1.000
Warning: numerical instability (primal simplex, phase II)
0.60 375.04 1.001 1.000 1.000 1.001 1.000
0.80 375.09 1.001 1.000 1.000 1.001 1.000
Warning: numerical instability (primal simplex, phase II)
Warning: numerical instability (primal simplex, phase II)
Warning: numerical instability (primal simplex, phase II)
Warning: numerical instability (primal simplex, phase II)
Warning: numerical instability (primal simplex, phase II)
Warning: numerical instability (primal simplex, phase II)
Warning: numerical instability (primal simplex, phase II)
Warning: numerical instability (primal simplex, phase II)
Warning: numerical instability (primal simplex, phase II)
Warning: numerical instability (primal simplex, phase II)
Warning: numerical instability (primal simplex, phase II)
Warning: numerical instability (primal simplex, phase II)
Warning: numerical instability (primal simplex, phase II)
Warning: numerical instability (primal simplex, phase II)
Warning: numerical instability (primal simplex, phase II)
Warning: numerical instability (primal simplex, phase II)
Warning: numerical instability (primal simplex, phase II)
Warning: numerical instability (primal simplex, phase II)
Warning: numerical instability (primal simplex, phase II)
These "numerical instability" warnings only seem to occur in a few early time steps. Why do they happen? Why is it inconsistent? How to fix it?