Nov-27-2018, 07:49 PM
First of all Hello guys,
I am quit definitely a newbie in the world of python programming.
I use to do R programming but not really object language.
I think I have read some stuff about my problem before posting another topic, but I cannot fix it by myself.
Here is the problem I have a simple function in python to calculate the flow rates of a pump with the speed and the head.
I have some functions that I have made since curves to approximate the reality.
The problem is that python says : MemoryError
So here is my code :
My laptop is 6 Go RAM and Spyder(my IDE) is 64 bits with linux tara 64 bits
The thing is for me that it seems the code is super bad ( yes I am new ) or I have a something wrong in setting.
Hope I have done a post following all the rules.
Thank you if you have any idea to help me.
I am quit definitely a newbie in the world of python programming.
I use to do R programming but not really object language.
I think I have read some stuff about my problem before posting another topic, but I cannot fix it by myself.
Here is the problem I have a simple function in python to calculate the flow rates of a pump with the speed and the head.
I have some functions that I have made since curves to approximate the reality.
The problem is that python says : MemoryError
So here is my code :
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) 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)+((Speed-2856)/357)*((-1,06*10**-9)*Head**4 +(1,65*10**-5)*Head**3-(9,57*10**-2)*Head**2+(2,46*10**2)*Head-2,33*10**5) if (3213< Speed >=3570): function = ((3570-Speed)/357)*((-1,06*10**-9)*Head**4+(1,65*10**-5)*Head**3-(9,57*10**-2)*Head**2+(2,46*10**2)*Head-2,33*10**5)+((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 :'+ function )and I just have MemoryError without anything else ( the debug mode doesn't say anything else ( or I have missed something))
My laptop is 6 Go RAM and Spyder(my IDE) is 64 bits with linux tara 64 bits
The thing is for me that it seems the code is super bad ( yes I am new ) or I have a something wrong in setting.
Hope I have done a post following all the rules.
Thank you if you have any idea to help me.