Dec-07-2018, 04:59 PM
Good afternoon,
Well second post about this small programm I have, after fixed the problem of memory error thank to you guys i have another one.
I've also checked on the forum but it seems nothing matched.
The problem I have is when I want to calculate my value I can just use some values for the speed { 2499 ,2856 3213 and 3570 } otherwise the program send me back the value is 0 . wich is quit weird for me
I suppose that my if condition is badly writed but don't really understand why...
Well if anybody had the same problem before that will help me a lot!
Thank you
Well second post about this small programm I have, after fixed the problem of memory error thank to you guys i have another one.
I've also checked on the forum but it seems nothing matched.
The problem I have is when I want to calculate my value I can just use some values for the speed { 2499 ,2856 3213 and 3570 } otherwise the program send me back the value is 0 . wich is quit weird for me
I suppose that my if condition is badly writed but don't really understand why...
Well if anybody had the same problem before that will help me a lot!
Thank you
print ('Enter your Head in feat:') Head = int(input ()) print ('Enter you speed in rpm') Speed = int(input()) if (2142< Speed <=2499): function = ((2499-Speed)/357)*((-1.75*10**-8)*Head**4+(1.21*10**-4)*Head**3-(3.1*10**-1)*Head**2+(3.53*10**2)*Head-1.49*10**5)+((Speed-2142)/357)*((-2.87*10**-9)*Head**4 +(2.58*10**-5)*Head**3-(8.71*10**-2)*Head**2+(1.3*10**2)*Head-7.03*10**4) if (2499< Speed <=2856): function = ((2856-Speed)/357)*((-2.87*10**-9)*Head**4+(2.58*10**-5)*Head**3-(8.71*10**-2)*Head**2+(1.3*10**2)*Head-7.03*10**4)+((Speed-2499)/357)*((-2.21*10**-9)*Head**4 +(2.67*10**-5)*Head**3-(1.2*10**-1)*Head**2+(2.38*10**2)*Head-1.74*10**5) if (2856< Speed <=3213): function = ((3213-Speed)/357)*((-2.21*10**-9)*Head**4+(2.67*10**-5)*Head**3-(1.2*10**-1)*Head**2+(2.38*10**2)*Head-1.74*10**5)+((Speed-2856)/357)*((-1.56*10**-10)*Head**4+(1.85*10**-06)*Head**3-(7.50*10**-3)*Head**2+(1.07*10**1)*Head-(1.60*10**-2)) if (3213<Speed and Speed<=3570): function = ((3570-Speed)/357)*((-1.56*10**-10)*Head**4+(1.85*10**-06)*Head**3-(7.50*10**-3)*Head**2+(1.07*10**1)*Head-(1.60*10**-2))+((Speed-3213)/357)*((-3.77*10**-10)*Head**4 +(7.19*10**-6)*Head**3-(5.12*10**-2)*Head**2+(1.61*10**2)*Head-1.87*10**5) print("The value is : ") print(function)