jjgomera / iapws

python libray for IAPWS standard calculation of water and steam properties
GNU General Public License v3.0
170 stars 64 forks source link

IndexError with IAPWS97(h, s) #16

Closed E4K5 closed 8 years ago

E4K5 commented 8 years ago

What is happening and wrong here?

from iapws import IAPWS97 px = IAPWS97(h=3199,s=6.66) --------------------------------------------------------------------------- IndexError Traceback (most recent call last) <ipython-input-2-0b60695a8b57> in <module>() ----> 1 px = IAPWS97(h=3199,s=6.66)

c:\anaconda3\lib\site-packages\iapws-1.1.1-py3.5.egg\iapws\iapws97.py in __init__(self, **kwargs) 2690 def __init__(self, **kwargs): 2691 self.kwargs = IAPWS97.kwargs.copy() -> 2692 self.__call__(**kwargs) 2693 2694 def __call__(self, **kwargs):

c:\anaconda3\lib\site-packages\iapws-1.1.1-py3.5.egg\iapws\iapws97.py in __call__(self, **kwargs) 2697 if self.calculable: 2698 self.status = 1 -> 2699 self.calculo() 2700 self.msg = "Solved" 2701

c:\anaconda3\lib\site-packages\iapws-1.1.1-py3.5.egg\iapws\iapws97.py in calculo(self) 2843 _Region2(par[0], par[1])["s"]-s) 2844 T, P = fsolve(funcion, [To, Po]) -> 2845 propiedades = _Region2(T[0], P[0]) 2846 elif region == 3: 2847 P = _Backward3_P_hs(h, s)

IndexError: invalid index to scalar variable.

Now, when I use - Zittau´s Fluid Property Calculator Pressure p(h,s) Specific enthalpy h=3199 kJ/Kg Specific entropy s=6.66 kJ/(Kg K) Result: Pressure p=4.90455 MPa

jjgomera commented 8 years ago

Hi, Thanks for feedback, this bug has been solved in last commit. Cheers