Solve bug (see answer) introduced in 9.0 and persisting through 11.0.1 or later
First post, hopefully I figure out the formatting easily. Please forgive me if this posts ugly.
I am having a (repeatable) problem where when I run my code everything works fast and the output is displayed but the program has some error in which it erases the kernel (maybe that's not the correct term). Basically all my variables reset and Mathematica goes back to being as if I just opened the software.
For context, this is the output of a secular variation model
(0.0057300369 - 0.0071475265 I) E^((-8.2717832*10^-25 + 6.6290151*10^-9 I) t) - (0.0000981431 + 0.0001437239 I) E^((-3.7695835*10^-29 + 1.4229429*10^-9 I) t) + (0.000072401667 - 0.000092434689 I) E^((0. + 2.6555734*10^-8 I) t) + (0.000092742725 - 0.000015933052 I) E^((4.0245734*10^-26 + 3.1934271*10^-10 I) t)
Those real pieces in the exponential are really zero except for some numerical error. I want to
// Chop it. When I do however, my machine makes a "dong" sound (standard Mac error sound) and Mathematica or the kernel resets.
I would guess it is repeatable for anyone else to try as well. I completely quit Mathematica. Reopen then copy paste the block above into a new window. A chop at the end of it has the same result.
It spits out the right answer, but this is just a step in a loop, so I need all my variables and such to stay defined.
Any reason someone can see that this is happening?
My guess is Mathematica just needs a real component in the exponential. Don't know why, though.
Take that bit above and use
// ComplexExpand //Chop gives it in an equivalent form in sines and cosines.