When it comes to making the most of late night medications before bed, new research shows posture plays an important factor.

Researchers at Johns Hopkins University have been using a computer modeling and simulation platform called Stomach-Sim, which is designed to mimic the biomechanics of the organ.

“Most of the grinding and mixing of anything that we eat happens towards the bottom part of the stomach,” Dr. Rajat Mittal said.

Dr. Mittal and his colleagues used the tool to examine how a pill dissolves in a human.

“The closer it gets to that last part of the stomach — the faster it’s going to get digested and dissolve,” he said.

His team tested four different postures to see which was best at bringing a medication to the bottom of the stomach and closed to the small intestine — where pills eject their contents and start to work.

Lying on the right side was the winner — sending the pill into the lowest part of the organ. There, drugs dissolve the fastest, possibly at a rate 2.3 times faster than an upright posture, which didn’t send the pill as deep.

A similar landing spot was achieved whole lying straight back. The worst position was lying on the left side. Compared to other locations, it may take 10 times longer to dissolve from the mid-stomach.

Next, the researchers hope to explore how pill shape and size, along with stomach contents, impact how quickly a drug can dissolve.