Lamarckian Evolution in One Cell, If It's Fast Enough

Last I checked, which was Google, there wasn't much on the subject. The second-to-last I checked, which was 9th-grade biology, Lamarckian evolution was something giraffes might have gone through as they stretched their necks to browse the highest leaves in the tree. Certainly the distention, if any, is not passed on to their offspring: too many specialized mutations needed, in concert, caused directly by the stretching, and as if that weren't too much to ask, this all has to happen RIGHT NOW. But in a monocellular organism, maybe a more esoteric stress can mutate just one pivotal gene, and just in time. Picture the following:

Picture, further, that the cell in which all this is happening is being overwhelmed by the toxin. The gene for the detoxifying enzyme is being transcribed at full tilt, yet perhaps it can't keep up...unless the toxin also mutates that same gene, improving the enzyme's performance to the point that it (a mixture of wild-type and mutant gene product) could keep up, saving the cell and giving it something useful to pass on to its progeny. That, I submit, would be an example of Lamarckian evolution. Whatchoo say?

What I say is: this is an interesting problem in kinetics. Darwinian evolution presumes that the mutant got that way well before, or maybe just minutes before, selection pressure was brought to bear. If the selection pressure had never come to town, we might never know about the mutation, which might itself be superseded by another. Lamarckian evolution, I think, requires that the mutation happen only when it's almost too late and that it be immediately advantageous to the mutant. If it isn't, the mutant dies and we're stuck with a bunch of short giraffes.

Thus the following, which I've set up as a brute-force loop-'til-you-droop computational routine, rather than do the decent thing and just solve partial differential equations. I've made a heap of simplifying assumptions, some of which are described below and the rest of which can be glowered at by viewing the source code. Be such assumptions as they be, you set these variables (or reset them - since there are so many and it is not at all obvious to a non-PDE-solver what the most teasing combinations are, I've hardcoded some nontrivial ones):

Set the toxin's initial concentration to .
Also set a certain victim molecule's concentration to .
The toxin reacts one-on-one with the victim, at this rate: .
When it does, the victim molecule is gone for good. If its concentration gets below this......the organism dies. Don't want that!
Now, the toxin is also postulated to promote production of both a wild-type and mutant detoxifying enzyme. The rate at which it does that (for both, says I) is .
The wild-type enzyme is imagined to do the same job at THIS rate: . And the mutant enzyme is imagined to detoxify the toxin at this rate: .
I'm pretending these enzymes are saturated at practically any concentration of toxin, so enzyme concentrations are kinetically significant. (Like saying that Km's are extremely low, and it's Vmax's that really matter.)