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 2,278 views

1 answer to this question.

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
• 58,090 points

+1 vote
10 answers

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

0 votes
1 answer

What exactly is invalid syntax error?

please solve this error   def TakeImages():     Id=(text.get())   ...READ MORE

0 votes
1 answer

Python error "SyntaxError: invalid syntax"

but i m getting this ouput: Enter the ...READ MORE

0 votes
1 answer

Python error "TypeError: 'encoding' is an invalid keyword argument for this function"

Trying using the io module for this ...READ MORE

0 votes
2 answers

how can i randomly select items from a list?

You can also use the random library's ...READ MORE

+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

0 votes
1 answer

how do i use the enumerate function inside a list?

Enumerate() method adds a counter to an ...READ MORE

+5 votes
6 answers

Lowercase in Python

You can simply the built-in function in ...READ MORE

0 votes
1 answer

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

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

+1 vote
1 answer

Why is openpyxl is required for loading excel format files?

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