Algorithmic Solution to My Insomnia
I have seen multiple doctors, including sleep specialists, about my insomnia, and all they wanted to do is put me on prescription sleep meds for life. Those meds are addictive. I didn't want sleep meds. As a software engineer I was more interested in finding and fixing the underling problem -- there has to be one -- as opposed to the quick fixes the doctors were offering me. But that's not how doctors think, at least the ones I saw.After much research I believe I have succeeded in finding the root cause. Cells in your body need calcium to go into ON state, and to turn OFF magnesium needs to go in and displace the calcium. Stress depletes magnesium. When your body runs out of magnesium your cells can't turn off. Then your muscles become stiff and when your brain cells can't go into OFF state you can't sleep. The solution that works well for me: magnesium supplements, especially magnesium l-threonate, which can pass through what is known as the blood brain barrier. This solved my insomnia as well as muscle stiffness.