'Syntax Error: invalid syntax' for no apparent reason

0 votes

I've been trying to get a fix and can't find why the error keeps appearing. Pmin,Pmax,w,fi1 and fi2 have all been assigned finite values

guess=Pmin+(Pmax-Pmin)*((1-w**2)*fi1+(w**2)*fi2)

When i remove this line from the code, the same error appears at the next line of code, again for no reason I can think of

Edit: Here is the chunk of code I was referring to:

def Psat(self, T):
   pop= self.getPborder(T)
   boolean=int(pop[0])
   P1=pop[1]
   P2=pop[2]
   if boolean:
      Pmin = float(min([P1, P2]))Pmax = float(max([P1, P2]))
      Tr=T/self.typeMolecule.Tc
      w=0.5*(1+scipy.tanh((10**5)*(Tr-0.6))) fi1=0.5*(1-scipy.tanh(8*((Tr**0.4)-1)))
     fi2=0.460*scipy.sqrt(1-(Tr-0.566)**2/(0.434**2)+0.494
     guess = Pmin+(Pmax-Pmin)*((1-w**2)*fi1+(w**2)*fi2)
     #error here 
     solution = scipy.optimize.newton(funcPsat,guess, args=(T,self))
Aug 13, 2018 in Python by bug_seeker
• 14,970 points
39 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

You're missing a close paren in this line:

fi2=0.460*scipy.sqrt(1-(Tr-0.566)**2/(0.434**2)+0.494

There are three ( and only two ).

I hope This will help you.

answered Aug 13, 2018 by Priyaj
• 56,120 points

Related Questions In Python

0 votes
1 answer

How to fix this? ValueError: invalid literal for int() with base 10 error in Python

The following are totally acceptable in python: passing ...READ MORE

answered Nov 16, 2018 in Python by Nymeria
• 3,500 points
3,325 views
0 votes
1 answer

Python Pandas error: AttributeError: 'DataFrame' object has no attribute 'rows'

There is no attribute called “rows”. The ...READ MORE

answered Mar 28 in Python by Shri
346 views
0 votes
1 answer

Python error: unsupported operand type(s) for -: 'str' and 'str'

Hi. This error is caused because you ...READ MORE

answered May 12 in Python by Anjali
16 views
+2 votes
2 answers

Error while printing hello world in python.

You must be trying this command in ...READ MORE

answered Mar 31, 2018 in Python by GandalfDwhite
• 1,320 points
33 views
0 votes
1 answer

how can i count the items in a list?

suppose you have a list a = [0,1,2,3,4,5,6,7,8,9,10] now ...READ MORE

answered May 2 in Python by Mohammad
• 1,400 points
23 views
+4 votes
6 answers
0 votes
1 answer

Python error: No handlers could be found for logger “xhtml2pdf”

The only solution is to define a ...READ MORE

answered Sep 5, 2018 in Python by Priyaj
• 56,120 points
87 views
0 votes
1 answer

Why is openpyxl is required for loading excel format files?

Well, it sounds like openpyxl is not ...READ MORE

answered Aug 8, 2018 in Python by Priyaj
• 56,120 points
73 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.