You are on page 1of 1

# -*- coding: utf-8 -*-

"""
Created on Sun May 10 22:54:22 2020

@author: leobardo
"""
#Find the specific volume of n-butane at 500 ºK and 18 atm using the Redlich-Kwong
#equation of state

from scipy.optimize import fsolve

Tc = float(input('ingresar la temperatura critica'))


Pc = float(input('ingresar la Presion critica critica'))
T = float(input('ingresar la temperatura'))
P = float(input('ingresar la Presion'))
R= float(input('ingresar constante de los gases'))

def volumen_especifico(v):
aRK = 0.42748 * (R * Tc)**2 / Pc
aRK = aRK * (Tc / T)**0.5
bRK = 0.08664 * (R * Tc / Pc)
Volumen = P*v**3 - R*T*v**2 + (aRK-P*bRK**2 - R*T*bRK)*v - aRK*bRK
return Volumen

print(volumen_especifico(2))

Volumen =fsolve(volumen_especifico, 2)

print(Volumen)

You might also like