I hope this is over with for you. I take it this is not your regular medicine and you took it to study? To anyone reading this- do not do take someone else's medicine.
Ritalin has side effects at any dose. 40 mg is a large dose. For people who do need to take Ritalin, it is advised to start at a low dose to see if it is tolerated and increase as needed. Someone who does take 40 mg has most likely been started at a lower dose first. That person may do fine on 40 mg, but another person may not.
Like most medication, Ritalin is a drug that must be taken under the supervision of a physician. OP, I hope you are OK. It should be worn off by now. If I had seen this, I would have recommended you call your doctor ASAP.
If someone is having side effects from medicine, posting here won't help. It's in your system and there is nothing that can be done about it online. Call the doctor/ER. Please don't take someone else's medicine in the first place.