Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MemoryError
#1
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 :

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.
Reply


Messages In This Thread
MemoryError - by mitmoot - Nov-27-2018, 07:49 PM
RE: MemoryError - by micseydel - Nov-27-2018, 08:12 PM
RE: MemoryError - by Larz60+ - Nov-27-2018, 08:12 PM
RE: MemoryError - by ichabod801 - Nov-27-2018, 08:35 PM
RE: MemoryError - by Gribouillis - Nov-27-2018, 09:03 PM
RE: MemoryError - by mitmoot - Dec-07-2018, 04:53 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  MemoryError in pywinauto.findwindows.find_windows – Need Help! ktw3857 1 334 Apr-18-2024, 04:28 PM
Last Post: itegumo
  Code starts slowing down? MemoryError AshkanDev 1 2,163 May-19-2020, 11:38 PM
Last Post: AshkanDev
  Getting MemoryError frames.write(buffer) kunwarsingh 0 1,619 Feb-10-2020, 09:39 PM
Last Post: kunwarsingh
  MemoryError AwaAgathe 0 1,741 Feb-26-2019, 02:57 AM
Last Post: AwaAgathe

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020