Upload
antonio-martinez-gimenez
View
218
Download
4
Embed Size (px)
DESCRIPTION
Calculo de secciones de hormigon armado
Citation preview
programa$=" flexo_compresion_v16" '8-2-13 2571
' #1 = ventana de dialogo principal (cierra todas ventanas)
' #t = pantalla de texto (salida de los calculos)
' #dat1 = pantalla de texto de salida de los datos
' #d = canal de entrada de los datos
' #5 = ventana de texto (entrada de la ayuda)
' #6 = canal de entrada del fichero de ayuda
' #g = ventada grafica de dibujo del esquema dela estructura
'....................................................................
nomainwin
dim properties(12), tipo$(15)
call configuracion
pi=4*atn(1) : r.g=360/(2*pi) : g.r=1/r.g : g$="SysGraph\"
noti$="Hola ";Usuario$;", soy el programa, lo siento,";chr$(10);_
"no puedo hacer nada si no";chr$(10);"buscas antes algun fichero."
UpperLeftX = 1 :WindowWidth = 455
UpperLeftY = 1 :WindowHeight =DisplayHeight*0.95
dim c$(5)
c$(1)="blue" :c$(2)="green":c$(3)="cyan":c$(4)="yellow":c$(5)=" white"
TextboxColor$=c$(3)
textbox #1.x1 , 3, 8,350,40
bmpbutton #1.dir,g$+"a.martinez4.bmp", [about],UL,360, 9
bmpbutton #1.buscar,g$;"lupa.bmp" , [buscar],UL, 33,48
bmpbutton #1.DAT ,g$;"RTANK2.bmp" , [AYUDA],UL,213,50
bmpbutton #1.con ,g$;"construction.bmp",[con],UL,280,50
TextboxColor$= c$(4) : textbox #1.pp$ , 3, 86,353,22
TextboxColor$= c$(3) : textbox #1.x3 , 3,110,152,40
TextboxColor$= c$(2) : textbox #1.L , 3,150, 34,20 'b base
textbox #1.H , 41,150, 34,20 'h Altura
textbox #1.p , 81,150, 34,20 'bw en secciones T
textbox #1.t ,121,150, 34,20 'hf en secciones T
TextboxColor$= c$(3) : textbox #1.x5 , 3,172, 35,20 'tipo
textbox #1.x6 , 41,172,112,20 'NOMBRE
textbox #1.Ndd , 3,216, 44,20 'Nd
textbox #1.x13 , 50,216, 44,20 'Mxd
textbox #1.Myd , 98,216, 44,20 'Myd
textbox #1.x14 , 3,256, 34,20
textbox #1.x15 , 41,256, 34,20
textbox #1.x16 , 81,256, 34,20
textbox #1.x17 ,121,256, 34,20
textbox #1.x18 , 56,306, 85,40 'ARMADOS
textbox #1.x19 , 2,346, 50,20 'COM
textbox #1.x20 , 2,366, 50,20 'TRAC 1
textbox #1.x21 , 2,386, 50,20 'TRAC 2
textbox #1.x9 ,163,199,195,43 'Unidades de ENTRADA
textbox #1.x10 ,163,270,195,20 'Unidades de SALIDA
textbox #1.vista,274,365, 83,20
TextboxColor$= c$(2)
textbox #1.tipo , 3,194, 35,20
textbox #1.nombre,41,194,112,20
textbox #1.Nd , 3,236, 44,20
textbox #1.Md ,50,236, 44,20
textbox #1.myd ,98,236, 44,20
textbox #1.re , 3,276, 34,20
textbox #1.ch ,41,276, 34,20 'coef seg hormigon
textbox #1.ca ,81,276, 34,20 'coef seg acero
textbox #1.cf ,121,276, 34,20 'coef seg fuerzas
textbox #1.nC , 56,346, 60,20 'nº barras compresion
textbox #1.dC ,120,346, 20,20 'diam " "
textbox #1.nT , 56,366, 40,20 'nº barras traccion nivel 1
textbox #1.dT ,100,366, 40,20 'diam " " "
textbox #1.nT2 , 56,386, 40,20 'nº barras traccion nivel 2
textbox #1.dT2 ,100,386, 40,20 'diam " " "
bmpbutton #1.port ,g$;"1325.bmp",[cerchas],UL,163,110
textbox #1.UeF ,185,245, 40, 20
textbox #1.UeM ,230,245, 40, 20
textbox #1.UeL ,275,245, 40, 20
statictext #1,"Momentos" ,160,293, 55, 20
textbox #1.UsM ,214,293, 40, 20
button #1.mT, "mT" ,[mT] ,UL,275,293, 35, 20
button #1.mkN,"mkN",[mkN],UL,322,293, 35, 20
statictext #1,"Cargas" ,160,315, 55, 20
textbox #1.UsF ,214,315, 40, 20
button #1.cm, "kN",[kN], UL,275,315, 25, 20
button #1.T , "T" ,[T] , UL,305,315, 25, 20
button #1.cm, "kL",[kL], UL,335,315, 25, 20
statictext #1,"Longitud" ,160,340, 55, 20
textbox #1.UsL ,214,340, 40, 20
button #1.cm, "cm",[cm], UL,275,340, 25, 20
button #1.m , "m" ,[m] , UL,305,340, 25, 20
button #1.in, "pu",[pu], UL,335,340, 25, 20
bmpbutton #1.calcular,g$;"434.bmp",[plot],UL,165,365
statictext #1, "Nº" ,165,430, 25,20
textbox #1.num ,190,430, 35,20
bmpbutton #1.marcar, g$;"marcar.bmp",[seccion.elegida],UL,240,430
button #1.escaf ,"Scala" ,[escala] ,UL,274,387, 40,20
textbox #1.esca ,274,409, 40,20
button #1.esca1 ,"+" ,[escala1],UL,276,430, 16,20
button #1.esca2 ,"-" ,[escala2],UL,296,430, 16,20
ttto=10
button #1.texto ,"Texto" , [textos],UL,317,387, 40,20
textbox #1.tex5 ,317,409, 40,20
button #1.tex1 ,"+" ,[text1] ,UL,318,430, 16,20
button #1.tex2 ,"-" ,[texto2] ,UL,338,430, 16,20
TextboxColor$= c$(3) : textbox #1.x11 ,155,486,110,20
textbox #1.x12 ,275,486, 78,20
TextboxColor$= c$(2)
statictext #1," r1 r2 r3" ,155,506,260,20
textbox #1.r1 ,152,526, 33,20
button #1.r11 ,"+" ,[gir.r11],UL,152,546, 16,20
button #1.r12 ,"-" ,[gir.r12],UL,169,546, 16,20
textbox #1.r2 ,192,526, 33,20
button #1.r21 ,"+" ,[gir.r21],UL,192,546, 16,20
button #1.r22 ,"-" ,[gir.r22],UL,209,546, 16,20
textbox #1.r3 ,232,526, 33,20
button #1.r31 ,"+" ,[gir.r31],UL,232,546, 16,20
button #1.r32 ,"-" ,[gir.r32],UL,249,546, 16,20
textbox #1.mx ,272,526, 38,20
bmpbutton #1.mxizq,g$;"Fizqui.bmp",[des.izq],UL ,274,548
bmpbutton #1.mxder,g$;"Fderec.bmp",[des.der],UL ,292,548
textbox #1.my ,315,526, 38,20
bmpbutton #1.myarr,g$;"Farrib.bmp",[des.arr],UL ,316,548
bmpbutton #1.myaba,g$;"Fabajo.bmp",[des.aba],UL ,334,546
textbox #1.mz ,365,526, 72,20
bmpbutton #1.mzmay,g$;"Zoom_out.bmp",[des.may],UL,366,548
bmpbutton #1.mzmen,g$;"Zoom_in.bmp" ,[des.men],UL,402,548
textbox #1.kk ,152,566, 33,20
button #1.kkma ,"+" ,[kk.ma],UL,152,590, 16,20
button #1.kkme ,"-" ,[kk.me],UL,169,590, 16,20
' button #1.curva,"RIGIDA 3D" ,[PortTipo3D],UL, 3,506,120,25
' button #1.r3D,"SECCION T" ,[Seccion.T],UL, 3,536,120,25
button #1.ras,"SECCIONES",[Flexion.Simple],UL, 3,545,100,20
TextboxColor$= c$(3)
textbox #1.hor ,3,570,52,20
textbox #1.ace ,3,595,52,20
TextboxColor$= c$(2)
textbox #1.e ,57,570,50,20 'fc$
textbox #1.pe ,57,595,50,20 'fy$
TextboxColor$= c$(3)
textbox #1.horu ,107,570,45,20 'UeT$
textbox #1.aceu ,107,595,45,20 'UeT$
'button #1.res,"Nueva perspectiva",[des],UL,232,566,120,25
bmpbutton #1.ros,g$;"DISKBTTN.bmp",[guardar.parametros],UL,272,590
TextboxColor$= c$(3)
bmpbutton #1.datos,g$;"SAVE2.bmp",[escribir.dat1],UL, 135,60
graphicbox #1.dor ,362,130 ,81,323 'helice2
graphicbox #1.dar , 3,217,150,330 'cielo
'----------------------------------------
ForegroundColor$ = "blue" ' c$(5)
open programa$ for dialog as #1
#1 "font arial 10 "
#1 "trapclose [fin]"
a$="!font arial 9 bold"
#1.x1 "H.A. 2013 - FLEXION Y COMPRESION"+chr$(13)+chr$(10)+_
"SECCIONES POLIGONALES" :#1.x1 ,"!Disable":#1.x1 "!font arial 9 17 bold"
#1.x5 "Nº" :#1.x5 ,"!Disable":#1.x5 "!font arial 8 "
#1.x6 "NOMBRE" :#1.x6 ,"!Disable":#1.x6 a$
#1.x9 "Unidades de ENTRADA" +chr$(13)+chr$(10)+_
"Cargas Momentos Long " :#1.x9 ,"!Disable":#1.x9 "!font arial 10 bold"
#1.x10 "Unidades de SALIDA" :#1.x10 ,"!Disable":#1.x10 "!font arial 10 bold"
#1.x11 " giros" :#1.x11 ,"!Disable"
#1.x12 "movimiento" :#1.x12 ,"!Disable"
#1.vista " VISTAS 2D" :#1.vista,"!Disable"
#1.x18 " ARMADOS"+chr$(13)+chr$(10)+" n d(mm)"' Codigo
#1.x18,"!Disable":#1.x18 "!font arial 6 15"
#1.x19 "COMP" :#1.x19,"!Disable"
#1.x20 "TRA.1":#1.x20,"!Disable"
#1.x21 "TRA.2":#1.x21,"!Disable"
#1.Ndd " Nd" :#1.Ndd,"!Disable": #1.Ndd a$
#1.x13 " Mxd" :#1.x13,"!Disable": #1.x13 a$
#1.Myd " Myd" :#1.Myd,"!Disable": #1.Myd a$
#1.x14 "rec" :#1.x14,"!Disable": #1.x14 a$
#1.x15 "cSh" :#1.x15,"!Disable": #1.x15 a$
#1.x16 "cSa" :#1.x16,"!Disable": #1.x16 a$
#1.x17 "cSf" :#1.x17,"!Disable": #1.x17 a$
#1.hor "HORMI":#1.hor,"!Disable": #1.hor a$
#1.ace "ACERO":#1.ace,"!Disable": #1.ace a$
'............................................................
Open g$+"a.martinez4.bmp" for Input as #F '
bitmapInfo$ = Input$(#F,LOF(#F)) '
Close #F '
bfType$ = Mid$(bitmapInfo$, 1, 2) 'Bitmap File Header '
bfSize = Value(Mid$(bitmapInfo$, 3, 4)) '
if bfSize<>24454 then notice "Repair dll sector 093XF45" : goto [fin] '
'...................................................................
loadbmp "c",g$;"helice2.bmp" :#1.dor "drawbmp c 0 0" '
loadbmp "c", g$;"cielo.bmp" :#1.dar "drawbmp c 0 0" '
#1.dar "flush" :#1.dor "flush" '
wait '
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Function Value(x$) '
Select Case Len(x$) '
Case 1 '
Value = Asc(x$) '
Case 2 '
Value= Asc(Mid$(x$,1,1)) '
Value=Value+(Asc(Mid$(x$,2,1))*256)'
Case 3 '
Value= Asc(Mid$(x$,1,1)) '
Value=Value+(Asc(Mid$(x$,2,1))*256) '
Value=Value+(Asc(Mid$(x$,3,1))*65536) '
Case 4 '
Value= Asc(Mid$(x$,1,1)) '
Value=Value+(Asc(Mid$(x$,2,1))*256) '
Value=Value+(Asc(Mid$(x$,3,1))*256^2) '
Value=Value+(Asc(Mid$(x$,4,1))*4294967296) '
End Select '
End Function '
'---------------------------------------------------------
[guardar.datos] '
if fileName$="" then notice noti$:wait '
datos=1 : gosub [datos] :datos=0 '
wait '
'kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
[guardar.parametros] '
if fileName$="" then notice noti$:wait '
#dat1 "Parametros perspectiva" '
#dat1 "r1, ";r1;", r2, ";r2;", r3, ";r3;", mx, ";mx;_ '
", my, ";my;", mz, ";mz;", kk, ";kk;", escala, ";escala '
wait '
'-------------------------------------------------------------------
[kk.ma] kk=kk+1 :#1.kk kk :#1.kk,"!contents? kk" :wait
[kk.me] kk=kk-1 :#1.kk kk :#1.kk,"!contents? kk" :wait
[des.der] mx=mx-kk :#1.mx mx :gosub [des] :wait
[des.izq] mx=mx+kk :#1.mx mx :gosub [des] :wait
[des.arr] my=my-kk :#1.my my :gosub [des] :wait
[des.aba] my=my+kk :#1.my my :gosub [des] :wait
[des.may] mz=mz-5*kk:#1.mz mz :gosub [des] :wait
[des.men] mz=mz+5*kk:#1.mz mz :gosub [des] :wait
[gir.r11] r1=r1+kk :#1.r1 r1 :gosub [des] :wait
[gir.r12] r1=r1-kk :#1.r1 r1 :gosub [des] :wait
[gir.r21] r2=r2+kk :#1.r2 r2 :gosub [des] :wait
[gir.r22] r2=r2-kk :#1.r2 r2 :gosub [des] :wait
[gir.r31] r3=r3+kk :#1.r3 r3 :gosub [des] :wait
[gir.r32] r3=r3-kk :#1.r3 r3 :gosub [des] :wait
[escala] #1.esca, "!contents? escala"
planta=1 : #g "cls" :gosub [planta.alzado] :wait
[escala1] if escala<0 then escala=0
escala=escala+1: #1.esca escala
planta=1 : #g "cls" :gosub [planta.alzado] :wait
[escala2] if escala>0 then escala=0
escala=escala-1: #1.esca escala
planta=1 : #g "cls" :gosub [planta.alzado] :wait
[textos] #1.tex5, "!contents? ttto"
planta=1 :gosub [planta.alzado] :wait
[text1] if texto<0 then texto=0
ttto=ttto+1:#1.tex5 ttto
planta=1 :gosub [planta.alzado] :wait
[texto2] if texto>0 then texto=0
ttto=ttto-1:#1.tex5 ttto
planta=1 :gosub [planta.alzado] :wait
'---------------------------------------------------------
'coeficientes de salida
[cm] CsL$="cm": #1.UsL CsL$: wait
[m] CsL$="m" : #1.UsL CsL$: wait
[pu] CsL$="pu": #1.UsL CsL$: wait
[kN] CsF$="kN": #1.UsF CsF$: wait
[T] CsF$="T" : #1.UsF CsF$: wait
[kL] CsF$="kL": #1.UsF CsF$: wait
[mT] CsM$="mT": #1.UsM CsM$: wait
[mkN] CsM$="mkN":#1.UsM CsM$: wait
'-----------------------------------------------
[buscar] '
filedialog "Listar ficheros", "*.dat", fileName$ '
if fileName$<>"" then '
pp$= fileName$ '
#1.pp$ fileName$ '
call abrirdat '
open fileName$ for input as #datos2 '
'---------------------------------- '
t$="": line input #datos2, t$ :#dat1 t$ '
while eof(#datos2)=0 '
line input #datos2,t$ '
if t$<>"" then filas=filas+1 :#dat1 t$ '
wend '
close #datos2 '
'----------- '
if escala=0 then escala=1 :ttto=10 '
if kk=0 then kk=1 '
else '
notice noti$ '
end if '
wait '
'......................................
[seccion.elegida] '
if fileName$="" then notice noti$:wait '
open fileName$ for input as #datos2 '
#1.num,"!contents? numero" '
if numero>filas then numero=filas '
for n=1 to numero+1: line input #datos2,t$: next '
gosub [cabecera] '
gosub [datos.iniciales] '
call configuracion '
gosub [datos.pantalla] '
close #datos2 '
wait '
'.............................................................
[datos.pantalla] 'situa los datos desde el .dat en la pantalla izquierda
#1.r1 r1: #1.r2 r2 :#1.r3 r3:#1.mx mx:#1.my my:#1.mz mz
#1.kk kk: #1.esca escala:#1.L b :#1.H h :#1.p bw:#1.t hf
#1.e fc$ : #1.pe fy$ : #1.tipo tipo :#1.nombre nombre$
#1.tex5 ttto :#1.Md Md:#1.myd Myd:#1.Nd Nd:#1.re rec:#1.ch ch:#1.ca ca:#1.cf cf
#1.nC nC :#1.dC dC:#1.nT nT :#1.dT dT:#1.UeF UeF$:#1.UeM UeM$: #1.UeL UeL$
if UeT$="k" then UeT$="kg/cm2"
#1.horu UeT$ :#1.horu,"!Disable" :#1.horu "!font arial 7 bold"
#1.aceu UeT$ :#1.aceu,"!Disable" :#1.aceu "!font arial 7 bold"
return
'------------------------------------------------------------
[escalas]
a$=", "+t$ : ndc=len(a$)+2 :m=0
dim carac$(ndc)
dim dato(17)
For n=1 to ndc
carac$(n)=mid$(a$,n,1)
if carac$(n) ="," then m=m+1
if carac$(n-1)=" " then pepe=1
if pepe =1 then caracter$=caracter$+carac$(n)
if carac$(n) ="," then pepe=0
dato(m)=val(caracter$)
if carac$(n) ="," then caracter$=""
next n
ndd=m
r1=dato(2) :r2=dato(4) :r3=dato(6):mx=dato(8):my=dato(10)
mz=dato(12):kk=dato(14):escala=dato(16)
m=0
return
'........................................................................
[datos.iniciales] 'lee datos del fichero de texto *.dat
' nombre nº Fue UeF Md UeM rec UeL nC dC nT dT b h bw hf '
' FS_R_D01 1 0 kN 4.12 mT 4 cm 0 10 0 16 40 25 0 0 '
fck=0:fyk=0 :bw=0:hf=0 :desplaza=0 :COdA$="" '
a$=" "+t$+" " : ndc=len(a$)+2 : m=0 '
dim dato$(41) '
dim carac$(ndc) '
For n=1 to ndc '
carac$(n)=mid$(a$,n,1) '
if carac$(n)<>" " and carac$(n-1)= " " then m=m+1 '
if carac$(n)<>" " then pepe=1 '
if carac$(n) =" " and carac$(n-1)<>" " then pepe=0 '
if pepe =1 then caracter$=caracter$+carac$(n):dato$(m)=caracter$ '
if pepe =0 then caracter$="" '
next n '
'...............................................................................'
ndd=m : m=0 '
nombre$=dato$(1) :tipo=val(dato$(2)):fc$=dato$(3) :fy$=dato$(4):UeT1$=dato$(5)'
Nd =val(dato$(6)):UeF$=dato$(7) :Md=val(dato$(8)):Myd=val(dato$(9)) '
UeM$=dato$(10) :rec=val(dato$(11)):UeL$=dato$(12) :nC=val(dato$(13))
dC=val(dato$(14))
if len(dato$(13))>2 then 'secciones poligonales '
for n=1 to 2*len(dato$(13)) 'coordenadas de vertices '
if n mod 2 =1 then x((n+1)/2)=val(dato$(14+n)) '
if n mod 2 =0 then y(n/2) =val(dato$(14+n)) '
next '
end if '
if len(dato$(13))<3 then 'secciones rectangulares o T '
nT=val(dato$(15)):dT=val(dato$(16)) '
b =val(dato$(17)):h =val(dato$(18)):bw=val(dato$(19)):hf=val(dato$(20)) '
end if '
gosub [cabecera] '
UeT$=UeT1$ '
if fc$="0" then fc$=str$(fck.con) : fy$=str$(fyk.con) :UeT$=UeT.con$ '
iniciales=1 '
return '
'.....................................................................
[datos] 'lee datos de la pantalla izquierda y asigna variables
#1.L, "!contents? b" :#1.H, "!contents? h" :#1.p, "!contents? bw"
#1.t, "!contents? hf":#1.tipo,"!contents? tipo":#1.nombre,"!contents? nombre$"
#1.Nd,"!contents? Nd" :#1.Md, "!contents? Md" :#1.myd, "!contents? Myd"
#1.re,"!contents? rec":#1.ch, "!contents? ch" :#1.ca, "!contents? ca"
#1.cf,"!contents? cf" :#1.nC, "!contents? nC" :#1.dC, "!contents? dC"
#1.nT,"!contents? nT" :#1.dT, "!contents? dT"
#1.e, "!contents? fck":#1.pe, "!contents? fyk"
if right$(fc$,1)="d" then fcd=val(fc$):fck=0
if right$(fy$,1)="d" then fyd=val(fy$):fyk=0
return
'------------------------------------------------------------------
[escribir.dat1] '
gosub [datos] '
gosub [escribir.datos.dat1] '
wait '
[escribir.datos.dat1]
'nombre nº fck fyk UeT Fue UeF Mdx Mdy UeM rec UeL nC dC nT dT b
h bw hf
'FS_R_D01 1 0 0 c 0 kN 4.12 0 mT 4 cm 0 0 0 16 40
25 0 0 '
'POLI_D05 28 99d 4000d k 110.59 T 8.85 8.85 mT 5 cm 222332 0 8 28 8
8 28 8 28 -22
#dat1 te$(nombre$ ,8);" ";te$(str$(tipo),2);" ";te$(fc$,4);" ";te$(fy$,5);"
";te$(UeT1$,1);" ";_
te$(str$(Nd),6);" ";te$(UeF$,3);" ";te$(str$(Md) ,5);" ";te$(str$(Myd) ,5);"
";te$(UeM$,3);" ";_
te$(str$(rec),3);" ";te$(UeL$,2);" ";te$(str$(nC),6);" ";te$(str$(dC),2);"
";te$(str$(nT) ,2);" ";_
te$(str$(dT),2);" ";te$(str$(b),3);" ";te$(str$(h),4);" ";te$(str$(bw),4);"
";te$(str$(hf),4)
return
'---------------------------------------------------------------
sub abrirdat '
if properties(6)=1 then call closedat '
if properties(6)=0 then '
UpperLeftX=DisplayWidth/3: WindowWidth =1.7*DisplayWidth/3 '
UpperLeftY=1 : WindowHeight=DisplayHeight*0.95*0.5 '
open "dat1" for text as #dat1 '
'**************************** '
#dat1 "!font courier new 14" '
#dat1 "!trapclose [closeDat]"; '
properties(6) = 1 '
else '
#dat1 "!cls";: call closedat '
end if '
end sub '
[closeDat] '
call closedat '
wait '
sub closedat '
if properties(6)=1 then close #dat1 :properties(6)=0'
end sub '********** '
'---------------------------------------------------
[AYUDA]
call abrirAyuda
wait
sub abrirAyuda
if properties(5) = 0 then
UpperLeftX= DisplayWidth/3 :WindowWidth =DisplayWidth/3
UpperLeftY= 1 :WindowHeight =DisplayHeight*0.95
open "AYUDA" for text as #5
'**************************
#5 "!trapclose [cerrarAyuda]";
properties(5) = 1
open "ayuda-ha_2.txt" for input as #6
'--------------------------------
#5 "!font "; "arial 10";
while eof(#6)=0:line input #6, a$: #5 a$:wend
close #6
end if
end sub
[cerrarAyuda]
call cerrarAyudas: wait
sub cerrarAyudas
if properties(5)=1 then close #5:properties(5)=0
end sub '*******
'---------------------------------------------
sub configuracion
global Usuario$, ch,ca,cf,fck.con,fyk.con,UeT.con$,aaa$,Dmin,Dmax,dM
open "config-ha.txt" for input as #conf
input #conf, a$,Usuario$
input #conf, a$,ch,a$,ca,a$,cf
input #conf, a$,fck.con,UeT.con$
input #conf, a$,fyk.con,aaa$
input #conf, a$,coe.poi
input #conf, a$,mo.di.ter
input #conf, a$,Dmin,a$
input #conf, a$,Dmax,a$
input #conf, a$,dM,a$
close #conf
end sub
'.................
[con]
call configuracion
call abrirCon
wait
'...........
sub abrirCon
if properties(12) = 0 then
UpperLeftX= DisplayWidth/3 :WindowWidth =DisplayWidth/3
UpperLeftY= 1 :WindowHeight =DisplayHeight*0.3
open "CONFIGURACION" for text as #con
'************************************
#con "!trapclose [cerrarCon]";
properties(12) = 1
open "config-ha.txt" for input as #conf
'----------------------------------------
#con "!font "; "Courier New 10";
while eof(#conf)=0:line input #conf, a$:#con a$: wend
close #conf
end if
end sub
[cerrarCon]
call cerrarCon: wait
sub cerrarCon
if properties(12)=1 then close #con:properties(12)=0
end sub
wait
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
[fin]
call closeGraphWindow
call closeTextWindow
close #1
if properties(5) =1 then close #5
if properties(6) =1 then close #dat1
if properties(7) =1 then close #ab
if properties(8) =1 then close #c
if properties(9) =1 then close #3d
if properties(10)=1 then close #col
if properties(12)=1 then close #con
end
'00000000000000000000000000000000000000000000000000000000
[chubi] data 0.0581,0.2352,0.338,0.5,0.662,0.7648,0.9419
'oooooooooooooooooooooooooooooooooooooooooooooooooooooooo
[plot]
'oooooooooooooooooooooooooooooooooooooooooooooooooooooooo
plot=1 '
planta=1 '
if iniciales=0 then gosub [datos.iniciales] '
iniciales=0 '
call configuracion '
gosub [datos] '
if fileName$="" then hh=hh+1:notice noti$:wait
call openTextWindow 'abre la pantalla de resultados
perspectiva=0 '
if opc$="d" then '
ppd$=right$(pp$,9) : ppd$=left$(ppd$,8)'
ndg$="c:\dc\"+ppd$+".gra" '
open ndg$ for output as #3 '
#3 ndg$ : dc2=1 '
end if '
open pp$ for input as #d '
fff$=pp$ '
no=0 '
if len(str$(nC))>2 then [poligonal]
'-----------------------------------------------
gosub [unidades.salida] '
gosub [unidades.entrada] '
'*********************** '
if bw=0 then qq$="Rectangular" else qq$="T" '
if Md=0 then ww$="COMPROBACION" else ww$="DIMENSIONADO" '
#t ww$;" DE PIEZA DE H.A." '
#t "Seccion ";qq$;" - Metodo parabola-rectangulo." '
#t "__________________________________________________" '
#t "" '
restore [chubi]: for i=1 to 7:read a:ch(i)=a:next '
Mdd=Md '
if UeM$="mkN" then Md=Md/10 'paso de mkN a mT '
'resistencias de materiales '
fck=fck*CeTh : fyk=fyk*CeTa '
fcd=fcd*CeTh : fyd=fyd*CeTa '
if fcd=0 then fcd=fck/ch '
if Nd >0 and dC=0 then fcd=fcd*0.9 '
'unid. de calc. hor=T/m2 y ace=T/cm2 '
if fyd=0 then fyd=fyk/ca '
#t "MATERIALES" '
#t "Resistencia Caracteristica calculo" '
#t " ";UeT$ '
#t "Hormigon = ";c2$(fck/CeTh);" ";c2$(fcd/CeTh) '
#t "Acero = ";c2$(fyk/CeTh);" ";c2$(fyd/CeTa) '
#t "__________________________________________________" '
if len(COdA$)>2 then [poligonal] '
b=b*CeL : h=h*CeL '
rec=rec*CeL 'Recubrimiento mecanico a ejes (m) '
d=h-rec '
dC.min=10 'NP=nC 'nº de redondos compresion '
if dT=0 then dT=10 'diametro minimo armadura traccion mm'
'nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
if Nd>0 and Myd=0 then [dimen.compuesta]
if Myd>0 then [esviada]
'nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
aH=b*h ':secte=0
Dn=0
if bw>0 then
bw=bw*CeL: hf=hf*CeL 'escuadria seccion en T
secte=1 : aH=b*hf+bw*(h-hf)
end if
'................
aC=pi*nC*dC^2/400 'area de armadura a Compresion cm2
if fyd<3.41 or fyd>3.73 then [a]
ROmin=0.0033 : goto [b] 'cuantia geometrica minima
[a] if fyd<4.25 or fyd>4.64 then [c]
ROmin=0.0028 : goto [b]
[c] ROmin=0.016/(fyd+1.3)
[b] Amin =10000*aH*ROmin 'area min de armadura de traccion en cm2
'...................... ' NPA=nC
FCmax=0.85*fcd 'tension max del diagrama parabola-rectangulo
antonio=0 'canto util
[nuevo.calculo]
x1=0.628 : x=x1 'profundidad limite
'......................................................
if Mdd=0 then Md=Mdd: goto [comprobacion]
'******************************************************
' dimensionado flexion simple
nBl=0 : if h-hf>0.3 then nBl=int((h-hf)/(Dmax/100))+2
gosub [dimensionar]
'******************
if mu<=Md then [ddn] ' necesita mas armadura de compresion
e1=erm : x2=0.2 :ppp=erm ' error y nuevo tanteo
while abs(erm)>0.0001 ' busqueda de posicion de la linea neutra
x=x2 : gosub [dimensionar] ' error del ultimo tanteo
e2=erm: gosub [correccion]
wend
goto [nns]
[ddn]
Dn=(Md-mu)/(d-rec):nu=nu+Dn ' incremento de axil
da=Dn/s1 :aC=aC+da ' incremento de area
[nns]
if dC=0 then dC=dM
abarp=pi*dC^2/400 ' area de 1 barra a compresion cm2
nC=aC/abarp ' nº de barras a compresion
n.C=nC
nsT=nu 'axil de la armadura a traccion
s2=0.21*epsm*(1-x)/x : if abs(s2)>fyd then s2=fyd*sgn(s2) 'tension
aT =nsT/s2 : if aT<Amin then aT=Amin 'area total calculada cm2
abar=pi*dT^2/400 'area de 1 barra s/datos
iniciales
n.T =aT/abar: nT=n.T : if nT>int(n.T) then nT=int(n.T)+1 'nº de barras
s/calculo
AaC=ns+Dn :MaC=ms+erm 'axil del acero a compresion
AhC=nc :MhC=mc 'axil hormigon a "
AaT=nsT :MaT=Md 'Axil acero a traccion
gosub [flexion.simple]
'*********************
if dC=0 then dC=dC.min
if nC>int(nC) then nC=int(nC)+1
#t "Area <min> T = ";d2$(Amin);" cm2"
#t "Nº de barras ajustados T = ";d0$(nT);" d/ ";d0$(dT) ;" mm"
nT.min=int((b-2*rec)/(Dmax/100))+2 : if nT<nT.min then nT=nT.min
base=b:if bw>0 then base=bw
basE=base-2*rec
nT1=int((basE)/(dT/1000+Dmin/100)+1)
if nT1>= nT then nT1=nT : nT2=0
if nT1< nT then nT2=nT-nT1 : if nT2=1 then nT2=2
#t "nº de redondos en capa 1 = ";d0$(nT1);_
" dis.libre = ";t0$(1000*basE/(nT1-1)-dT);" mm"
aT1=nT1*pi*dT*dT/400 : #t "Area de acero en capa 1 = ";d2$(aT1)
if nT2=0 then [res.cal]
aT2 =aT-aT1 : #t "Area de acero en capa 2 = ";d2$(aT2)
abar.capa2=aT2/nT2 'area de 1 barra de capa 2
dT2=int(sqr(abar.capa2*400/pi))+1 'diametro de barras en capa 2
if dT2>16 and dT2<20 then dT2=20
if dT2>20 and dT2<25 then dT2=25
#t "Diametro de acero capa 2 = ";d0$(dT2)
#t "nº de redondos en capa 2 = ";d0$(nT2);_
" dis.libre = ";t0$(1000*basE/(nT2-1)-dT2);" mm"
if nT> nT1 and antonio<>1 then
antonio=1
d=d-(dT+Dmin*10)/1000/2
#t "nuevo canto util d = ";d2$(d);" m": goto [nuevo.calculo]
end if
#t "__________________________________________________"
goto [res.cal]
'vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
'vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
[comprobacion]
Md=0 : nBl=0
if nC=0 then nC=nC.min
if dC=0 then dC=dC.min
aT =pi*nT*dT*dT/400 'area de la armadura de traccion
nT1=nT : nT2=0
'.................
x2=0.1 : gosub [comprobar]
e1=nu : if nu<=0 then [kkk]
while abs(nu)>0.0001
x=x2 : gosub [comprobar]
e2=nu: gosub [correccion]
wend
[kkk]
AaC=aC*s1 :MaC=ms 'axil y momento del acero a compresion
AhC=nc :MhC=mc 'axil " hormigon a "
AaT=aT*s2 :MaT=mu 'Axil " acero a traccion
gosub [flexion.simple]
goto [res.cal]
'----------------------------------------------------------
[flexion.simple]
#t "DATOS INICIALES"
#t "Escuadria de la pieza (b x h) = ";d0$(b*100);"x";d0$(h*100);
if bw>0 then #t "x";d0$(bw*100);"x";d0$(hf^100) else #t ""
if Md>0 then
#t "Momento de calculo = ";t2$(Md*CsM);" ";mo$ ' mT
else
#t "Armadura inicial de compresion ";d2$(nC);" r dia= ";d0$(dC);" mm"
#t "Armadura inicial de traccion ";d2$(nT);" r dia= ";d0$(dT);" mm"
end if
#t "__________________________________________________"
#t "CALCULOS DEL HORMIGON Y ACERO A COMPRESION"
#t "Profundidad de la linea neutra xd = ";d2$(xd*CsL);" ";lo$ ' m
#t ""
#t " Axil Momen. Tension Deforma. Area nº"
#t " T mT N/mm2 o/oo<max cm2 cal ajus "
#t "Acero a COMPRESION ";t2$(AaC);" ";d2$(MaC);" ";t2$(s1*100);" ";_
d2$(aC);" ";d2$(n.C);" ";d0$(nC)
#t "Hormigon ";t2$(AhC);" ";d2$(MhC);" ";t2$(FCmax/100);" ";_
d0$(epsc1);" ";d0$(epsm)
#t "Acero de TRACCION ";t2$(AaT);" ";d2$(MaT);" ";t2$(s2*100) ;" ";_
d0$(0.21*epsm);" ";d2$(aT);" ";d2$(n.T);" ";d0$(nT)
#t
"______________________________________________________________________________"
nC.min=int((b-2*rec)/(Dmax/100))+2
if bw>0 and nC.min<4 then nC.min=4
if nC<nC.min then nC=nC.min
#t "nº de barras minima por ancho C = ";d0$(nC.min);" d/ ";d0$(dC.min);" mm"
#t "nº de barras ajustado en ancho C = ";d0$(nC) ;" d/ ";d0$(dC) ;" mm"
return
'-----------------------------------------------------
[correccion] ' correccion regula falsi
dx=(x1-x2)/(e1-e2)*e2 : if abs(dx)>0.2 then dx=0.2*sgn(dx)
if dx>x2 then dx=x2-0.01 ' evitar valores negativos
x1=x2 : e1=e2 : x2=x2-dx ' nuevos valores tanteo
return
'=============================================================
[dimensionar]
gosub [comun.resulta]
ns=aC*s1 : ms=aC*s1*(d-rec) 'axil y momento armadura C
nu=nc+ns : mu=mc+ms 'axil y momento ultimo
erm=Md-mu 'error en momentos
return
'...................................
[comprobar] 'COMPROBACION
gosub [comun.resulta]
s2=0.21*epsm*(1-x)/x : if abs(s2)>fyd then s2=fyd*sgn(s2)'Tension armadura T
ns=aC*s1-aT*s2 : ms=aC*s1*(d-rec) 'axil y momento de las armaduras
nu=nc+ns : mu=mc+ms 'axil y momento ultimo
return
',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
[comun.resulta]
if x<0.2593 then epsm=100*x/(1-x) else epsm=35
xd=x*d 'profundidad de la linea neutra
nc=0:mc=0 'esfuerzos hormigon
if bw=0 or xd<=hf then [uu1]
u1=0 :u2=hf:bu=b :gosub [integra] 'seccion T zona del ala
u1=hf:u2=xd:bu=bw :gosub [integra] ' " " zona del nervio
goto [ss1]
[uu1] u1=0:u2=xd:bu=b:gosub [integra] 'seccion rectangular
[ss1] s1=0.21*epsm*(x-rec/d)/x : if abs(s1)>fyd then s1=fyd*sgn(s1) 'tension C
return
'.........................................
[integra] '
du=u2-u1 '
for i=1 to 7 '
u=u1+du*ch(i) '
epsc=epsm*(x-u/d)/x 'deformacion del hormigon '
if i=1 then epsc1=epsc '
sigc=FCmax 'tension del hormigon '
if epsc<=20 then F=1-epsc/20: sigc=FCmax*(1-F*F) '
dn=sigc*bu*du/7 'axil fibra '
nc=nc+dn '
mc=mc+dn*(d-u) '
next '
return '
'mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
'vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
[dimen.compuesta]
COdA=nC
q$="Soportes rectangulares de hormigon armado a flexo-compresion recta"
linea$=
"_________________________________________________________________________"
#t q$
#t " Dimensiones recubr.(cm) Momento Carga Cod_armado"
#t " ";d0$(b*100);" ";d0$(h*100);" ";d0$(rec*100);" ";_
d2$(Md);" ";d2$(Nd);" ";d0$(COdA)
#t linea$
#t " CALCULO"
nBf=int(COdA/10) 'codigo de armado
nBl=COdA-10*nBf
#t "Numero de barras frontales ";d0$(nBf)
#t "Numero de barras laterales ";d0$(nBl)
if nBf=1 then nBf=2
n(1)=nBf:n(nBl)=nBf 'barras de la primera y ultima capa
y(1)=h/2-rec:y(nBl)=-1*y(1) 'profundidad de la primera y ultima capa
Dcapa=(h-2*rec)/(nBl-1)
#t "Distancia entre capas ";d2$(Dcapa);" m"
For i=2 to nBl-1
n(i)=2 'numero de barras de cada capa intermedia
y(i)=y(i-1)-Dcapa 'profundidad de cada capa
next
'd=h-rec
nBAR=2*(nBf+nBl)-4
#t "Canto util ";d2$(d);" m"
#t "Numero total de barras ";d0$(nBAR)
if dC>0 then [flexo.comp.comprobacion]
'*************************************
uMIN =40*b*h*fyd/nBAR 'capacidad mecanica minima de cada barra
EXmin=0.02*h/b
if EXmin<0.02 then EXmin=0.02
if EXmin<h/20 then EXmin=h/20
#t "Excentricidad minima ";d0$(EXmin*100);" cm"
if Md<0 then Md=-1*Md 'Solicitaciones
if Md<Nd*EXmin then Md=Nd*EXmin
#t "Momento flector (incluso excentricidad) ";d2$(Md);" mT"
x1=0.7*h:x2=0.71*h 'valores de tanteo de profundidad de la linea neutra
x3=x1:gosub [1710]:e1=erro 'error del primer tanteo
while abs(erro)>0.0001
x3=x2
gosub [1710]
e2=erro 'error del ultimo tanteo
dx=(x1-x2)/(e1-e2)*e2 'correccion regula falsi
if dx> 0.2*h then dx= 0.2*h 'valor maximo de la correccion
if dx<-0.2*h then dx=-0.2*h 'valor minimo de la correccion
if Nd>0 and dx*e2>0 then dx=-1*dx 'direccion equivocada
if dx>x2 then dx=x2-0.01 'evitar valores negativos
x1=x2:e1=e2:x2=x2-dx 'nuevos valores de tanteo
wend
aBAR=(Md-Mc)/Ms 'area de una barra
uBAR=aBAR*fyd 'capacidad mecanica de una barra
if uBAR<uMIN then uBAR=uMIN : aBAR=uMIN/fyd
diam=20*sqr(aBAR/pi) 'diametro de una barra
#t "Capacidad mecanica-1 barra y diametro-barras ";d2$(uBAR);" ";d2$(diam)
#t "Capacidad mecanica-cara ";d2$(uBAR*nBf)
xd=x3
goto [res.cal]
'----------------------------------------------------------------------------
'----------------------------------------------------------------------------
[comun.compuesta] 'Resultante Calculo de una fibra neutra
x=x3/d 'profundidad relativa de la fibra neutra
if x>0.1667 then [1770] 'dominio 2a
fi =4.25*x*(3-8*x)/(3*(1-x)^2) 'parametro axil relativo
lambda=(4-9*x)/(12-32*x) 'parametro profundidad relativa
epsc =100*x/(1-x):goto [1900] 'deformacion fibra superior
[1770] if x>0.2593 then [1810] 'dominio 2b
fi =0.85*(16*x-1)/15/x
lambda=(171*x^2-22*x+1)/(320*x^2-20*x)
epsc =100*x/(1-x):goto [1900]
[1810] if x3>h then [1850] 'dominios 3 y 4
fi =0.688095
lambda=0.415966
epsc =35 :goto [1900]
[1850]
x=x3/h 'dominio 5: nueva definicion de x
fi =0.85*(1-64/(21*(7*x-3)^2))
lambda=3*(2401*x^2-2058*x+185)/(14*(1029*x^2-882*x+125))
epsc =20*x/(x-3/7)
[1900] if x3>h then [1940] : 'axil y momento del hormigon
Nc=x3*b*fcd*fi : Mc=Nc*(h/2-x3*lambda) : goto [1960]
[1940] Nc=h*b*fcd*fi : Mc=Nc*h*(0.5-lambda)
[1960]
Ns=0:Ms=0 'axil y momento armaduras
epss=0.21*epsc 'valor auxiliar calculo de tension (sigs)
for i=1 to nBl 'en cada capa de armaduras
sigs=epss*(x3+y(i)-h/2)/x3
if sigs<-1*fyd then sigs=-1*fyd
if sigs> fyd then sigs= fyd
Ns=Ns+sigs*n(i)
Ms=Ms+sigs*n(i)*y(i)
next i
return
'..............
[1710]
gosub [comun.compuesta]
Nf=(Nd-Nc):Mf=(Md-Mc)
erro=(Nf-Ns*Mf/Ms)/Nd
return
'nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
'nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
[flexo.comp.comprobacion]
pepe=0
diam=dC
Nd.1=Nd 'guardamos el dato para la 2ª comprobacion: el mom max con este axil
'...........................................................................
aMIN=40*b*h/nBAR 'area minima por barra
aBAR=pi*diam*diam/400
if aBAR<aMIN then print "No cumple cuantia minima"
EXmin=0.02*h/b
if EXmin<0.02 then EXmin=0.02
if EXmin<h/20 then EXmin=h/20
#t "Excentricidad minima ";d0$(EXmin*100);" cm"
#t "Diametro de las barras ";dC;" mm"
#t ""
'.....................................
[nuevoC]
' Solicitaciones
if Md<0 then Md=-1*Md
EX=Md/Nd
if EX<EXmin then EX=EXmin
if EX>h then
EX=1/EX : KEX=1
else
KEX=0
end if
x1=0.6*h:x2=0.9*h 'valores de tanteo de profundidad de la l.neutra
x3=x1 :gosub [1710a] : e1=erro 'error del primer tanteo
while abs(erro)>0.0001
x3=x2 :gosub [1710a] : e2=erro 'error del ultimo tanteo
dx=(x1-x2)/(e1-e2)*e2 'correccion regula falsi
if dx> 0.2*h then dx= 0.2*h 'valor maximo de la correccion
if dx<-0.2*h then dx=-0.2*h 'valor minimo de la correccion
if Nd>0 and dx*e2>0 then dx=-1*dx 'direccion equivocada
if dx>x2 then dx=x2-0.01 'evitar valores negativos
x1=x2:e1=e2:x2=x2-dx 'nuevos valores de tanteo
wend
'if pepe=1 then [fin2]
c.s=nu/Nd 'coeficiente de seguridad
'if c.s<0.97 then Md=int(mu):#t "Momento flector excesivo. Md maximo = ";t2$(mu)
'if c.s<0.97 then Nd=Nd-0.5 :goto [nuevoC]
'if c.s>1.001 then Nd=Nd+0.5 :goto [nuevoC]
#t "Para un mom flector = ";t2$(Md);" mT ";"el Axil max = ";t2$(nu);" T "
#t "Coeficente de seguridad de axiles nu/Nd = ";d4$(nu/Nd)
#t "Coeficente de seguridad de momentos mu/Md = ";d4$(mu/Md)
#t "---------------------------------------------------"
[fin2]
if pepe=0 then Nd=Nd.1: pepe=1
c.s=nu/Nd
Mdmin=EXmin*Nd
if Md<Mdmin then
Md=Mdmin
#t "Momento flector escaso Md minimo = ";t2$(Md)
Nd=int(nu)
#t "Axil maximo = ";t2$(Nd)
'goto [nuevoC]
end if
'if c.s<1 then Md=Md-0.1: goto[nuevoC]
'if c.s>1.01 then Md=Md+0.1: goto[nuevoC]
[fin3]
#t "Para un axil = ";t2$(Nd);" T ";"el Mom flector max = ";t2$(mu);" mT "
#t "Coeficente de seguridad de momentos mu/Md = ";d4$(mu/Md)
#t "Coeficente de seguridad de axiles nu/Nd = ";d4$(nu/Nd)
[fin4]
xd=x1
goto [res.cal]
'------------------------------------------------
[1710a]
gosub [comun.compuesta]
nu=Nc+Ns*aBAR:mu=Mc+Ms*aBAR
if KEX=0 then eu=mu/nu else eu=nu/mu
erro=eu-EX
return
'nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
'nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
[esviada]
linea$="_____________________________________________________________________"
#t "Soportes rectangulares de hormigon armado a flexo-compresion esviada"
Mxd=Md
COdA=nC
U =0
Ut =0
Mxs=0
Mys=0
xi =0
errN=0
errM=0
#t "Calculo con diagrama de parabola-rectangulo"
#t " DATOS"
#t linea$
#t " Dimensiones recubr.(cm) Momento Carga Cod_armado Diam"
#t " ";d0$(b*100);" ";d0$(h*100);" ";d2$(rec*100);" ";d2$(Mxd);"
";_
d2$(Myd);" ";d2$(Nd);" ";d0$(COdA);" ";d0$(diam)
#t linea$
#t " CALCULO"
hx=b :hy=h
cx=rec/hx :#t "recubrimientos reducido en x ";d2$(cx)
cy=rec/hy :#t "recubrimientos reducido en y ";d2$(cy)
facN =0.85*fcd*hx*hy :#t "Axil maximo del hormigon ";t0$(facN);" T"
facMy=facN*hx
facMx=facN*hy
'codigo de armado
nBf=int(COdA/10) :nx=nBf :#t "Numero de barras frontales ";d0$(nBf)
nBl=COdA-10*nBf :ny=nBl :#t "Numero de barras laterales ";d0$(nBl)
nBAR=2*(nBf+nBl)-4 :#t "Numero total de barras ";d0$(nBAR)
n(1)=nBf 'barras de esquina
n(2)=nBf+nBl-1
n(3)=n(2)+nBf-1
n(4)=nBAR
EXmin=hx/20 : if EXmin<0.02 then EXmin=0.02
EYmin=hy/20 : if EYmin<0.02 then EYmin=0.02
#t "Excentricidad minima EXmin = ";d0$(EXmin*100);" cm"
#t "Excentricidad minima EYmin = ";d0$(EYmin*100);" cm"
sx=(1-2*cx)/(nBf-1) : x=0.5-cx : dx=-1*sx
sy=(1-2*cy)/(nBl-1) : y=0.5-cy : dy=0
rag=180/pi
if Mxd<0 then Mxd=-1*Mxd
if Myd<0 then Myd=-1*Myd
if Nd <1 then Nd=1 'axil minimo
EX=Myd/Nd : EY=Mxd/Nd
if dC>0 then [esviada.comprobacion]
'------------------------------------
uMIN=40*hx*hy*fyd/nBAR 'capacidad mecanica min de 1 barra
'Solicitaciones
fi=90
if EX>=EXmin or EY>=EYmin then [1610]
#t "hx hy ";hx;" ";hy
if hx>=hy then [1590]
EX=EXmin : Myd=EX*Nd
' EY=0 : Mxd=0 : goto [1620]
EY=EYmin : Mxd=EY*Nd : goto [1620]
[1590] EY=EYmin : Mxd=EY*Nd
' EX=0 : Myd=0
EX=EXmin : Myd=EX*Nd
[1610] if EX<>0 then fi=rag*atn((EY/EX)*(hx/hy))
[1620] bet=fi
xi=0.7
#t "Excentricidad calculada EX = ";d2$(EX*100);" cm"
#t "Excentricidad calculada EY = ";d2$(EY*100);" cm"
#t "Momento de calculo Mxd = ";d2$(Mxd);" mT"
#t "Momento de calculo Myd = ";d2$(Myd);" mT"
gosub [1880]
'***********
while abs(errN)>0.0001 or abs(errM)>0.001 'nuevo i
xi1=xi : e5=errN : xi=xi1+0.01
while abs(errN)>0.0001
gosub [1880]
'***********
dxi=((xi1-xi)/(e5-errN))*errN
if abs(dxi)>0.2 then dxi=0.2*sgn(dxi)
if dxi*errN>0 then dxi=-1*dxi
xi1=xi : e5=errN : xi=xi-dxi
if xi>2 then xi=2
if xi<0 then xi=0.01
wend
bet1=bet : e6=errM : bet=bet1+1
while abs(errM)>0.001
gosub [1880]
'***********
dbet=(bet1-bet)/(e6-errM)*errM
if abs(dbet)>36 then dbet=36*sgn(dbet)
bet1=bet : e6=errM : bet=bet-dbet
if bet>90 then bet=90
if bet<0 then bet=0
wend
wend
#t "Angulo de la fibra neutra bet = ";d2$(bet1);" º"
#t "area de cada barra = ";d2$(aBAR);" cm2"
uBAR=aBAR*fyd : if uBAR<uMIN then uBAR=uMIN 'capacidad mecanica de una
barra
FI=20*sqr(uBAR/pi/fyd)
#t "diametros de las barras = ";d2$(FI);" mm"
#t "Capacidad mecanica 1 barra = ";d2$(uBAR);" T"
#t "Capacidad mecanica total = ";d2$(nBAR*uBAR);" T"
#t "Canto util oblicuo = ";d2$(D)
if bet1>90 then bet1=bet1-90
be=bet1*pi/180 'angulo de la linea neutra en radianes
D1=(h+(b)*tan(be))*cos(be)
Uo=x1*D1
#t "profundidad oblicua = ";d2$(Uo);" m"
h1=Uo/cos(be)
h2=b*tan(be)
h3=h-h1+h2
if h3<=h then xA=0:yA=h3 else xA=b-Uo/sin(be) :yA=h
if h1<=h then xB=b:yB=h-h1 else xB=(h2-(h1-h))/tan(be):yB=0
#t "Coordenadas xA yA ";d2$(xA);" ";d2$(yA)
#t "Coordenadas xB yB ";d2$(xB);" ";d2$(yB)
diam=FI
goto [res.cal]
'--------------------------------------------------------------
'oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
[comun]
if bet<=45 then T=tan(bet/rag) else T=tan((90-bet)/rag)
T1=1/(1+T) : T2=1-T1
C=1/sqr(1+T*T) : S=T*C 'coseno y seno
D=((1-cx)*C+(1-cy)*S)/(C+S) 'canto util oblicuo
if xi>0 then [1950a]
epsc=100*xi :epss=-100 :goto [2030a]
[1950a] if xi>0.2593*D then [1980a]
epsc=100*xi/(D-xi) :epss=-100 :goto [2030a]
[1980a] if xi>1 then [2010a]
epsc=35 :epss=35*(xi-D)/xi:goto [2030a]
[2010a] epsc=50-15*xi:eps=35*(1-D):epss=eps+(xi-1)*(20-eps)
[2030a] deps=(epsc-epss)/D/(C+S)
Nc=0 : Mxc=0 : Myc=0 'resultante hormigon
if xi<T2 then x1=xi else x1=T2
gosub [triangulo]
'****************
if xi<=T2 then [2130a]
if xi< T1 then x1=xi else x1=T1
gosub [paralelogramo]
'********************
if xi<=T1 then [2130a]
if xi< 1 then x1=xi else x1=1
gosub [trapecio]
'***************
[2130a]
if bet<=45 then [2160a]
m3=Myc : Myc=Mxc : Mxc=m3
T=S : S=C : C=T
[2160a] Nc=Nc*facN : Mxc=Mxc*facMx : Myc=Myc*facMy
Ns=0 : Mxs=0 : Mys=0
U=cx*C+cy*S : du=C*sx
for i=1 to nBAR
eps=epsc-U*deps
sig=0.21*eps
if sig<-1*fyd then sig=-1*fyd
if sig> fyd then sig= fyd
Ns=Ns+sig
Mxs=Mxs+sig*y
Mys=Mys+sig*x
if i=n(1) then dx=0 : dy=-1*sy : du= S*sy 'esquinas
if i=n(2) then dx=sx : dy=0 : du=-1*C*sx
if i=n(3) then dx=0 : dy= sy : du=-1*S*sy
x=x+dx : y=y+dy : U=U+du
next
dx=-1*sx :dy=0
return
'****************************************************************
[1880]
'*****
gosub [comun]
'************
Mxs=Mxs*hy : Mys=Mys*hx
if abs(Ns)<=0.1 then [2370]
aBAR=(Nd-Nc)/Ns : goto [2400]
[2370] if abs(Mxs)<=0.1 then [2390]
aBAR=(Mxd-Mxc)/Mxs : goto [2400]
[2390] aBAR=(Myd-Myc)/Mys
[2400] Nr=Nd-Nc : Mxr=Mxd-Mxc : Myr=Myd-Myc
if abs(Myd)>abs(Mxd) then [2460]
errN=(Nr-Mxr*Ns/Mxs)/Nd
errM=(Mxr*Mys/Mxs-Myr)/Mxd
goto [2480]
[2460] errN=(Nr-Myr*Ns/Mys)/Nd
errM=(Mxr-Myr*Mxs/Mys)/Myd
[2480] return
'.......................
[triangulo]
'**********
if T2=0 then return
ht=S*x1/T2 'altura total del triangulo
for i=1 to 7
U=ch(i)*ht 'profundidad de la franja
eps=epsc-U*deps 'deformacion del hormigon
sig=1 'tension relativa
if eps<20 then aux=1-eps/20 : sig=1-aux*aux
sig=sig*ch(i) 'axil franja
Nc=Nc+sig : Mxc=Mxc+sig*(1-U/S) : Myc=Myc+sig*(1-U/C)
next i
fac=ht*ht/S/C/14
Nc=2*Nc*fac : Mxc=Mxc*fac : Myc=Myc*fac
return
'.....................................
[paralelogramo] '
'************** '
if T2=0 then ht=x1 else ht=S*(x1/T2-1) '
Np=0 : My=0 : x0=(1-T)/2 '
for i=1 to 7 '
U=S+ch(i)*ht '
eps=epsc-U*deps :sig=1 '
if eps<20 then aux=1-eps/20 :sig=1-aux*aux '
Np=Np+sig : My=My+sig*(x0-(U-S)/C) '
next i '
fac=ht/C/7 '
Nc=Nc+Np*fac : Myc=Myc +My*fac '
return '
'..........................
[trapecio]
'*********
if T2=0 then return
ht=(C+S)*x1-C
Np=0 : Mx=0 : My=0
for i=1 to 7
U=C+ch(i)*ht
eps=epsc-U*deps : sig=1
if eps<20 then aux=1-eps/20 : sig=1-aux*aux
sig=sig*(S-ch(i)*ht)
Np=Np+sig : Mx=Mx+sig*(C-U)/S : My=My+sig*(S-U)/C
next i
fac=ht/S/C/14
Nc =Nc+Np*2*fac : Mxc=Mxc+Mx*fac : Myc=Myc+My*fac
return
'.........................
'SSSSSSSSSSSSSSSSSSSSSSSSS
[esviada.comprobacion]
diam=dC
#t "Comprobacion de seccion a flexion compuesta esviada"
aMIN=40*hx*hy/nBAR
aBAR=pi*diam*diam/400
if aBAR<aMIN then #t "no cumple cuantia minima"
if EX>= EXmin or EY>=EYmin then [1620a]
if hx>= hy then [1590a]
EX=EXmin : Myd=EX*Nd
EY=0 : Mxd=0 : goto [1620a]
[1590a] EY=EYmin : Mxd=EY*Nd
EX=0 : Myd=0
[1620a] fi=90
if EX<>0 then fi=rag*atn((EY/EX)*(hx/hy))
#t "Excentricidad calculada EX = ";d0$(EX*100);" cm"
#t "Excentricidad calculada EY = ";d0$(EY*100);" cm"
RO=sqr(EX*EX+EY*EY) 'distancia origen. excentricidad total
if RO>sqr(hx*hx+hy*hy)/2 then RO=1/RO :KEX=1 else KEX=0
bet=fi : xi=0.5
gosub [1880a]
'************
while abs(errRO)>0.001*RO or abs(errAN)>0.1
xi1=xi : e5=errRO : xi=xi1+0.1 'nuevo valor de xi
while abs(errRO)>0.001*RO
gosub [1880a]
'************
dxi=((xi1-xi)/(e5-errRO))*errRO
if abs(dxi)>0.1 then dxi=0.1*sgn(dxi)
if dxi*errRO>0 then dxi=-1*dxi
xi1=xi : e5=errRO : xi=xi-dxi
if xi>2 then xi=2
if xi<0 then xi=0.01
wend
bet1=bet : e6=errAN : bet=bet1+9
while abs(errAN)>0.1
gosub [1880a]
'************
dbet=(bet1-bet)/(e6-errAN)*errAN
if abs(dbet)>9 then dbet=9*sgn(dbet)
bet1=bet : e6=errAN : bet=bet-dbet
if bet>90 then bet=90
if bet<0 then bet=0
wend
wend
#t "Axil ultimo Nu = ";d2$(Nu);" T"
#t "Momento x ultimo Mxu = ";d2$(Mxu);" mT"
#t "Momento y ultimo Myu = ";d2$(Myu);" mT"
if bet1>90 then bet1=bet1-90
be=bet1*pi/180 'angulo de la linea neutra en radianes
D1=(h+(b)*tan(be))*cos(be)
Uo=x1*D1
#t "profundidad oblicua = ";d2$(Uo);" m"
h1=Uo/cos(be)
h2=b*tan(be)
h3=h-h1+h2
if h3<=h then xA=0:yA=h3 else xA=b-Uo/sin(be) :yA=h
if h1<=h then xB=b:yB=h-h1 else xB=(h2-(h1-h))/tan(be):yB=0
#t "Coordenadas xA yA ";d2$(xA);" ";d2$(yA)
#t "Coordenadas xB yB ";d2$(xB);" ";d2$(yB)
diam=dC
c.s=Nu/Nd 'coeficiente de seguridad
#t "Coeficiente de seguridad ";d2$(c.s)
if c.s<0.97 then Md=int(mu):#t "Falta armadura "
' Momento flector excesivo. Mxu maximo = ";t2$(Mxu)
goto [res.cal]
'-------------------------------------------------------------------
'*******************************************************************
[1880a]
'******
gosub [comun]
Ns=Ns*aBAR : Mxs=Mxs*aBAR*hy : Mys=Mys*aBAR*hx 'paso del reducido al real
Nu=Nc+Ns : Mxu=Mxc+Mxs : Myu=Myc+Mys 'esfuerzos ultimos
Exu=Myu/Nu : Eyu=Mxu/Nu 'excentricidades resultantes
ROU=sqr(Exu*Exu+Eyu*Eyu)
if KEX=1 then ROU=1/ROU
errRO=ROU-RO 'error radial
if abs(Exu)>=0.0001 then [2470a]
errAN=90-fi 'error angular
goto [2480a]
[2470a] errAN=rag*atn(Eyu/Exu*hx/hy)-fi
[2480a] return
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
'------------------------------------------------------------------------
'---------------------POLIGONAL-----POLIGONAL----------------------------
[poligonal]
q$="Soportes poligonales de hormigon armado a flexo-compresion esviada"
linea$="_______________________________________________________________________"
nBAR=0
diam=0
bw=0
COdA$=str$(nC)
ndv=len(COdA$)
Mxd=Md
for n=1 to ndv: x(n)=x(n)/100:y(n)=y(n)/100:next
x(ndv+1)=x(1):y(ndv+1)=y(1) 'cierre poligonal
'.......................
'resistencias de calculo
fcd=fcd*8.5 : fyd=fyd/1000
#t q$
#t " DATOS"
#t " Hormigon Acero"
#t "Resistencia de calculo (kg/cm2) ";q2$(fcd/8.5);" ";q2$(fyd*1000)
#t linea$
#t " rec.(cm) x.Momentos.y Carga Cod_armado diam"
#t " ";d2$(rec);" ";d2$(Mxd);" ";d2$(Myd);" ";t2$(Nd);" ";COdA$;"
";d0$(diam)
#t linea$
#t " CALCULO"
betMIN=-90 : betMAX=270
xMIN=1000 : yMIN=1000 :xMAX=-1000 :yMAX=-1000 :aH=0
for n=1 to ndv
aH=aH+(y(n+1)+y(n))*(x(n+1)-x(n))/2 'area de hormigon
if x(n)<xMIN then xMIN=x(n)
if x(n)>xMAX then xMAX=x(n)
if y(n)<yMIN then yMIN=y(n)
if y(n)>yMAX then yMAX=y(n)
next
hx=xMAX-xMIN: exMIN=hx/20 :if exMIN<0.02 then exMIN=0.02 'excentricidad minima
hy=yMAX-yMIN: eyMIN=hy/20 :if eyMIN<0.02 then eyMIN=0.02
rec=rec/100
#t "Area de hormigon = ";d2$(aH);" m2"
#t "Recubrimiento mecanico = ";d2$(rec)
#t "Codigo de armado por caras = ";
for n=1 to ndv : N(n)=val(mid$(COdA$,n,1)):#t N(n);" ";:next 'barras por cara
#t ""
#t " Coordenadas"
#t "Vertices barras de esquina"
for n=1 to ndv
nBAR=nBAR+N(n)
sA2(n)=0:eR=0:gosub [paralela]
xs(n)=xx : ys(n)=yy 'coordenada barra de esquina en vertice n
next
xs(ndv+1)=xs(1): ys(ndv+1)=ys(1) 'cierre poligonal
nBAR=nBAR-ndv 'numero de barras
a=-1*fcd/400: b=fcd/10
rag=180/pi
DbetMAX=(betMAX-betMIN)/10
uMIN =40*fyd*aH/nBAR 'capacidad mecanica minima de la barra
#t "Diferencia angular maxima DbetMAX = ";DbetMAX
#t "Numero de barras = ";d0$(nBAR)
#t "Capacidad mecanica minima de la barra = ";d2$(uMIN)
if Nd<1 then Nd=1
ex=Myd/Nd: ey=Mxd/Nd
fi=90 : if ey<0 then fi=-1*fi
if abs(ex)>= exMIN or abs(ey)>=eyMIN then [1820]
if hx>=hy then [1800]
ex=exMIN*sgn(ex): if ex=0 then ex=exMIN
Myd=ex*Nd : Mxd=0: ey=0: goto [1820]
[1800] ey=eyMIN*sgn(ey): if ey=0 then ey=eyMIN
Mxd=ey*Nd : Myd=0: ex=0
[1820] if ex=0 then [1850p]
fi=rag*atn((ey/ex)*(hx/hy))
if ex<0 then fi=fi+180
'-------------------------------------------------------------
[1850p] beta=fi : xi=0.7: gosub [2100]
'***********
#t d4$(xi);" ";d4$(beta);" ";d4$(en);" ";d4$(em)
'#t "Excentricidad minima exMIN y calculada ex = ";d0$(exMIN*100);"
";d2$(ex*100);" cm"
'#t "Excentricidad minima eyMIN y calculada ey = ";d0$(eyMIN*100);"
";d2$(ey*100);" cm"
while abs(en)>0.0001 or abs(em)>0.0001
xi1=xi : en1=en : xi=xi1+0.01
while abs(en)>0.0001
gosub [2100]
'***********
'#t d4$(xi);" ";d4$(beta);" ";d4$(en);" ";d4$(em)
dxi=((xi1-xi)/(en1-en))*en
if abs(dxi)>0.2 then dxi=0.2*sgn(dxi)
if dxi*en>0 then dxi=-1*dxi
xi1=xi : en1=en : xi=xi-dxi
if xi>2 then xi=2
if xi<0 then xi=0.01
wend
'#t ""
beta1=beta : em1=em : beta=beta1+1
while abs(em)>0.0001
gosub [2100]
'***********
dbeta=((beta1-beta)/(em1-em))*em
if abs(dbeta)>DbetMAX then dbeta=DbetMAX*sgn(dbeta)
beta1=beta : em1=em: beta=beta-dbeta
#t d4$(xi);" ";d4$(beta);" ";d4$(en);" ";d4$(em)
if beta>betMAX then beta=betMAX
if beta<betMIN then beta=betMIN
wend
#t ""
wend
#t "Tensiones de trabajo fcd fyd = ";fcd;" ";fyd
#t "Area de una barra aBAR = ";d2$(aBAR)
U=aBAR*fyd
#t "Capacidad mecanica necesaria U = ";d2$(U)
if U<uMIN then U=uMIN
diam=20*sqr(U/fyd/pi)
#t "U diam (mm) = ";d2$(U);" ";d2$(20*sqr(U/fyd/pi))
b=xMAX-xMIN
h=yMAX-yMIN
R=0.015
e=0.008 'diametro del estribo
r=diam/2000
for n=1 to ndv
dis=sqr((x(n)-xs(n))^2+(y(n)-ys(n))^2) ' distancia vertice poli.-centro barr
sA2(n)=rec/dis
next n
'.................................................................
for n=1 to ndv :eR=R :gosub [paralela]
xs.e(n)=xx: ys.e(n) =yy : next 'vertices poligono int. estribos
xs.e(ndv+1) =xs.e(1) :ys.e(ndv+1)=ys.e(1) 'cierre poligonal
for n=1 to ndv :eR=R+e :gosub [paralela]
xs.a(n)=xx: ys.a(n) =yy : next 'vertices poli exterior estribos
xs.a(ndv+1) =xs.a(1) :ys.a(ndv+1)=ys.a(1) 'cierre poligonal
for n=1 to ndv :eR=0 :gosub [paralela]
xs.e1(n)=xx: ys.e1(n)=yy: next 'centros de mandriles de estribos
xs.e1(ndv+1)=xs.e1(1):ys.e1(ndv+1)=ys.e1(1) 'cierre poligonal
'.................................................................
for n=1 to ndv
h1=sqr((xs.e1(n)-xs.e(n))^2+(ys.e1(n)-ys.e(n))^2) 'dist cent.curva-vertice
estr.int
s1(n)=sqr(h1^2-R^2)
' d1(n)=2*R*s1(n)/h1
' alfa(n)=2*asn(d1(n)*0.5/R)*rag 'angulo de curva en el
mandril
alfa(n)=2*acs(R/h1)*rag
pp=n+1:if pp>ndv then pp=1
lado.e(n)=sqr((xs.e(pp)-xs.e(n))^2+(ys.e(pp)-ys.e(n))^2) 'lados poli.
int.estribos
next n
for n=1 to ndv
np=n+1:if np>ndv then np=1 'numero de vertice posterior a n
na=n-1:if na<1 then na=ndv 'numero de vertice anterior a n
x.man.a(n)=(xs.e(n )-xs.e(na))*s1(n)/lado.e(na)
y.man.a(n)=(ys.e(n) -ys.e(na))*s1(n)/lado.e(na)
x.man.p(n)=(xs.e(np)-xs.e(n)) *s1(n)/lado.e(n)
y.man.p(n)=(ys.e(np)-ys.e(n)) *s1(n)/lado.e(n)
gamma(n)=r.g*atn((y(n)-ys.e1(n))/(x(n)-xs.e1(n)))
next n
goto [res.cal]
'...................................................................
'-------------------------------------------------------------------
[paralela]
recu=rec+(R-r)*sA2(n)-eR
if n=1 then no=ndv : ne=1 else no=n-1:ne=n
gosub [3190]
'***********
dya=dy :dxa=dx: dza=dz
no=n :ne=n+1
gosub [3190]
'***********
dd=dy*dxa-dya*dx
xx=(dz*dxa-dza*dx)/dd 'coordenada vertice n poligono (sin curva)
yy=(dy*dza-dya*dz)/dd
return
'.........................................
[3190] 'coordenadas de puntos en la bisectriz de esquina
dy=y(ne)-y(no) : dx=x(no)-x(ne)
dz=dy*x(no)+dx*y(no) + recu*sqr(dx*dx+dy*dy)
return
'------------------------------------------------------------------
[2100]
xMIN=1000 :xsMIN=1000 : xMAX=-1000
S=sin(beta/rag) : C=cos(beta/rag)
if abs(C)<0.0001 then C=0 : S=sgn(S)
for n=1 to ndv+1 'coordenadas en ejes girados
xp(n)= x(n)*C+y(n)*S
yp(n)=-1*x(n)*S+y(n)*C
if xp(n)<xMIN then xMIN=xp(n) 'xMIN =vertice menos comprimido
if xp(n)>xMAX then xMAX=xp(n) 'xMAX = mas
next n
for n=1 to ndv 'abcisa girada de la barra
xsp(n)=xs(n)*C+ys(n)*S
if xsp(n)<xsMIN then xsMIN=xsp(n) 'xsMIN=barra menos comprimida
next n
xsp(ndv+1)=xsp(1)
d=(xMAX-xsMIN)/(xMAX-xMIN) 'canto util relativo oblicuo
if xi>0 then [2290]
epsc= 100*xi 'dominio 1
epss=-100 : goto [2380]
[2290] if xi>0.2593*d then [2320]
epsc= 100*xi/(d-xi) 'dominio 2
epss=-100 : goto [2380]
[2320] if xi>1 then [2350]
epsc=35 'dominios 3 y 4
epss=35*(xi-d)/xi : goto [2380]
[2350] epsc=50-15*xi 'dominio 5
eps=35*(1-d)
epss=eps+(xi-1)*(20-eps)
[2380]
Nc=0 : Mxc=0 : Myc=0 'resultante del hormigon
Ns=0 : Mxs=0 : Mys=0 ' de las armaduras
ae=(epsc-epss)/(xMAX-xsMIN)
be=epsc-ae*xMAX
x0=-1*be/ae : x20=(20-be)/ae 'abcisas para eps=0 y 20
for n=1 to ndv
x1=xp(n) : x2=xp(n+1) : signo=1 : yo=yp(n)
if x1=x2 then [2610]
if x1<x2 then [2490]
x1=xp(n+1) : x2=xp(n) : signo=-1: yo=yp(n+1)
[2490] if x2<=x0 then [2610]
ay=signo*(yp(n+1)-yp(n))/(x2-x1)
by=yo-ay*x1
if x1<=x0 then x1=x0
if x2>x20 then [2560]
xp1=x1 : xp2=x2 : n5=1 : gosub [trapeciop]
goto [2610]
[2560] if x1>=x20 then [2600]
xp1=x1 : xp2=x20: n5=1 : gosub [trapeciop]
xp1=x20: xp2=x2 : n5=0 : gosub [trapeciop]
goto [2610]
[2600] xp1=x1 : xp2=x2 : n5=0 : gosub [trapeciop]
[2610] next n
exc=Myc/Nc : eyc=Mxc/Nc 'excentricidades giradas
Mxc=Nc*(exc*S+eyc*C) 'esfuerzos a ejes generales
Myc=Nc*(exc*C-eyc*S)
for n=1 to ndv
x=xs(n): y=ys(n) : xp=xsp(n) : N=N(n)-1
dx=0 : dy=0 : dxp=0
if N=1 then [2710]
dx=(xs(n+1)-x)/N
dy=(ys(n+1)-y)/N : dxp=(xsp(n+1)-xp)/N
[2710] for j=1 to N
eps=ae*xp+be : sig=0.21*eps
if sig<-1*fyd then sig=-1*fyd
if sig>fyd then sig=fyd
Ns=Ns+sig : Mxs=Mxs+sig*y : Mys=Mys+sig*x
x=x+dx : y=y+dy : xp=xp+dxp
next j
next n
if abs(Ns)<=0.1 then [2810]
aBAR=(Nd-Nc)/Ns : goto [2840]
[2810] if abs(Mxs)<=0.1 then [2830]
aBAR=(Mxd-Mxc)/Mxs : goto [2840]
[2830] aBAR=(Myd-Myc)/Mys
[2840] Nf=Nd-Nc : Mxf=Mxd-Mxc 'diferencia para aceros
Myf=Myd-Myc
if abs(Myd)>=abs(Mxd) then [2900]
en=(Nf -Mxf*Ns /Mxs)/Nd 'error de axil
em=(Mxf*Mys/Mxs-Myf)/Mxd 'error de momentos
goto [2920]
[2900] en=(Nf - Myf*Ns /Mys)/Nd
em=(Mxf- Myf*Mxs/Mys)/Myd
[2920] if abs(abs(em)-pi)<0.001 then em=0
return
'-------------------------------------------------------------------------------
[trapeciop]
'*********
z1=xp1 : z2=xp2
for j=1 to 5
del(j)=(z2-z1)/j
z1=z1*xp1 : z2=z2*xp2
next j
if n5<>0 then [3030]
csig=fcd
asig=0
bsig=0
goto [3060]
[3030] asig= a*ae*ae
bsig=2*a*ae*be+b*ae
csig= a*be*be+b*be
[3060] f4=asig*ay
f3=bsig*ay+asig*by
f2=csig*ay+bsig*by
f1= csig*by
g5=f4*ay
g4=f3*ay+asig*ay*by
g3=f2*ay+bsig*ay*by+asig*by*by
g2=f1*ay+csig*ay*by+bsig*by*by
g1= csig*by*by
Nc =Nc +signo*(f4*del(4)+f3*del(3)+f2*del(2)+f1*del(1))
Mxc=Mxc+signo*(g5*del(5)+g4*del(4)+g3*del(3)+g2*del(2)+g1*del(1))/2
Myc=Myc+signo*(f4*del(5)+f3*del(4)+f2*del(3)+f1*del(2))
return
'oooooooooooooooooooooooooooooooooooooooooooooooooooo
'oooooooooooooooooooooooooooooooooooooooooooooooooooo
[unidades.salida]
#1.UsL , "!contents? CsL$" : if CsL$="" then CsL$="m" : #1.UsL CsL$
#1.UsF , "!contents? CsF$" : if CsF$="" then CsF$="T" : #1.UsF CsF$
#1.UsM , "!contents? CsM$" : if CsM$="" then CsM$="mT": #1.UsM CsM$
If upper$(CsL$)="M" then CsL=1 :lo$="m." '
If upper$(CsL$)="CM" then CsL=100 :lo$="cm" '
if upper$(CsL$)="PU" then CsL=39.37 :lo$="pu" '
If upper$(CsF$)="T" then CsF=1 :fu$="T" '
If upper$(CsF$)="KN" then CsF=10 :fu$="kN" '
if upper$(CsF$)="KL" then CsF=2.2046:fu$="kL" '
if upper$(CsM$)="MT" then CsM=1 :mo$="mT" '
if upper$(CsM$)="MKN" then CsM=10 :mo$="mkN" '
return '
'----------------------------------------------------
[unidades.entrada]
#1.UeL , "!contents? CeL$" : if CeL$="" then CeL$="cm": #1.UeL CeL$
#1.UeF , "!contents? CeF$" : if CeF$="" then CeF$="T" : #1.UeF CeF$
if upper$(UeL$)="M" then CeL=1 '
if upper$(UeL$)="CM" then CeL=0.01 '
if upper$(UeL$)="PU" then CeL=1/39.37 '
if upper$(UeF$)="T" then CeF=1 '
if upper$(UeF$)="KN" then CeF=0.1 '
if upper$(UeF$)="KL" then CeF=1/2.2046 '
if upper$(UeT$)="KG/CM2" then CeTh=10 :CeTa=0.001 '
if upper$(UeT$)="N/MM2" then CeTh=100:CeTa=0.01 '
if upper$(UeT$)="MPA" then CeTh=100:CeTa=0.01 '
'
return '
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
[res.cal] 'RESULTADOS GRAFICO DEL CALCULO
close #d
'+++++++++++++++++++++++++++++++++++++++++++++++++++
call openGraphWindow '
#g "down ; size 1 ; color darkpink" '
w.w=WindowWidth : w.h=WindowHeight-150 '
e.h=0.7*w.w/b : e.v=0.7*w.h/h '
if e.h<e.v then esca=e.h else esca=e.v '
esca.per=esca : dim pp(Nnu) '
gosub [planta.alzado] '
wait
'oooooooooooooooooooooooooooooooooooooooooooooooooooo
[des] '
if perspectiva=0 then dim segId(3*Nba) '
if planta=1 then gosub [planta.alzado] '
if fileName$="" then notice noti$:wait '
'
if dime=3 then '
d =1200/2 : d=d*ymax/xmax '
if d>600 then d=600 '
if d<500 then d=500 '
'
#1.r1,"!contents? r1": #1.r2,"!contents? r2": #1.r3,"!contents? r3"
#1.mx,"!contents? mx": #1.my,"!contents? my": #1.mz,"!contents? mz"
#1.kk,"!contents? kk" '
'
if r1=0 then r1=int(5.283*360/2/pi) : #1.r1 r1 '
if r2=0 then r2=int(6.083*360/2/pi) : #1.r2 r2 '
if r3=0 then r3=int(3.083*360/2/pi) : #1.r3 r3 '
if mx=0 then mx=0.5 : #1.mx mx '
if my=0 then my=0.5 : #1.my my '
if mz=0 then mz=-350 : #1.mz mz '
#1.kk kk '
r1=r1*g.r : r2=r2*g.r : r3=r3*g.r '
if perspectiva=1 then gosub [borrar.perspectiva] '
'
sr1=sin(r1): cr1=cos(r1) '
sr2=sin(r2): cr2=cos(r2) '
sr3=sin(r3): cr3=cos(r3) '
'
for n=1 to Nba '
x=x(n.i(n)):y=1*z(n.i(n)):z=y(n.i(n)) : gosub [310]:sxi=sx:syi=sy '
x=x(n.j(n)):y=1*z(n.j(n)):z=y(n.j(n)) : gosub [310]:sxj=sx:syj=sy '
#g "size 1 ; color red" '
#g "line ";w.w/2+esca.per*(sxi+mx);" ";h.p-esca.per*syi+300;" ";_ '
w.w/2+esca.per*(sxj+mx);" ";h.p-esca.per*syj+300;" "; '
' #t #g, "segment" '
input #g, segId(n) '
next n '
perspectiva=1 '
r1=r1*r.g : r2=r2*r.g : r3=r3*r.g '
'................................ '
#g "flush" '
#g "when rightButtonUp [cls]" '
#g "setfocus; down" '
#g "color black" '
#g "when leftButtonUp [setForLine]" '
'
[inputLoop] '
n=0 : m=0 '
segId=0 '
qqq=2 '
lineThickness$ = "1" '
lineColor$ = "black" '
end if '
wait '
'zzzzzzzzzzzzzzzzzzzzzzzzzzzzz
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
[planta.alzado] '
if fileName$="" or plot=0 then notice noti$:wait '
#1.esca, "!contents? escala" '
#1.tex5, "!contents? ttto" '
w.w=WindowWidth '
esca=esca+esca*escala/100 '
e2=esca/2/1000 '
if Nd>0 or Myd>0 then dM=diam: dT=diam: nT=nBf: dC=diam: nC=nBf: nT1=nT: nT2=0
rT=dT*e2 : rT2=dT2*e2 :rC=dC*e2: rM=dM*e2 :if Nd>0 or Myd>0 then rM=diam*e2
ba=bw:if bw=0 then hf=h :ba=b '
bb=esca*b : hh=esca*h '
rr=rec*esca '
incre=0.015*esca-rT:rr1=rr+incre '
hff=esca*hf: qq=hh-hff: bww=esca*ba: bwE=bww-2*rr '
bwE1=bww-2*rr1 '
ala1=(b-bw)/2 : ala=(bb-bww)/2 '
d.i=(w.w-bb)/2 : d.s=(w.h-hh)/2 '
w.h=25+25+hh '
di=d.i+rr: ds=w.h-rr: bE=bb-2*rr: hE=hh-2*rr '
di1=d.i+rr1 : bE1=bb-2*rr1 '
'---------------------------------------------------
#g "color blue ; size 1"
#g "backcolor blue"
'--------------------------
if len(COdA$)<3 then
ndv=8:x(1)=ala1:y(1)=0:x(2)=ala1:y(2)=h-hf:x(3)=0:y(3)=h-
hf:x(4)=0:y(4)=h:x(5)=b:y(5)=h
x(6)=b :y(6)=h-hf:x(7)=ala1+bw:y(7)=h-hf :x(8)=ala1+bw:y(8)=0
:x(9)=ala1:y(9)=0
end if
'..................................
if desplaza=0 and len(COdA$)>2 then
for n=1 to ndv+1
x(n) =x(n) +xMIN*sgn(xMIN)
xs(n) =xs(n) +xMIN*sgn(xMIN)
xs.e2(n)=xs.e(n)
xs.e(n) =xs.e(n) +xMIN*sgn(xMIN)
xs.a(n) =xs.a(n) +xMIN*sgn(xMIN)
xs.e1(n)=xs.e1(n)+xMIN*sgn(xMIN)
next
desplaza=1
end if
'..................
for n=1 to ndv
#g "line ";d.i+x(n)*esca;" ";w.h-y(n)*esca;" ";d.i+x(n+1)*esca;" ";w.h-
y(n+1)*esca
if len(COdA$)>2 then ' en caso de ser un poligono
if val (right$(dato$(2),1))>0 then
pp=n+1: pp2=n+2: if n=ndv then pp=1:pp2=2
aa=n-1 : if n=1 then aa=ndv
xm1=x.man.p(n) *esca
ym1=y.man.p(n) *esca
xm2=x.man.a(pp) *esca
ym2=y.man.a(pp) *esca
xm3=x.man.a(pp2)*esca
ym3=y.man.a(pp2)*esca
'.....................
cc=(R+e)/R
xx=xs.a(pp):yy=ys.a(pp)
xn=xs.a(n) :yn=ys.a(n) : gosub [linea]
'.....................
cc=1
xx=xs.e(pp):yy=ys.e(pp)
xn=xs.e(n) :yn=ys.e(n) : gosub [linea]
'.....................
end if
#g "backcolor white"
#g "place ";d.i+x(n)*esca+6;" ";w.h-y(n)*esca+6: #g "\";n
#g "backcolor blue"
#g "place ";d.i+xs(n)*esca;" ";w.h-ys(n)*esca:#g "circlefilled "; rC
if N(n)>2 then 'si hay mas de dos redodos en una cara
D.x=(xs(n+1)-xs(n))/(N(n)-1) : D.y=(ys(n+1)-ys(n))/(N(n)-1) 'distancia
for m=1 to N(n)-2
#g "place ";d.i+(xs(n)+m*D.x)*esca;" ";w.h-(ys(n)+m*D.y)*esca:#g
"circlefilled "; rC
next m
end if
end if
next
if right$(dato$(2),1)="L" then
for nn=1 to 6
n(0)=1 : n(1)=2 : n(2)=3 : n(3)=4 : n(4)=5 : n(5)=6 : n(6)=1 :n(7)=2:n(8)=3
'gamma(nn)=gamma(n(nn))
'alfa(nn)=alfa(n(nn))
pp=n(nn+1)
aa=n(nn-1)
pp2=n(nn+2)
n1=n(nn)
n=n(nn)
xm1=x.man.p(n1) *esca
ym1=y.man.p(n1) *esca
xm2=x.man.a(pp) *esca
ym2=y.man.a(pp) *esca
xm3=x.man.a(pp2)*esca
ym3=y.man.a(pp2)*esca
'.....................
cc=(R+e)/R
xx=xs.a(pp) :yy=ys.a(pp)
xn=xs.a(n1) :yn=ys.a(n1) : gosub [linea]
if nn=6 then
x5=xs.e1(5) : y5=ys.e1(5)
#g "goto ";d.i+((xs.e1(4)+x5)/2+r+e)*esca;" ";w.h-((ys.e1(4)+y5)/2-R) *esca
#g "line ";d.i+((x5+xs.e1(6))/2-R) *esca;" ";w.h-((y5+ys.e1(6))/2+r+e)*esca;" ";_
d.i+ (xs.e1(2)+(R)) *esca;" ";w.h- (ys.e1(2)+(R+e)) *esca
#g "line ";d.i+ (xs.e1(2)+(R+e)) *esca;" ";w.h- (ys.e1(2)+(R+e)) *esca;" ";_
d.i+xs.e(2)*esca+xm1*cc;" ";w.h-ys.e(2)*esca-ym1*cc
'd.i+ (xs.e1(2)+(R+rec)) *esca;" ";w.h- (ys.e1(2)+(R+e)) *esca
end if
'.....................
cc=1
xx=xs.e(pp) :yy=ys.e(pp)
xn=xs.e(n1) :yn=ys.e(n1) : gosub [linea]
if nn=6 then
x5=xs.e1(5) : y5=ys.e1(5)
#g "goto ";d.i+((xs.e1(4)+x5)/2+r)*esca;" ";w.h-((ys.e1(4)+y5)/2-R)*esca 'ver
#g "line ";d.i+((x5+xs.e1(6))/2-R)*esca;" ";w.h-((y5+ys.e1(6))/2+r)*esca;" ";_ 'h
d.i+ (xs.e1(2)+R) *esca;" ";w.h- (ys.e1(2)+R) *esca
#g "line ";d.i+ (xs.e1(2)+R+e) *esca;" ";w.h- (ys.e1(2)+R) *esca;" ";_
d.i+xs.e(2)*esca+xm1*cc;" ";w.h-ys.e(2)*esca-ym1*cc
'd.i+ sm1+(xs.e1(2)) *esca;" ";w.h- (ys.e1(2)+R) *esca
end if
'.....................
next
end if
if len(COdA$)>2 then [fuera]
#g "backcolor white"
#g "place ";d.i+ala+bww/4;" ";w.h+16 :#g "\";"b = ";d0$(ba*100)
#g "place ";d.i-60;" ";w.h-(hh-xd*esca-25) : #g "\";"h= ";d0$(h*100)
'......................................................................
#g "color red ; size 1" 'linea neutra
If Myd=0 then
if xd>hf then incre=ala else incre=0
#g "line ";d.i+incre;" ";w.h-(hh-xd*esca);" ";d.i+bb-incre;" ";w.h-(hh-
xd*esca)
for n=1 to bb step 5
if n<ala or n>ala+bww then altu=hff else altu=xd*esca
if xd<hf then altu=xd*esca
#g "line ";d.i+n ;" ";w.h-(hh-altu);" ";d.i+n;" ";w.h-hh :next
#g "place ";d.i-60;" ";w.h-(hh-xd*esca) : #g "\";d2$(xd);" ";"Ln"
end if
if Myd>0 then
#g "line ";d.i+xA*esca;" ";w.h-yA*esca;" ";d.i+xB*esca;" ";w.h-yB*esca
for n=xA to b step 0.01
h.neu=yB+(yA-yB)*(xB-n)/(xB-xA) :if h.neu<0 then h.neu=0
#g "line ";d.i+n*esca;" ";w.h-h.neu*esca;" ";d.i+n*esca;" ";w.h-hh
next n
#g "place ";d.i-60;" ";w.h-(hh-Uo*esca) : #g "\";d2$(Uo);" ";"Ln"
end if
#g "color blue ; size 1"
'-----------------------------------------------------------------------------
#g, "backcolor white"
#g "place ";di+bb;" ";ds :#g "\";d0$(nT1);"r";d0$(dT)
if nT2>0 then_
#g "place ";di+bb;" ";ds-(2*rT+Dmin*10*esca/1000):#g "\";d0$(nT2);"r";d0$(dT2)
if bw>0 then_
#g "place ";di+bb;" ";ds-hE+hff-rr :#g "\";d0$(4) ;"r";d0$(dM)
#g "place ";di+bb;" ";ds-hE :#g "\";d0$(nC) ;"r";d0$(dC)
for m=2 to nBl-1 'armadura de piel
dista=(m-1)*hE/(nBl-1)
#g "place ";di+bb;" ";ds-dista :#g "\";d0$(2) ;"r";d0$(dM)
next
#g "backcolor 0 127 200"
'......................................................
#g "size 1" 'dibujo del estribo
c=0.015*esca : e=0.006*esca: a=22.5*pi/180
jose=1:if bw>0 then jose=2
for estri=1 to jose
r=rT:ala1=ala:hh1=hh:if estri=2 then ala1=0 :hh1=hff
x1=di+ala1 : y1=50+rr+(c-r)
x2=x1+bE-2*ala1: y2=y1+hh1-2*(rr+(c-r))
for p=1 to 2
e1=e*(p-1):w=c+e1
#g "place ";x1-w;" ";y1
for v=1 to 4:x=w*cos(v*a):y=w*sin(v*a):#g "goto " ;x1-x;" ";y1-y:next'su iz
for v=0 to 4:x=w*sin(v*a):y=w*cos(v*a):#g "goto " ;x2+x;" ";y1-y:next'su de
for v=0 to 4:x=w*cos(v*a):y=w*sin(v*a):#g "goto " ;x2+x;" ";y2+y:next'in de
for v=0 to 4:x=w*sin(v*a):y=w*cos(v*a):#g "goto " ;x1-x;" ";y2+y:next'in iz
#g "goto " ;x1-w;" ";y1
next
next
x1=d.i+rr+ala ' : y1=50+rr+(c-r)
x2=x1+bb-2*rr-2*ala: y2=y1+hh-2*(rr+(c-r))
if bw=0 then
pp=(c-rC)/sqr(2)
for m=1 to nC 'armadura de compresion
dista =(m-1)*(bE+2*pp)/(nC-1)
pp1=c-rC-pp:if m<>1 and m<>nC then pp1=0
#g "place ";x1-pp+dista;" ";y1-(c-rC)+pp1:#g "circlefilled "; rC
next
end if
'.........................................................
pp=(c-rT)/sqr(2)
for m=1 to nT1 'armadura de traccion
dista =(m-1)*(bE-2*ala+2*pp)/(nT1-1)
pp1=c-rT-pp:if m<>1 and m<>nT1 then pp1=0
#g "place ";x1+dista-pp;" ";ds-pp1:#g "circlefilled "; rT
next
for m=1 to nT2
dista=(m-1)*(bE-2*ala+2*(rT-rT2)+2*(c-r))/(nT2-1) 'rT-rT2
#g "place ";x1-(c-r)-(rT-rT2)+dista;" ";ds-(rT+rT2+Dmin*esca/100):_
#g "circlefilled "; rT2
next
' .....................................................................
for m=2 to nBl-1 'armadura de piel
dista=(m-1)*hE/(nBl-1)
#g "place ";x1-(c-r)-(rT-rM) ;" ";ds-dista: #g "circlefilled "; rM
#g "place ";x1+(c-r)+bwE+(rT-rM);" ";ds-dista: #g "circlefilled "; rM : next
'*********************************************************************'
if bw>0 then 'armadura de compresion en secciones en T
#g "place ";x1-ala ;" ";w.h-qq-rr+(r-rM):#g "circlefilled ";rM 'barras bajo ala
#g "place ";x2+ala ;" ";w.h-qq-rr+(r-rM):#g "circlefilled ";rM
'.........................
#g "place ";x1-ala ;" ";y1-(c-rC) : #g "circlefilled "; rC 'barras superiores
#g "place ";x1 ;" ";y1-(c-rC) : #g "circlefilled "; rC
#g "place ";x2 ;" ";y1-(c-rC) : #g "circlefilled "; rC
#g "place ";x2+ala ;" ";y1-(c-rC) : #g "circlefilled "; rC
'.....................................................
end if
[fuera]
planta=0
#g "flush"
return
'..........................
[linea]
#g "line ";d.i+xn*esca+xm1*cc;" ";w.h-yn*esca-ym1*cc;" ";_ 'linea interna
d.i+xx*esca-xm2*cc;" ";w.h-yy*esca+ym2*cc
'' if y(pp)<y(n) and x(pp+1)>x(pp) then
' #g "goto ";d.i+xx*esca+xm3*cc;" ";w.h-yy*esca -ym3*cc
'' else
if right$(dato$(2),1)="L" and nn=6 then [water]
for m=1 to 4
a=gamma(pp)+(2-m)*alfa(pp)/4
signo=sgn(y(pp)-y(n)):if y(pp)-y(n)=0 then signo=sgn(x(n)-x(pp))
if right$(dato$(2),1)="L" and (nn=5 or nn=1) then signo=-1*signo
x2=(cc*R*cos(a*pi/180))*signo
y2=(cc*R*sin(a*pi/180))*signo
#g "goto ";d.i+xs.e1(n+1)*esca+x.man(pp)*cc*esca-x2*esca;" ";_
w.h-ys.e1(n+1)*esca-y.man(pp)*cc*esca+y2*esca
next m
''end if
[water]
return
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
[310] '
if dime=3 then '
x=-1*x: xa=cr1*x-sr1*z: za=sr1*x+cr1*z'
x=cr2*xa+sr2*y : ya=cr2*y-sr2*xa '
z=cr3*za-sr3*ya: y=sr3*za+cr3*ya '
x=x+mx : y=y+my: z=z+mz '
sx=d*x/z:sy=d*y/z '
end if '
return '
'------------------------------------------------------------
[guardar.bmp] '
for n=1 to 2 :#g,"when leftButtonDown [getCoords]" :next '
WindowHeight=abs(yyy(1)-yyy(2)) '
#g "getbmp cercha "; 1;" "; 1;" ";WindowWidth;" "; WindowHeight'
bmpsave "cercha", "cercha.bmp" '
wait '
'--------------------------------------------------------------
[getCoords] '
xxx(n) = esca*MouseX : yyy(n) = esca*MouseY '
#text MouseX;" ";MouseY '
wait '
'--------------------------------------------------------------
[borrar.perspectiva] '
for n=Nba to 1 step -1 :print #g, "delsegment "; segId(n):next '
#g "redraw" '
return '
'-----------------------------------------------------------------
'oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
[edText] 'Edita el texto '
prompt "TEXT>"; text$ : wait '
'+++++++ '
[adText] 'Situa texto en el dibujo '
call StopDraw '
#g "when leftButtonDown [add]" '
texto=0 : wait '
'---------------------------------------------
[add] '
dim pixel$(3000,8) '
#1.tex5, "!contents? ttto" '
texto=1 '
call SetDraw '
if lineColor$="" then lineColor$="black" '
color$=lineColor$ 'se toma el color del ultimo color de linea
alt$="white" 'se fija el color de fondo de texto blanco
size=ttto 'se toma el tamaño de texto desde #1.text5
#g "color "; color$; " ; backcolor "; alt$
#g "font ";font$;" ";str$(ttto) 'font arial 8 italic bold strikeout underscore
startX = MouseX : startY=MouseY '
'
#g "place ";MouseX; " "; MouseY '
#g "|"; text$ '
#g "flush" '
text=text+1 '
text$(text, 1)=str$(MouseX) '
text$(text, 2)=str$(MouseY) '
text$(text, 3)=color$ '
text$(text, 4)=alt$ '
text$(text, 5)="Arial" 'font$ '
text$(text, 6)=text$ '
texto=1 '
wait '
'..........................................................................
sub SetDraw 'detecta Mouse Input '
startX = MouseX : startY=MouseY '
#g, "when leftButtonDown [draw]" :#g, "when rightButtonDown [altDraw]" '
#g, "when leftButtonMove [draw]" :#g, "when rightButtonMove [altDraw]" '
end SUB '
'................
sub StopDraw 'ignora Mouse Input
#g, "when leftButtonDown" : #g, "when rightButtonDown"
#g, "when leftButtonMove" : #g, "when rightButtonMove"
end SUB
'--------------------------
[draw]
#1.tex5, "!contents? size"
pixel=pixel+1
color$="black"
pixel$(pixel, 1)=str$(size)
pixel$(pixel, 2)=color$
pixel$(pixel, 3)=str$(MouseX)
pixel$(pixel, 4)=str$(MouseY)
#g "size ";size; " ; color "; color$; " ; set ";MouseX; " ";MouseY
#g "flush"
modr=1
wait
'------------------------------
[altDraw]
#1.tex5, "!contents? size"
pixel=pixel+1
alt$="white"
pixel$(pixel, 1)=str$(size)
pixel$(pixel, 2)=alt$
pixel$(pixel, 3)=str$(MouseX)
pixel$(pixel, 4)=str$(MouseY)
#g "size "; size; " ; color "; alt$; " ; set "; MouseX; " "; MouseY
#g "flush"
modr=1
wait
'-------------------------------------------------------------------
'*******************************************************************
'-------------------------------------------------------------------
sub openGraphWindow '
if properties(0) = 0 then '
UpperLeftX=DisplayWidth/3 :WindowWidth =2*DisplayWidth/3 '
UpperLeftY=DisplayHeight*0.95*0.5:WindowHeight=DisplayHeight*0.95*0.5 '
g$="SysGraph\" '
menu #g, "&File" ,"&Nuevo" ,[nuevo] ,"&Save" ,[save], _ '
"&print" ,[printIt] ,|,"&Exit" ,[quit] '
menu #g, "&Objecto","&Linea" ,[setForLine],"&Elipse" ,[setForEllipse],_'
"&Box" ,[setForBox] ,"&Bitmap" ,[setForPan] '
menu #g, "&Colores","&Rojo" ,[colorRed] ,"&Amarillo",[colorYellow],_ '
"&Verde" ,[colorGreen],"&Azul" ,[colorBlue] '
menu #g, "&Lineas" ,"&Grueso",[lineThickness],"&Color",[lineColor] '
menu #g, "&Texto" ,"&Editar",[edText] ,"&Situar" ,[adText] '
'
bmpbutton #g, g$;"col_rojo.bmp", [colorRed] , UL, 0, 0 '
bmpbutton #g, g$;"col_amar.bmp", [colorYellow] , UL, 28, 0 '
bmpbutton #g, g$;"col_verd.bmp", [colorGreen] , UL, 56, 0 '
bmpbutton #g, g$;"col_azul.bmp", [colorBlue] , UL, 84, 0 '
bmpbutton #g, g$;"col_negr.bmp", [color.negro] , UL, 112, 0 '
bmpbutton #g, g$;"col_blan.bmp", [color.blanco] , UL, 140, 0 '
bmpbutton #g, g$;"panbttn.bmp" , [setForPan] , UL, 224, 0 '
bmpbutton #g, g$;"circbttn.bmp", [setForEllipse], UL, 252, 0 '
bmpbutton #g, g$;"sqrbttn.bmp" , [setForBox] , UL, 280, 0 '
bmpbutton #g, g$;"linebttn.bmp", [setForLine] , UL, 308, 0 '
dim tipo$(15) '
bmpbutton #g, g$;"pencil.bmp" , [lineThickness], UL, 336, 0 '
bmpbutton #g, g$;"grphbttn.bmp", [lineColor] , UL, 364, 0 '
'
open "Esquema seccion" for graphics as #g '
'**************************************** '
#g "trapclose [closeGraph]" '
#g "down" : properties(0) = 1 '
else '
WindowWidth=2*DisplayWidth/3 '
#g "cls" '
end if '
end sub '
'........ '
[closeGraph] '
call closeGraphWindow :wait '
'........ '
sub closeGraphWindow '
if properties(0) =1 then close #g : properties(0) =0 '
if properties(8) =1 then close #c : properties(8) =0 '
if properties(9) =1 then close #3d: properties(9) =0 '
if properties(11)=1 then close #3r: properties(11)=0 '
end sub '******* '
'------------------------------------------------------------
sub openTextWindow '
if properties(1)=1 then call closeTextWindow '
if properties(1) = 0 then 'solo abre si esta cerrada '
UpperLeftX=1.7*DisplayWidth/3: WindowWidth =1.3*DisplayWidth/3 '
UpperLeftY=1 : WindowHeight=DisplayHeight*0.95*0.5 '
open "Calculos de la Cercha 3D" for text as #t '
'********************************************* '
print #t, "!trapclose [closeText]"; '
properties(1) = 1 '
else '
#t "!cls"; '
end if '
end sub '
[closeText] '
call closeTextWindow '
wait '
sub closeTextWindow '
if properties(1)=1 then close #t: properties(1)=0 '
end sub '********** '
'-------------------------------------------------------
'-------------------------------------------------------
'[Mensaje] 'Mensaje de error
' #t #text, "ERROR EN "; er$
' #t #text, "ntip = ";ntip;" Nbt= ";Nbt;" "; "i= ";i;" ";"Nnu= ";Nnu;_
' " j= ";j;" Nnu= ";Nnu;" i= ";i;" j=";j;" j-i=";j-i;" Ndi= ";Ndi
' WHILE INKEY$ = "": WEND
' RETURN
'wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
function u0$(kk): u0$=using ("#",kk)
end function
function u1$(kk): u1$=using ("#.#",kk)
end function
function u2$(kk): u2$=using ("#.##",kk)
end function
function u4$(kk): u4$=using ("#.####",kk)
end function
function u6$(kk): u6$=using ("#.######",kk)
end function
'-----------
function d0$(kk): d0$=using ("##",kk)
end function
function d2$(kk): d2$=using ("##.##",kk)
end function
function d3$(kk): d3$=using ("##.###",kk)
end function
function d4$(kk): d4$=using ("##.####",kk)
end function
function d5$(kk): d5$=using ("##.#####",kk)
end function
function d6$(kk): d6$=using ("##.######",kk)
end function
function d8$(kk): d8$=using ("##.########",kk)
end function
'-----------
function t0$(kk): t0$=using ("###",kk)
end function
function t1$(kk): t1$=using ("###.#",kk)
end function
function t2$(kk): t2$=using ("###.##",kk)
end function
function t3$(kk): t3$=using ("###.## #",kk)
end function
'-----------
function q0$(kk): q0$=using ("####",kk)
end function
function q1$(kk): q1$=using ("####.#",kk)
end function
function q2$(kk): q2$=using ("####.##",kk)
end function
function q3$(kk): q3$=using ("####.###",kk)
end function
'-----------
function c0$(kk): c0$=using ("#####",kk)
end function
function c1$(kk): c1$=using ("#####.#",kk)
end function
function c2$(kk): c2$=using ("#####.##",kk)
end function
function c3$(kk): c3$=using ("#####.###",kk)
end function
function c6$(kk): c6$=using ("#####.######",kk)
end function
'-----------
function v0$(kk): v0$=using ("#######",kk)
end function
function v2$(kk): v2$=using ("#######.##",kk)
end function
function v3$(kk): v3$=using ("#######.###",kk)
end function
'-----------
function s1$(kk): s1$=using ("######.#",kk)
end function
'--------------------------------------------------
function eee$(ee) '
n1$ = using ("######################",ee) '
nn=val(left$ (n1$,4)) '
nn$=str$(nn/100) '
'if ee>0 then '
eee$= " "+nn$+"e"+str$(len(n1$)-2) '
'if ee<0 then eee$="-"+nn$+"e"+str$(len(n1$)-2) '
p=7-len(eee$) '
eee$=space$(p)+eee$ '
end function '
'---------------------------------------------------
function te$(byref aa$, byref b)
if len(aa$)>=b then
te$=left$(aa$,b)
else
vacios=b-len(aa$): te$=space$(vacios)+aa$
end if
end function
'.......................................
function sgn(byref a)
if a<0 then sgn=-1
if a>0 then sgn=1
if a=0 then sgn=1
end function
'---------------------------------------------------
[formato]
if n mod nb<>0 and n<xx then #port " , ";
if n mod nb =0 or n=xx then #port ""
return
'ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
[cerchas]
'********
If nombre$="" then Notice "Hay que crear una estructura primero" :wait
#1.L,"!contents? b": #1.H,"!contents? h": #1.p , "!contents? bw"
#1.t,"!contents? hf": #1.e,"!contents? fck" :#1.tipo, "!contents? tipo"
#1.nombre, "!contents? nombre$":#1.pe,"!contents? fyk":#1.UeF, "!contents? UeF$"
#1.UeL$, "!contents? UeL$": #1.re, "!contents? rec": #1.ch, "!contents? ch"
#1.ca, "!contents? ca": #1.cf, "!contents? cf"
open nombre$+".dat" for output as #cer
#cer nombre$;" Tipo=";tipo;
if tipo>100 and tipo<200 then goto [cerchas2D]
'---------------------------------------------------------------------
If tipo=201 then
end if
'oooooooooooooooo
if tipo=202 then
end if
'ooooooooooooooooo
If tipo=301 then
end if
'-----------------
if tipo=302 then
end if
close #cer
wait
'ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
[cerchas2D] '*
'******** '*
'******************************************************************
if tipo=101 or tipo=102 then 'rectangular y seccion T
#cer "nombre tipo UeF UeL Md b h bw hf rec nC dC nT dT"
#cer te$(nombre$,9);" ";te$(str$(tipo),4);" ";te$(UeF$,2);" ";te$(UeL$,2);" ";_
te$(str$(Md),7);" ";te$(str$(b),4);" ";te$(str$(h),4);" ";te$(str$(bw),4);" ";_
te$(str$(hf),4);" ";te$(str$(rec),4);_ '
" ";te$(str$(nC),2);" ";te$(str$(dC),2);" ";te$(str$(nT),2);" ";te$(str$(dT),2)
end if
'---------------------------------------------------------------
if tipo=103 then
end if
'--------------------
if tipo=104 then
end if
'-----------------
close #cer
wait
'000000000000000000000000000000000000000000000000000000000000000000
[startDraw]
if texto=0 then startX=MouseX: startY=MouseY: #g "place ";startX;" ";startY
wait
'..........
[firstLine]
if texto=0 then
#g "when leftButtonMove [trackLine]"
#g "line "; startX; " "; startY; " "; MouseX; " "; MouseY
end if
oMouseY = MouseY : oMouseX = MouseX
wait
'...........
[firstFrame]
if texto=0 then
#g "when leftButtonMove [trackBox]"
#g "box "; MouseX; " "; MouseY
end if
oMouseY=MouseY:oMouseX=MouseX
wait
'.........
[trackBox]
if texto=0 then
#g "rule XOR"
#g "box " ;oMouseX;" ";oMouseY
#g "place ";startX ;" ";startY
#g "box " ;MouseX ;" ";MouseY
end if
oMouseY=MouseY:oMouseX=MouseX
wait
'..........
[trackLine]
if texto=0 then
#g "rule XOR"
#g "line " ;startX;" ";startY;" ";oMouseX;" ";oMouseY
#g "place ";startX;" ";startY
#g "line " ;startX;" ";startY;" "; MouseX;" "; MouseY
end if
oMouseY=MouseY:oMouseX=MouseX
wait
'...........
[finishLine]
if texto=0 then
#g "when leftButtonMove [firstLine]"
#g "discard;rule OVER"
#g "line ";startX;" ";startY;" ";MouseX;" ";MouseY
#g "flush ; redraw"
gosub [pepe]
end if
wait
'***********************************************
[pepe] '
n=n+1 '
#g "segment" '
input #g, segId '
#g "flush ; redraw" '
'#g "\"; segId-1 -(n-1)*2;"-";segId;" ";qqq '
#g "\"; '
#g "flush ; redraw" '
m=0 '
return '
'-----------------------------------------'
[cls] '
m=m+1 '
#g "delsegment";" ";segId -(m-1)*3+1 'borra numeros
#g "delsegment";" ";segId -(m-1)*3-1 'borra lineas
#g "flush ; redraw" '
qqq=qqq+3 : n=n+1 : wait '
'-----------------------------------------'
[nuevo] '
m=0 :segId=0 :n=0: qqq=2: perspectiva=0 '
#g "cls" : wait '
'-----------------------------------------'
[finishBox] '
if texto=0 then '
#g "when leftButtonMove [firstFrame]" '
#g "discard;rule OVER" '
#g "boxfilled "; MouseX; " "; MouseY '
#g "flush ; redraw" '
gosub [pepe] '
end if '
wait '
'............................................................
[finishEllipse] '
if texto=0 then '
#g "when leftButtonMove [firstFrame]" '
#g "discard;rule OVER" '
#g "place " ; int((startX+MouseX)/2); " ";int((startY+MouseY)/2) '
#g "ellipsefilled "; abs(MouseX-startX) ; " ";abs(MouseY-startY) '
#g "flush ; redraw" '
gosub [pepe] '
end if '
wait '
'---------------------------------------------------
[setForLine] '
texto=0:#g "when leftButtonDown [startDraw]" '
#g "when leftButtonMove [firstLine]" '
#g "when leftButtonUp [finishLine]" '
wait '
'-------------------------------------------------
[setForBox] '
texto=0:#g "when leftButtonDown [startDraw]" '
#g "when leftButtonMove [firstFrame]" '
#g "when leftButtonUp [finishBox]" '
wait '
'-------------------------------------------------
[setForEllipse] '
texto=0:#g "when leftButtonDown [startDraw]" '
#g "when leftButtonMove [firstFrame]" '
#g "when leftButtonUp [finishEllipse]"'
wait '
'--------------------------------------------------------
[setForPan] '
texto=0:filedialog "Get *.bmp file", "bmp\*.bmp", panFile$ '
if panFile$ = "" then [inputLoop] '
loadbmp "panWithMe", panFile$ '
#g "when leftButtonDown [drawBmp]" '
#g "when leftButtonMove [MdrawBmp]" '
#g "when leftButtonUp [flushBmp]" '
wait '
'-------------------------------------------------
[drawBmp] '
#g "flush" '
#g "drawbmp panWithMe ";MouseX;" ";MouseY '
wait '
'---------------------- '
[MdrawBmp] '
#g "discard;rule OVER" '
#g "drawbmp panWithMe ";MouseX;" ";MouseY '
wait '
'---------------------------------------------
[flushBmp] #g "flush" :wait '
[colorRed] #g "backcolor red" :wait '
[colorYellow] #g "backcolor yellow" :wait '
[colorGreen] #g "backcolor green" :wait '
[colorBlue] #g "backcolor blue" :wait '
[color.negro] #g "backcolor black" :wait '
[color.blanco] #g "backcolor white" :wait '
'-------------------------------------------------------------------------
[lineas] '
data 15,"1","2","3","4","5","6","7","8","9","10","11","12","13","14","15" '
[colores] '
Data 13,"black","darkpink","darkblue" ,"darkgreen","darkred","darkgray" '
Data "brown","darkcyan","lightgray","pink","cyan","white","red" '
'
[lineThickness] '
restore [lineas] : a$="Grueso de Linea" : gosub [comboCaja] : wait '
[lineColor] '
restore [colores]: a$="Color de Linea" : gosub [comboCaja] : wait '
'....................................................................
[comboCaja] '
if properties(10)=0 then '
properties(10)=1 '
for n=1 to 15:tipo$(n)="": next '
read ndd:for n=1 to ndd:read c$:tipo$(n)=c$: next '
WindowWidth=210:WindowHeight=100:UpperLeftX=158:UpperLeftY=490'
combobox #col.sel, tipo$() ,[Selec] , 10,10,120,300 '
button #col.default, "Okay" ,[new] ,UL,140,10, 60, 24 '
button #col.cancel , "Cancel",[closeCol] ,UL,140,40, 60, 24 '
Open a$ for dialog as #col '
'************************* '
#col "trapclose [closeCol]" '
#col.sel "select ";selec$ '
#col.sel "setfocus" '
else '
gosub [closeCol] '
end if '
return '
'...... '
[Selec] '
wait 'espera hasta pulsar OKAY '
'......... '
[closeCol] '
if properties(10)=1 then close #col :properties(10)=0 '
wait '
'.... '
[new] '
#col.sel "selection? selec$" '
if a$="Grueso de Linea" then #g "size "; selec$ '
if a$="Color de Linea" then #g "color ";selec$ '
if left$(a$,6)="ELEGIR" then [nuevaCercha] '
wait '
'...............................................'
[nuevaCercha] '
for n=1 to ndd '
if selec$= tipo$(n) then '
tipo=tip+n: aaa$=aa$+left$(tipo$(n),12) '
gosub [do]: wait '
end if '
next '
wait '
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
[secciones] '
Data 4,"Rectangular","SeccionTe","Exagonal","SeccionL" '
'..............................................'
[Flexion.Simple] '
aa$="" : tip=100 '
restore [secciones]: a$="ELEGIR SECCION": gosub [comboCaja] '
if properties(8) = 0 then
UpperLeftX=DisplayWidth/3: WindowWidth =2*DisplayWidth/3 '
UpperLeftY=1 : WindowHeight=DisplayHeight*0.95 '
open "modelos de seccion" for graphics as #c '
'****************************************** '
#c "trapclose [closeGraph]" '
#c "down" : properties(8) = 1 '
loadbmp "c",g$+tipo$(1)+".bmp":#c "drawbmp c -20 0" '
loadbmp "c",g$+tipo$(2)+".bmp":#c "drawbmp c 0 215" '
loadbmp "c",g$+tipo$(3)+".bmp":#c "drawbmp c 500 0" '
loadbmp "c",g$+tipo$(4)+".bmp":#c "drawbmp c 300 315" '
#c "flush" '
end if '
wait '
'ñññññññññññññññññññññññññññññññññññññññññññññññññññññññ
[Seccion.T] '
dime=3 :rig=0 :aa$="A3" : tip=200 '
'restore [cercha.3D]: a$="ELEGIR CERCHA 3D": gosub [comboCaja]'
if properties(9) = 0 then '
UpperLeftX=DisplayWidth/3: WindowWidth =2*DisplayWidth/3 '
UpperLeftY=1 : WindowHeight=DisplayHeight*0.95 '
open "modelos de cercha3D" for graphics as #3d '
'********************************************* '
#3d "trapclose [closeGraph]" '
#3d "down" : properties(9) = 1 '
loadbmp "c",g$+tipo$(1)+".bmp":#3d "drawbmp c 0 0" '
loadbmp "c",g$+tipo$(2)+".bmp":#3d "drawbmp c 0 225" '
loadbmp "c",g$+tipo$(3)+".bmp":#3d "drawbmp c 0 440" '
#3d "flush" '
end if '
wait '
'ññññññññññññññññññññññññññññññññññññññññññññññññññññññ
[portico.3D] '
data 3,"cupula_pechinas","triangulo_doble" '
'...........................................................'
[PortTipo3D] '
dime=3 :rig=1 :aa$="R3" : tip=300 '
restore [portico.3D]: a$="ELEGIR PORTICO 3D": gosub [comboCaja] '
if properties(11) = 0 then '
UpperLeftX=DisplayWidth/3: WindowWidth =2*DisplayWidth/3 '
UpperLeftY=1 : WindowHeight=DisplayHeight*0.95 '
open "modelos de porticos3D" for graphics as #3r '
'********************************************* '
#3r "trapclose [closeGraph]" '
#3r "down" : properties(11) = 1 '
loadbmp "c",g$+tipo$(1)+".bmp":#3r "drawbmp c 0 0" '
loadbmp "c",g$+tipo$(2)+".bmp":#3r "drawbmp c 0 260" '
#3r "flush" '
end if '
wait '
'ñññññññññññññññññññññññññññññññññññññññññññññññññññññññññññ
[do] '
CeL=1 : gosub [unidades.entrada] '
gosub [cabecera] '
L=40/CeL ' Ancho cm '
H=25/CeL ' altura cm '
p=0:t=0: if tipo=102 then p=15 :t=20 ' secciones en T '
Md=50000 ' cmkp '
rec=4 ' cm '
ch=1.5 : ca=1.1 : cf=1.6 ' coeficientes de seguridad '
fck=175 :UeF$="kp" :UeL$="cm" ' resistencia del hormigon kg/cm2 '
fyk=4100 ' resistencia del acero kg/cm2 '
nC=2 : dC=10: nT=2 : dT=10 ' armaduras iniciales '
r1=35: r2=5 : r3=10: mx=1 : my=1 :mz=350 :kk=1 '
#1.r1 r1: #1.r2 r2: #1.r3 r3: #1.mx mx: #1.my my: #1.mz mz:#1.kk kk '
nombre$=aaa$: escala=1 '
#1.tipo tipo: #1.L L:#1.H H:#1.p p:#1.t t :#1.UeL UeL$:#1.UeF UeF$ '
#1.e fck:#1.pe fyk:#1.nombre nombre$: #1.esca escala : #1.Md Md '
#1.re rec:#1.ch ch:#1.ca ca:#1.cf cf:#1.nC nC: #1.dC dC:#1.nT nT:#1.dT dT '
gosub [closeCol] '
return '
'..............................................................................
[cabecera] '
if bw=0 then #1.x3 "Secc Rectangular"+chr$(13)+chr$(10)+"base Alt " '
if bw>0 then #1.x3 " Seccion en T" +chr$(13)+chr$(10)+"base Alt bw hf"
#1.x3 "!Disable":#1.x3 "!font arial 8 16" '
return '
'------------------------------------------------------------------------------
[save]
filedialog "Save Drawing As","*.bmp",saveFile$
if saveFile$="" then wait
if startX<oMouseX then x1=startX:x2=oMouseX else x1=oMouseX:x2=startX
if startY<oMouseY then y1=startY:y2=oMouseY else y1=oMouseY:y2=startY
#g "delsegment";" ";segId-1
#g "redraw"
#g "getbmp saver ";x1;" ";y1;" ";x2-x1;" ";y2-y1
bmpsave "saver",saveFile$
unloadbmp "saver"
#g "color blue"
segId=0
wait
'-------------------------------
[printIt] #g "print vga" :wait
[quit] call closeGraphWindow :wait
'--------------------------------
[about]
WindowWidth = 250
WindowHeight= 230
UpperLeftX=int((DisplayWidth-WindowWidth)/2)
UpperLeftY=int((DisplayHeight-WindowHeight)/2)
TexteditorColor$ ="darkblue"
ForegroundColor$ ="cyan"
aboutMessage$= programa$ +chr$(13)+chr$(13)+_
" Programa redactado por " +chr$(13)+_
" Antonio Martinez Gimenez" +chr$(13)+_
" http:\arquitectur.blogspot.com" +chr$(13)+_
" ------------------------------" +chr$(13)+chr$(13)+_
"Calculo/comprobacion de secciones"+chr$(13)+_
"de hormigon armado, rectangulares"+chr$(13)+_
"o de seccion T, a flexion simple,"+chr$(13)+_
"compuesta o esviada." +chr$(13)+_
"El programa permite introducir" +chr$(13)+_
"armadura comprimida prefijada" +chr$(13)+_
"por motivo constructivo o cal-" +chr$(13)+_
"cular su valor minimo necesario," +chr$(13)+_
"segun el momento flector." +chr$(13)+_
"La comprobacion de flexion com." +chr$(13)+_
"puede hacerse por Mom. o Carga." +chr$(13)+_
"(Cartagena/2013)" +chr$(13)+_
""
texteditor #ab.tx , 10, 10,220,160
button #ab.okBut,"OK",[ok],UL,90,175, 40, 20
if properties(7)=0 then open "CERCHAS-3D" for dialog as #ab
properties(7) =1
#ab "font ms_sans_serif 10"
#ab "trapclose [ok]"
#ab.tx, aboutMessage$
#ab.tx "!origin 1 1"
wait
'------------------
[ok] if properties(7)=1 then close #ab : properties(7)=0 : wait