Let Gear Ratio = ( 1 + N3/N1 )/( 1 - ( ( N3*N4 )/( N5*N2) ) ), where N1, N2, ..., N5 must be integers. I'm looking to list combinations of N1, N2, ..., N5 that make the gear ratio fall within a specified range (i.e. 50 - 60), with upper limits to what the values of N1, N2, ..., N5 can be (i.e. 150).
I've done it using a for loop then and listing / filtering values that are within the given constraints, but am looking for a more efficient solution given that the for loop takes forever to finish.
I looked into using ndgrid from the following example: https://www.mathworks.com/matlabcentral/answers/308775-integer-division-problem-gear-ratio-related
But the arrays created would be much too large.
Any ideas / hints would be appreciated!