I have had this experience (although not to the point of shaking) when my mind is going crazy.
What to do about it?
Embrace it. We don't NEED to work out a ton to be healthy. If it's just not working in that moment, then stop. Listen to your body and mind and work with them. While I didn't really get into fitness until after I got my degree in Mechanical Engineering, I still find myself thinking stuff up in my head all the time. At times where we were neck-deep in a design project at work, I'd often get home late with my mind completely steeped in the challenges of the day and I'd just sit there sketching or "figuring shit out." If I know I have a deadline coming up (perhaps exams for you academics) I'll just take it easy on the fitness then and focus more on the low-level cardio, like taking long walks and stuff. That gives me plenty of time to focus on the brain stuff while still getting in some movement.
Erase it. Work on some meditative practices before you attempt workouts, perhaps even before you leave to go to the gym. Consciously clearing the mind of extraneous and erratic thought can do wonders for many things, including exercise. I do this quite frequently as a musician. Before a performance, especially as a soloist, I'll (quite methodically) go through my thoughts and set them aside for a bit. They'll be there when I get back. They can wait. The world will not end in the next 25 minutes -- we can see asteroids DAYS in advance.
I just try to strike a balance between these two things, usually. You don't want to stifle the creative generation in your mind, but you want to be able to actively clear your head. I'd say find a nice long walk that you find pleasing and put a little time into some meditation.