my iPhone has been shutting off prematurly. Is their a glitch or a program issue?

I have an iPhone 6S and my phone just shuts off.
This is actually a known issue with iPhone 6s models that were manufactured in September and October 2015. You can get a battery replacement from Apple because of this problem. Check out the iPhone 6s forums for other threads on it.
I have an iPhone 6S and my phone just shuts off.

Follow this link to Apple's page and enter your serial number to see if you qualify for a free battery replacement.

https://www.apple.com/support/iphone6s-unexpectedshutdown/#mn_p
I've actually had this happen to me repeatedly on two separate days. I attached my phone to my electric bike via a shock mount, in an attempt to get food off campus. I found this nice place I've heard of before and put the location in the map and went. The phone just started shutting down. I ended up coming back to school to make a sandwich after 30 minutes of struggling because I couldn't get it to work. I concluded it could only be one of these things:
1) It was below 10 degrees celsius, maybe that messed with my phone or it's battery case (I can't always walk with my nikon d5100 so I sometimes use my iPhone for photography and video)
2) The temperature messed with the GPS
3) iPhone bug unknown to me

It hasn't happened again and I've gone riding in warmer weather so only time will tell. I don't qualify for the battery replacement program.

Original thread: https://forums.imore.com/threads/my-iphone-has-been-shutting-off-prematurly-is-their-a-glitch-or-a-program-issue.379620/