You math is totally wrong. (sorry)
You cannot just use the aspect ratio without the number it RATIOS to. never. ever never never.
The aspect ratio is in a way not a real number. it is a ratio, and not by itself anything. it only can exist as a real number when combined with the tread width, and depends entirely on the tread width for a real physical distance
The aspect ratio (height of the sidewall) of the OEM tire 40 is related to the specific width of the OEM tire 235mm This pair of numbers with an 18 hole in the donut is the stock tire. ((so 40% of 235mm is the height of the sidewall)
It has a specific diameter, circumference et al. and one mile of rolling this tire down the road equals 819 revolutions of this wheel
Now for a replacement, to GET THE SAME NUMBER OF REVOLUTIONS you have to change the aspect ratio to whatever works..
So you WANT the 215mm tread width, and you want the 18 wheel donut hole. so what ever 'aspect' (or variable) gives near a 819 revolutions per mile is the winner.
that aspect ratio happens to calculate out to (as close as can be had 45 aspect ratio) which give a decent 814 turns per mile of travel ((So 45% of 215mm is the height of this sidewall)
++++++++++++
totall different method. more like hair of the dog method:
The stock 215/50/17 OEM wheel
The general rule like on Tire Rack is for a one inch bigger rim you cut 5% of the aspect ratio. This ONLY WORKS by chance,
the common chance that for most wheels in the 14 15 16 17 18 sizes, the one inch bigger wheel size calculates out to be a close approximation to 5% aspect loss (keeping the tread width the same)
Or going to a smaller wheel, a 5% aspect gain. (again keeping the tread width the same)
It is just a coincidence of the numbers in this range,(and the fact most tires we are interested in are 195mm to 280mm just a perfect range to fit by coincidence with the 2.54 mm per inch we can use and no magic of wheels at all. (forget all of what I just wrote in that sentence if it makes your head spin... it is for others also.)
If you are still confused go to Tire Rack dot com
http://tires.tirerack.com/search?p=Q&lbc=tirerack&uid=334789995&ts=custom&w=aspect ratio&af=cat:tiretech&isort=score&method=and&view=list