You are on page 1of 1

clear

clc
function y=f(v)
tc=425.1
pc=37.96*100000
r=8.314
t=353
a=(0.42748*(r^2)*(tc^2.5))/pc
b=(0.08664*r*tc)/pc
y=((-b*t*r)/(v-b)^2)+(a/t^0.5)*((1/(2*v^2+2*v*b))+((2*v^2+v*b)/((v^2+v*b)^2)))
endfunction
function y=f3(v)
tc=425.1
pc=37.96*100000
r=8.314
t=393
a=(0.42748*r^2*tc^2.5)/pc
b=(0.08664*r*tc)/pc
y=((-b*t*r)/(v-b)^2)+(a/t^0.5)*((1/(2*v^2+2*v*b))+((2*v^2+v*b)/((v^2+v*b)^2)))
endfunction
function y=f2(t)
y=8.314*(1.935+(36.915*10^-3)*t-(11.402*10^-6)*t^2)
endfunction
tc=425.1
pc=37.96*100000
r=8.314
t=353
t2=393
a=(0.42748*r^2*(tc^2.5))/pc
b=(0.08664*r*tc)/pc
p=9.47*100000
coef2=[(-a*b)/(t^0.5),-(p*b^2+(r*t*b)-(a/(t^0.5))),-r*t,p]
p2=poly(coef2,"v","coeff")
u=roots(p2)
u=real(u)
vm2=max(u)
p=18.9*100000
coef3=[(-a*b)/(t2^0.5),-(p*b^2+(r*t2*b)-(a/(t2^0.5))),-r*t2,p]
p3=poly(coef3,"v","coeff")
u3=roots(p3)
u3=real(u3)
vm3=max(u3)
vm=900
resp= intg(vm2,vm,f)
resp2=intg(t,t2,f2)
resp3= intg(vm,vm3,f3)
disp(["Volume 1","Volume 2","Entalpia"])
disp([vm2,vm,resp])
disp(["Temperatura 1","Temperatura 2","Entalpia"])
disp([t,t2,resp2])
disp(["Volume 1","Volume 2","Entalpia"])
disp([vm,vm3,resp3])
H=resp+resp2+resp3
disp(H)

You might also like