He was abducted by Hagrid when he turned 11 so that would place him maybe around the fifth or sixth grade.
I don’t know if canonically there are math classes at Hogwarts.
The thought came to while I was watching the anime Mashle. If you are into Harry Potter and One-Punch Man I’d recommend giving it a watch.
Someone mentioned this community below; I wanted to highlight it.
Small promotion for !harrypotter@literature.cafe
There are laws baked into it, just like the formula proposed above. For whatever reason it’s not only about intent, there are certain quantities of “stuff” needed. How is it that someone like Snape can map out such a specific spell, if it didn’t take some sort of physical dynamics that could be measurable. Spells can’t just solely be about intent, otherwise anyone could yell out “Cowabunga” or something and have it do whatever they are thinking. And I know some of the names have intent baked in them, but not all of them. Some are straight up nonsense. This doesn’t even get into the fact that the wands are a straight up conduit to magic that are controlled more heavily than guns in most nations. Maybe the wizards just hide all the dragons, Phoenix and unicorns like nation states gaurd WMDs. It would be smart, without them most easy magic would be impossible and stuff would really take elbow grease with potions and whatnot.