Documentos de Académico
Documentos de Profesional
Documentos de Cultura
N <- 1
C <- 520
e <-430*(1-100/x)
F <- (1+0.089*hw-0.1166*hw*e2)*(1+0.07866*N)
f=function(x) ((N/((C/x)*((x-Ta)/(N+F))^(430*(1-100/x))))+1/hw)^-1 +
(o*(x+Ta)*(x^2+Ta^2))/((e2+0.000591*N*hw)^-1+(2*N+F-1+0.133*e1)/(e1) - N) - Ut
curve(f, from=0,to=1000,col="red")
abline(h=0,col="blue")
a=1
b=1000
x=(a+b)/2
i=1
cat("---------------------------------------------------------------------------\n")
cat(formatC( c("Iteracion","a","b","x","Error"),width = -16, format = "f", flag = " "), "\n")
cat("---------------------------------------------------------------------------\n")
cat(formatC( c((i), (a),(b),(x)), digits=5, width = -15, format = "f", flag = " "), "\n")
T=1*10^-4
E=2
while(E>T){
i=i+1
if(f(a)*f(x)<0)
{b=x}
else
{a=x}
x1=(a+b)/2
E=abs((x1-x)/x1)
x=x1
cat(formatC( c((i),(a) ,(b),(x),(E)), digits=5, width = -15, format = "f", flag = " "), "\n")
}
cat("---------------------------------------------------------------------------\n")
print(paste("EL VALOR DE LA RAIZ ES:",x,"EN LA ITERCION",i))
cat("---------------------------------------------------------------------------\n")
N <- 1
C <- 520
hw <- 10 #(W/m^2.°C)*(1°C/274K)
Ta <- 22 # °C +273..K
Tpm <-x
e <-430*(1-100/x)
F <- (1+0.089*hw-0.1166*hw*e2)*(1+0.07866*N)
f=function(x) ((N/((C/x)*((x-Ta)/(N+F))^(430*(1-100/x))))+1/hw)^-1 +
(o*(x+Ta)*(x^2+Ta^2))/((e2+0.000591*N*hw)^-1+(2*N+F-1+0.133*e1)/(e1) - N) - Ut
curve(f, from=0,to=1000,col="red")
abline(h=0,col="blue")
a=1
b=1000
x=(a+b)/2
i=1
cat("---------------------------------------------------------------------------\n")
cat(formatC( c("Iteracion","a","b","x","Error"),width = -16, format = "f", flag = " "), "\n")
cat("---------------------------------------------------------------------------\n")
cat(formatC( c((i), (a),(b),(x)), digits=5, width = -15, format = "f", flag = " "), "\n")
T=1*10^-4
E=2
while(E>T){
i=i+1
if(f(a)*f(x)<0)
{b=x}
else
{a=x}
x1=(a+b)/2
E=abs((x1-x)/x1)
x=x1
cat(formatC( c((i),(a) ,(b),(x),(E)), digits=5, width = -15, format = "f", flag = " "), "\n")
}
cat("---------------------------------------------------------------------------\n")
print(paste("EL VALOR DE LA RAIZ ES:",x,"EN LA ITERCION",i))
cat("---------------------------------------------------------------------------\n")
Resultado.
T <- 383 # K
Tc <- 105.1+273 # K
Pc <- 4060 # k Pascal = 1 KJ/m^3
R <- 0.08149 # kJ/kg.K
A <- 0.4278*(R^2)*(Tc^2.5)/Pc
B<- 0.08664*(R*Tc)/(Pc)
# v <- x
f=function(x) (R*T)/(x-B)-A/(x*(x+B)*(T^0.5))
curve(f, from=0.01856,to=0.5219,col="red")
a=0.5219 #m^3/Kg
b=0.01856 #m^3/Kg
n=20
h=(b-a)/n
I=0
for (k in 1:n-1) {
x=a+h*k
I=I+f(x)
}
I=(h/2)*(2*I+f(a)+f(b))
print(I)
Resultado.
=- 104.8978 KJ