EXPORT VSR()
BEGIN
LOCAL b:=15, d:=37, fc:=200, fy:=4200, Mp:=1, Mn:=1, V:=1, FCG:=1.4;
LOCAL fac,fbpc,romin,robal,romax,A;
LOCAL Dp,Dn,wp,wn,rop,ron,ro,Asp;
LOCAL Asn,lambda,alfa,beta,Vcr;
LOCAL Vc1,Vc2,s1,s,Av,fyv;
INPUT ({b,d,Mp,Mn,V,fc, fy,FCG}, "VIGAS NTC RDF 04", {"b =", "d =", "M(+) =", "M(-) =", "V =", "f'c =", "fy =", "FC ="},
{"en cm", "en cm", "en Ton*m", "en Ton*m", "en Ton", "en kg/cm^2", "en kg/cm^2", "Factor de carga adimensional" } , "" );
CHOOSE (N, "ELIJA ESTRIBOS", {"1/4 plg","3/8 plg", "1/2 plg"} );
CASE
IF N==1 THEN Av:= 0.64; fyv:=2350 END;
IF N==2 THEN Av:=1.42; fyv:=4200 END;
Av:=2.54; fyv:=4200;
END;
fac:=0.8*fc;
IF fac < 280
THEN beta:=0.85
ELSE beta:=1.05 - (fac/1400)
END;
fbpc:=beta*fac;
romin:=0.0033;
robal:= fbpc*6000/(fy*(fy+6000)) ;
romax:=0.85*robal;
A:=0.9*b*d^2*fbpc;
Dp:=A^2 - 2*A*FCG*ABS(Mp*1E5);
Dn:=A^2 - 2*A*FCG*ABS(Mn*1E5);
IF Dp > 0 AND Dn > 0
THEN
wp:=(A- vDp)/A;
wn:=(A- vDn)/A;
rop:=wp*fbpc/fy;
ron:=wn*fbpc/fy;
//Cálculo de la cuantía necesaria
IF rop < romax AND ron < romax
THEN
IF rop<romin
THEN rop:=romin
ELSE rop:=wp*fbpc/fy
END;
IF ron<romin
THEN ron:=romin
ELSE ron:=wn*fbpc/fy
END;
//Se selecciona la cuantía máxima...
ro:=MAX(rop,ron);
//Cálculo del acero necesario
Asp:=rop*b*d;
Asn:=ron*b*d;
//Diseño por cortante
lambda:= 1 - 0.004 * (10*d - 700);
IF d < 70
THEN alfa:=1.0
ELSE
IF lambda < 0.8
THEN alfa:=0.8
ELSE alfa:=1.0
END;
END;
IF ro<0.015
THEN Vcr:= alfa*0.8*b*d*(0.2 + 20*ro)* vfac
ELSE Vcr:= alfa*0.8*b*d*(0.5)* vfac
END;
Vc1:= 1.5*Vcr / (0.2 + 20*ro);
Vc2:= 2.5*Vcr / (0.2 + 20*ro);
s1:= 0.8*Av*fyv*d / ((FCG*1E3*V) - Vcr);
IF (FCG*1E3*V) < Vc2
THEN
CASE
IF (FCG*1E3*V) < Vcr THEN s:= d/2 END;
IF (FCG*1E3*V) <Vc1 THEN s:= MIN(s1, d/2) *1_cm END;
s:= MIN(s1, d/4) *1_cm
END;
//Impresión de resultados:
PRINT("RESULTADOS DEL DISEÑO:");
PRINT( "b = " + b +"cm"+ " ; " + "d = " + d +"cm");
PRINT( "M(+) = " + Mp +"Ton*m");
PRINT( "M(-) = " + Mn +"Ton*m");
PRINT( "f'c = " + fc +"kg/cm^2");
PRINT( "fy = " + fy +"kg/cm^2");
PRINT( "ro (+)= " + rop + " ; " + "As(+)=" + Asp+ "cm^2" );
PRINT( "ro (-)= " + ron + " ; " + "As(-)=" + Asn+"cm^2" );
CASE
IF N==1 THEN PRINT("E 1/4 plg @ " + s) END;
IF N==2 THEN PRINT("E 3/8 plg @ " + s) END;
PRINT("E 1/2 plg @ " + s)
END;
IF (FCG*1E3*V) < Vcr THEN PRINT(" (Acero mínimo por cortante) ") END;
ELSE
PRINT ("FALLA POR CORTANTE")
END;
ELSE
PRINT ("FALLA: CUANTÍA MAYOR A LA MÁXIMA PERMITIDA");
END;
ELSE
PRINT ("FALLA: DIMENSIONES ESCASAS");
END;
END;