29
programa$="porti_29.bas" '125661 21-8-13 '#1 =dialogo principal (cierra todas ventanas) '#t =texto salida de los calculos) '#dat1=texto de salida del fichero de datos '#3 =canal de salida de datos para .gra (.dc2) '#d =canal de entrada de los datos '#5 =ayuda '#6 =canal de entrada de ayuda '#conf=fichero de configuracion nomainwin dim propi(18),linea$(100),FuEEq(40),no.nudo(44) usuario$="Diego " desplazaH=100 :desplazaV=100 planta=0 andres=0 fuerza=1 ttto=10 spa=1 ndp=0 f.a8$="arial 8" f.a10$="arial 10" color.rayadoC$="red" :cort$=f.a8$ color.rayadoM$="red" :mome$=f.a8$ color.rayadoA$="red" :axia$=f.a8$ color.rayadoF$="red" color.puntual$="red" :F.pu$=f.a10$:gru.fPu=3 color.valorFu$="red" :F.un$=f.a10$ color.longitu$="blue" :fo.long$="arial 6 " color.barras$ ="black":gru.eje=3 color.nudos$ ="red" :nudo$="arial 12" color.aba.izq$="pink" :gruAbIz=6 color.arr.der$="green":gruArDe=8 color.car.Li1$="blue" :fo.cara$="arial 14" color.car.Li2$="black":fo.rest$=f.a8$ call configuracion pi=4*atn(1) r.g=180/pi :g.r=1/r.g g$=ruta.graf$ :o$=chr$(216) UpperLeftX=1:WindowWidth =DisplayWidth/3 UpperLeftY=1:WindowHeight=DisplayHeight*0.95 bmpbutton #1.dir,g$;"famg.bmp",[famg],UL,360,9 bmpbutton #1.bus,g$;"lupa.bmp",[busc],UL,33,48 bmpbutton #1.dat,g$;"SAVE.bmp",[escr],UL,135,60 bmpbutton #1.DAT,g$;"TANK.bmp",[AYUD],UL,213,50 bmpbutton #1.con,g$;"grua.bmp",[con] ,UL,280,50 bmpbutton #1.met,g$;"meta.bmp",[plot],UL,160,175 bmpbutton #1.col,g$;"colo.bmp",[colo],UL,160,132 bmpbutton #1.tex,g$;"font.bmp",[font],UL,252,136 bmpbutton #1.sis,g$;"sism.bmp",[sism],UL,302,136 bmpbutton #1.FAr,g$;"flAr.bmp",[FlAr],UL,167,460 bmpbutton #1.FAb,g$;"flAb.bmp",[FlAb],UL,207,460 bmpbutton #1.FDe,g$;"flDe.bmp",[FlDe],UL,247,460 bmpbutton #1.FIz,g$;"flIz.bmp",[FlIz],UL,287,460 bmpbutton #1.lla,g$;"llav.bmp",[todo],UL,202,420 bmpbutton #1.bom,g$;"bomb.bmp",[nada],UL,262,410 bmpbutton #1.tra,g$;"Tras.bmp",[borr],UL,292,410 bmpbutton #1.Smi,g$;"Smil.bmp",[repo],UL,322,410 bmpbutton #1.Sep,g$;"rall.bmp",[plAA],UL,322,470 bmpbutton #1.zom,g$;"zoom.bmp",[zoom],UL,362,480 bmpbutton #1.zAu,g$;"zoAu.bmp",[zoAu],UL,397,480 bmpbutton #1.zMa,g$;"zoMa.bmp",[zoMa],UL,362,514 bmpbutton #1.zMe,g$;"zoMe.bmp",[zoMe],UL,397,514 graphicbox #1.he,362,125 ,81,323'helice graphicbox #1.ci, 3,420,150,250'cielo graphicbox #1.me,161,548,280,122'metali button #1.cad,"DC2",[DC2],UL,202,134 button #1.To ,"T" ,[To],UL,245,358,22,20 button #1.kN ,"kN" ,[kN],UL,269,358,22,20 button #1.kP ,"kP" ,[kP],UL,293,358,22,20 button #1.me ,"m" ,[me],UL,245,378,22,20 button #1.cm ,"cm" ,[cm],UL,269,378,22,20 button #1.in ,"in" ,[in],UL,293,378,22,20 button #1.p,"Crear!",[po],UL, 3,295,110,20 button #1.N,"Nudo",[Nudo],UL,162,420,40,18 button #1.L,"Long",[Long],UL,222,420,40,18 button #1.PuNx,"Px",[Pu.Nx] ,UL,162,438,25,20 button #1.PuNy,"Py",[Pu.Ny] ,UL,188,438,25,20 button #1.PuBa,"PU",[Pu.B] ,UL,212,438,25,20 button #1.UnBa,"UN",[Un.B] ,UL,238,438,25,20 button #1.fuer,"Fuer",[fuer],UL,162,486,33,20 button #1.eF1 ,"+",[esc.eF1],UL,162,526,16,20 button #1.eF2 ,"-",[esc.eF2],UL,179,526,16,20 button #1.mome,"Mom" ,[mome],UL,202,486,33,20 button #1.eM1 ,"+",[esc.eM1],UL,202,526,16,20 button #1.eM2 ,"-",[esc.eM2],UL,219,526,16,20 button #1.cort,"Cort",[cort],UL,242,486,33,20 button #1.eC1 ,"+",[esc.eC1],UL,242,526,16,20 button #1.eC2 ,"-",[esc.eC2],UL,259,526,16,20 button #1.axia,"Axia",[axia],UL,282,486,33,20 button #1.eA1 ,"+",[esc.eA1],UL,282,526,16,20 button #1.eA2 ,"-",[esc.eA2],UL,299,526,16,20 button #1.Sepa1,"+",[esc.Sepa1],UL,322,526,16,20 button #1.Sepa2,"-",[esc.Sepa2],UL,339,526,16,20 button #1.IPN,"IPN",[IPN],UL, 3,426,30,20 button #1.IPE,"IPE",[IPE],UL,43,426,30,20 button #1.IPE,"IPH",[IPH],UL,83,426,30,20 button #1.UPN,"UPN",[UPN],UL,120,426,33,20 button #1.ALV,"ALV",[ALV],UL, 3,456,30,20 checkbox #1.Nudi,"",[seti],[reseti],162,400,16,16 checkbox #1.Nudj,"",[setj],[resetj],247,400,16,16 graphicbox #1.tit,3, 8,335,35 BackgroundColor$ = " 120, 110, 80"'blue TextboxColor$ = "yellow" textbox #1.pp$,3,86,335,22 TextboxColor$ = "green" statictext #1,"Vanos Pisos Hipot. f.nudo",3,126,160,20 textbox #1.ndv, 3,146,33,20 textbox #1.ndp,42,146,33,20 textbox #1.ndh,81,146,33,20 textbox #1.fn,120,146,33,20 statictext #1,"p.pro p.uso l.forj. ",3,166,120,20 textbox #1.qp , 3,186,33,20 textbox #1.qu ,42,186,33,20 textbox #1.lf ,81,186,33,20 statictext #1,"l.viga v.izq v.dere.",3,206,120,20 textbox #1.lv , 3,226,33,20 textbox #1.vii,42,226,33,20 textbox #1.vdd,81,226,33,20 statictext #1,"al.pb al.pi nº<1000 ",3,246,120,20

porti_29

Embed Size (px)

DESCRIPTION

Programa de calculo matricial de estructuras

Citation preview

Page 1: porti_29

programa$="porti_29.bas" '125661 21-8-13'#1 =dialogo principal (cierra todas ventanas)'#t =texto salida de los calculos)'#dat1=texto de salida del fichero de datos'#3 =canal de salida de datos para .gra (.dc2)'#d =canal de entrada de los datos'#5 =ayuda'#6 =canal de entrada de ayuda'#conf=fichero de configuracionnomainwindim propi(18),linea$(100),FuEEq(40),no.nudo(44)usuario$="Diego "desplazaH=100 :desplazaV=100planta=0andres=0fuerza=1ttto=10spa=1ndp=0f.a8$="arial 8"f.a10$="arial 10"color.rayadoC$="red" :cort$=f.a8$color.rayadoM$="red" :mome$=f.a8$color.rayadoA$="red" :axia$=f.a8$color.rayadoF$="red"color.puntual$="red" :F.pu$=f.a10$:gru.fPu=3color.valorFu$="red" :F.un$=f.a10$color.longitu$="blue" :fo.long$="arial 6 "color.barras$ ="black":gru.eje=3color.nudos$ ="red" :nudo$="arial 12"color.aba.izq$="pink" :gruAbIz=6color.arr.der$="green":gruArDe=8color.car.Li1$="blue" :fo.cara$="arial 14"color.car.Li2$="black":fo.rest$=f.a8$

call configuracionpi=4*atn(1)r.g=180/pi :g.r=1/r.gg$=ruta.graf$ :o$=chr$(216)UpperLeftX=1:WindowWidth =DisplayWidth/3UpperLeftY=1:WindowHeight=DisplayHeight*0.95bmpbutton #1.dir,g$;"famg.bmp",[famg],UL,360,9bmpbutton #1.bus,g$;"lupa.bmp",[busc],UL,33,48bmpbutton #1.dat,g$;"SAVE.bmp",[escr],UL,135,60bmpbutton #1.DAT,g$;"TANK.bmp",[AYUD],UL,213,50bmpbutton #1.con,g$;"grua.bmp",[con] ,UL,280,50bmpbutton #1.met,g$;"meta.bmp",[plot],UL,160,175bmpbutton #1.col,g$;"colo.bmp",[colo],UL,160,132bmpbutton #1.tex,g$;"font.bmp",[font],UL,252,136bmpbutton #1.sis,g$;"sism.bmp",[sism],UL,302,136bmpbutton #1.FAr,g$;"flAr.bmp",[FlAr],UL,167,460bmpbutton #1.FAb,g$;"flAb.bmp",[FlAb],UL,207,460bmpbutton #1.FDe,g$;"flDe.bmp",[FlDe],UL,247,460bmpbutton #1.FIz,g$;"flIz.bmp",[FlIz],UL,287,460bmpbutton #1.lla,g$;"llav.bmp",[todo],UL,202,420bmpbutton #1.bom,g$;"bomb.bmp",[nada],UL,262,410bmpbutton #1.tra,g$;"Tras.bmp",[borr],UL,292,410bmpbutton #1.Smi,g$;"Smil.bmp",[repo],UL,322,410bmpbutton #1.Sep,g$;"rall.bmp",[plAA],UL,322,470bmpbutton #1.zom,g$;"zoom.bmp",[zoom],UL,362,480bmpbutton #1.zAu,g$;"zoAu.bmp",[zoAu],UL,397,480bmpbutton #1.zMa,g$;"zoMa.bmp",[zoMa],UL,362,514

bmpbutton #1.zMe,g$;"zoMe.bmp",[zoMe],UL,397,514

graphicbox #1.he,362,125 ,81,323'helicegraphicbox #1.ci, 3,420,150,250'cielographicbox #1.me,161,548,280,122'metalibutton #1.cad,"DC2",[DC2],UL,202,134button #1.To ,"T" ,[To],UL,245,358,22,20button #1.kN ,"kN" ,[kN],UL,269,358,22,20button #1.kP ,"kP" ,[kP],UL,293,358,22,20button #1.me ,"m" ,[me],UL,245,378,22,20button #1.cm ,"cm" ,[cm],UL,269,378,22,20button #1.in ,"in" ,[in],UL,293,378,22,20button #1.p,"Crear!",[po],UL, 3,295,110,20button #1.N,"Nudo",[Nudo],UL,162,420,40,18button #1.L,"Long",[Long],UL,222,420,40,18button #1.PuNx,"Px",[Pu.Nx] ,UL,162,438,25,20button #1.PuNy,"Py",[Pu.Ny] ,UL,188,438,25,20button #1.PuBa,"PU",[Pu.B] ,UL,212,438,25,20button #1.UnBa,"UN",[Un.B] ,UL,238,438,25,20

button #1.fuer,"Fuer",[fuer],UL,162,486,33,20button #1.eF1 ,"+",[esc.eF1],UL,162,526,16,20button #1.eF2 ,"-",[esc.eF2],UL,179,526,16,20button #1.mome,"Mom" ,[mome],UL,202,486,33,20button #1.eM1 ,"+",[esc.eM1],UL,202,526,16,20button #1.eM2 ,"-",[esc.eM2],UL,219,526,16,20button #1.cort,"Cort",[cort],UL,242,486,33,20button #1.eC1 ,"+",[esc.eC1],UL,242,526,16,20button #1.eC2 ,"-",[esc.eC2],UL,259,526,16,20button #1.axia,"Axia",[axia],UL,282,486,33,20button #1.eA1 ,"+",[esc.eA1],UL,282,526,16,20button #1.eA2 ,"-",[esc.eA2],UL,299,526,16,20button #1.Sepa1,"+",[esc.Sepa1],UL,322,526,16,20button #1.Sepa2,"-",[esc.Sepa2],UL,339,526,16,20button #1.IPN,"IPN",[IPN],UL, 3,426,30,20button #1.IPE,"IPE",[IPE],UL,43,426,30,20button #1.IPE,"IPH",[IPH],UL,83,426,30,20button #1.UPN,"UPN",[UPN],UL,120,426,33,20button #1.ALV,"ALV",[ALV],UL, 3,456,30,20

checkbox #1.Nudi,"",[seti],[reseti],162,400,16,16checkbox #1.Nudj,"",[setj],[resetj],247,400,16,16graphicbox #1.tit,3, 8,335,35

BackgroundColor$ = " 120, 110, 80"'blueTextboxColor$ = "yellow"textbox #1.pp$,3,86,335,22TextboxColor$ = "green"statictext #1,"Vanos Pisos Hipot. f.nudo",3,126,160,20textbox #1.ndv, 3,146,33,20textbox #1.ndp,42,146,33,20textbox #1.ndh,81,146,33,20textbox #1.fn,120,146,33,20statictext #1,"p.pro p.uso l.forj. ",3,166,120,20textbox #1.qp , 3,186,33,20textbox #1.qu ,42,186,33,20textbox #1.lf ,81,186,33,20statictext #1,"l.viga v.izq v.dere.",3,206,120,20textbox #1.lv , 3,226,33,20textbox #1.vii,42,226,33,20textbox #1.vdd,81,226,33,20statictext #1,"al.pb al.pi nº<1000 ",3,246,120,20

Page 2: porti_29

textbox #1.apb, 3,266,33,20textbox #1.ap ,42,266,33,20textbox #1.num$,81,266,33,20statictext #1,"Unidades de Salida",160,338,160,20statictext #1,"Fuerzas ",160,358, 50,20textbox #1.UsF ,212,358,30,20statictext #1,"Longitud",160,380, 50,20textbox #1.UsL ,212,378,30,20textbox #1.salto,282,438,32,20textbox #1.NudoT,180,400,33,20textbox #1.Nudoj,212,400,33,20textbox #1.eF ,162,506,33,20textbox #1.eM ,202,506,33,20textbox #1.eC ,242,506,33,20textbox #1.eA ,282,506,33,20textbox #1.Sepa ,322,506,33,20textbox #1.esca ,362,462,32,18textbox #1.hip 264,438,18,20TexteditorColor$="white"Texteditor #1.perfil, 3,320,150,100'**********************************'----------------------------------open programa$ for dialog as #1#1.hip 1#1 "font ";f.a10$#1 "trapclose [fin]"#1.tit "font arial 7 34 bold italic ;color white "'darkgreen"#1.tit "fill 120 0 200 ;backcolor 120 0 200"#1.tit "up;home;goto 1 25 ; down"#1.tit "\ CALCULO MATRICIAL : PORTICOS PLANOS"#1.tit "flush"#1.salto 5#1.perfil "!font ";"courier_new 6"gosub [bmp]Nudo.i=0:Nudo.j=0gosub [foto]wait'-------------------------------------[bmp]loadbmp "c",g$;"helice.bmp":#1.he "drawbmp c 0 0"loadbmp "c",g$;"cielo.bmp" :#1.ci "drawbmp c 0 0"loadbmp "c",g$;"metal2.bmp":#1.me "drawbmp c 0 0"return'..................[To] #1.UsF "T" :wait[kN] #1.UsF "kN":wait[kP] #1.UsF "kP":wait[me] #1.UsL "m" :wait[cm] #1.UsL "cm":wait[in] #1.UsL "in":wait'....................[unoA]if spa<1 then spa=1if uno=0 then gosub [noti]else planta=2 returnend ifwait'-------------------zoom del dibujo completo[zoom] #1.esca, "!contents? e"

goto [esca.comun][zoAu] e=e.inicial:#1.esca e:goto [zoom][zoMa] escala1=1: e=e+escala1:#1.esca e:wait[zoMe] escala1=1: e=e-escala1:#1.esca e:wait

'...................esquema delantero[fuer]fuerza=1:planta=2goto [plAA][mome]moment=1:planta=2if Nudo.i=1 then Movi=7:goto [ii.jj]if Nudo.j=1 then Movi=8:goto [ii.jj]goto [plAA][cort]cortan=1:planta=2if Nudo.i=1 then Movi=9 :goto [ii.jj]if Nudo.j=1 then Movi=10:goto [ii.jj]goto [plAA][axia]axial=1:planta=2if Nudo.i=1 then Movi=11:goto [ii.jj]if Nudo.j=1 then Movi=12:goto [ii.jj]goto [plAA]'..................zoom de esquemas solo[esc.eF1] e.q=e.q+1:#1.eF e.q:goto [AAA][esc.eF2] e.q=e.q-1:#1.eF e.q:goto [AAA][esc.eM1] e.M=e.M+1:#1.eM e.M:goto [AAA][esc.eM2] e.M=e.M-1:#1.eM e.M:goto [AAA][esc.eC1] e.C=e.C+1:#1.eC e.C:goto [AAA][esc.eC2] e.C=e.C-1:#1.eC e.C:goto [AAA][esc.eA1] e.A=e.A+1:#1.eA e.A:goto [AAA][esc.eA2] e.A=e.A-1:#1.eA e.A:goto [AAA]

[esc.Sepa1] spa=spa+1 :#1.Sepa spa:goto [AAA][esc.Sepa2] spa=max(spa-1,1):#1.Sepa spa:goto [AAA]

[AAA] gosub [unoA]:goto [plAA]'.............................[esca.comun]if pp$="" then gosub [noti]planta=1goto [plAA]'.............................[todo] n.nudo=111:ii=111:if Movi>0 then #1.NudoT 111:wait[nada] if n.nudo<111 then n.nudo=111+Movi:if n.nudo>111 then #1.NudoT n.nudo:wait if n.nudo>110 then n.nudo=0:#1.NudoT n.nudo:goto [plAA][borr] if Movi=1 then n.nudo=n.nudo+200:goto [plAA] if Movi=2 then ii=ii+200:goto [plAA][repo] if Movi=1 then n.nudo=n.nudo+300:goto [plAA] if Movi=2 then ii=ii+300:goto [plAA]

[Nudo] Movi=1:goto [nudoT][Long] Movi=2:goto [ii.jj][Pu.Nx] Movi=3:goto [nudoT][Pu.Ny] Movi=4:goto [nudoT][Pu.B] Movi=5:goto [ii.jj][Un.B] Movi=6:goto [ii.jj]

[ii.jj] #1.NudoT, "!contents? ii":#1.Nudoj, "!contents? jj":wait[nudoT] #1.NudoT, "!contents? n.nudo":wait'.........................................

Page 3: porti_29

[seti] Nudo.i=1:wait[reseti] Nudo.i=0:Movi=0:wait[setj] Nudo.j=1:wait[resetj] Nudo.j=0:Movi=0:wait'............................[FlAr] w=-1:goto [Fle.ver][FlAb] w=1 :goto [Fle.ver][FlDe] w=1 :goto [Fle.hor][FlIz] w=-1:goto [Fle.hor]

[Fle.ver]#1.salto,"!contents? sal":s=sal*wselect case Movicase 0 :desplazaV=desplazaV+5*s:escala=0case 1 :desNu(2)=scase 2 :desLo(2)=scase 3 :desPNx(2)=scase 4 :desPNy(2)=scase 5 :desPB(2)=scase 6 :desUB(2)=scase 7 :desMi(2)=scase 8 :desMj(2)=scase 9 :desCi(2)=scase 10:desCj(2)=-1*scase 11:desAi(2)=scase 12:desAj(2)=-1*send selectgoto [flechas]

[Fle.hor]#1.salto,"!contents? sal":s=sal*wselect case Movicase 0 :desplazaH=desplazaH+5*s:escala=0case 1 :desNu(1)=-1*scase 2 :desLo(1)=scase 3 :desPNx(1)=scase 4 :desPNy(1)=scase 5 :desPB(1)=scase 6 :desUB(1)=scase 7 :desMi(1)=scase 8 :desMj(1)=scase 9 :desCi(1)=scase 10:desCj(1)=scase 11:desAi(1)=scase 12:desAj(1)=send select

[flechas]'********if Movi>0 then andres=1if Movi=1 then for h=1 to Nhi :gosub [desplaNu]:next:waitif Movi=2 then for h=1 to Nhi :gosub [desplaLo]:next:waitif Movi=3 or Movi=4 then for h=1 to Nhi:gosub [desplaPN]:next:waitif Movi=5 or Movi=6 then for h=1 to Nhi:gosub [desplaPB]:next:waitif Movi>6 then for h=1 to Nhi :gosub [desplaMi]:next:waitIf Movi=0 and nada=1 then noNu=1if Movi<7 then Movi=0goto [plAA]'----------------------------------------------------------[busc]filedialog "Ficheros *.dat", ruta.proy$+"*.dat", fileName$pp$=fileName$

lon.pp=len(pp$)pp1$=left$(pp$,lon.pp-4)

if pp$<>"" then ' #1.pp$ pp$

[reabrir] #1.pp$ pp$ ' call abrirdat open pp$ for input as #datos2 '---------------------------- t=0:n=0:b=0:c=0:fu=0:t$="" dim f.n.h(10) 'fuerzas en nudos c/hip. For h=1 to Nhi:f.n.h(h)=0:next Nhi=0:Nbt=0:Nnu=0:Nba=0:Nap=0 line input #datos2,t$ :linea$(1)=t$ line input #datos2,t$ :linea$(2)=t$ while eof(#datos2)=0 input #datos2, t$ if upper$(left$(t$,1))="T" then t=1 if t=1 then Nbt=Nbt+1 if upper$(left$(t$,1))="N" then t=0 :Nbt=Nbt-2:n=1 if n=1 then Nnu=Nnu+1 if upper$(left$(t$,1))="B" then n=0 :Nnu=Nnu-2:b=1 if b=1 then Nba=Nba+1 if upper$(left$(t$,1))="A" then b=0 :Nba=Nba-2:c=1 if c=1 then Nap=Nap+1 if left$(t$,1)="F" then c=0:Nap=Nap-2:fu=1 if fu=1 then if upper$(left$(t$,2))="HI" then Nhi=Nhi+1 f.n.h(Nhi)=f.n.h(Nhi)+1 end if if upper$(left$(t$,1))="C" then fu=0 'Cargas en barras wend f.n.h(Nhi)=f.n.h(Nhi)-1 For h=1 to Nhi:f.n.h(h)=(f.n.h(h)-1):next close #datos2'------------dim n.c1(Nba,Nhi),n.c2(Nba,Nhi)for h=1 to hip:Nbc2(h)=0:nextfin=0:hip=0:ba=0:texto$=""

open pp$ for input as #datos1'----------------------------line input #datos1, t$:#dat1 pp$line input #datos1, t$:#dat1 t$hip=0

dim das$(33)dim dato$(2*Nba+1)dim da.Nu$(2*Nnu+1)dim daPNx$(2*Nnu+1),daPNy$(2*Nnu+1)dim daPB$(2*Nba+1) ,daUB$(2*Nba+1)dim daMOi$(2*Nba+1),daMOj$(2*Nba+1)dim daCOi$(2*Nba+1),daCOj$(2*Nba+1)dim daAXi$(2*Nba+1),daAXj$(2*Nba+1)dim Fu.sis(Nnu), no.ii(Nba)

Page 4: porti_29

dim sepaNu(Nnu,2),desNut(Nnu,2),desNu2(Nnu,2)dim sepaLo(Nba,2),desLot(Nba,2),desLo2(Nba,2)

dim sepaPNx(Nnu,2),desPNxt(Nnu,2),desPNx2(Nnu,2) 'componente xdim sepaPNy(Nnu,2),desPNyt(Nnu,2),desPNy2(Nnu,2) 'componente y

dim sepaPB(Nba,2),desPBt(Nba,2),desPB2(Nba,2)dim sepaUB(Nba,2),desUBt(Nba,2),desUB2(Nba,2)dim sepaMi(Nba,2),desMit(Nba,2),desMi2(Nba,2)dim sepaMj(Nba,2),desMjt(Nba,2),desMj2(Nba,2)dim sepaCi(Nba,2),desCit(Nba,2),desCi2(Nba,2)dim sepaCj(Nba,2),desCjt(Nba,2),desCj2(Nba,2)dim sepaAi(Nba,2),desAit(Nba,2),desAi2(Nba,2)dim sepaAj(Nba,2),desAjt(Nba,2),desAj2(Nba,2)dim XXX(Nba,5), YYY(Nba,5), UUU(Nba,5)

parame=0parame2=0kilo=0nn=0

linea=2while eof(#datos1)=0

line input #datos1, t$ :#dat1 t$if left$(t$,1)<>"." then linea=linea+1 linea$(linea)=t$ If left$(t$,1)="C" then ba=1 if ba=1 then if upper$(left$(t$,2))="HI" then hip=hip+1: lineas=0: Nbc2(hip)=0 end if if t$="" then fin=1 if hip>0 and fin=0 then comas=0 : lon=len(t$) for cara=1 to lon-1 cara$=mid$(t$,cara,1): if cara$="," then comas=comas+1 next cara if comas>0 then lineas=lineas+1 n.c2(lineas,hip)=comas 'Nbc1(hip)=Nbc1(hip)+n.c1(lineas) if comas>0 then Nbc2(hip)=Nbc2(hip)+1 if hip=1 then mNbc2=Nbc2(1) if Nbc2(hip)>Nbc2(hip-1) then mNbc2=Nbc2(hip) 'max. dimension mNbc2=10 end if end if

if left$(t$,2)=".." then parame=1 : kilo=kilo+1 if parame=1 then a$=t$ m=0 pepe=0 d$="" cara.a$=""

For di=1 to len(a$) cara$=mid$(a$,di,1) if cara$<>" " and cara.a$=" " and pepe=0 then m=m+1 :pepe=1 if pepe=1 then d$=d$+cara$ cara.a$=cara$

next das$(kilo)=d$ m=0 end if

if left$(t$,2)=".-" then parame2=1 if parame2=1 then a$=" "+t$+" " m=0 d$="" cara.a$=" " nn=nn+1 For n=1 to len(a$) cara$=mid$(a$,n,1) if cara$<>" " and cara.a$= " " then m=m+1 if cara$<>" " then d$=d$+cara$ select case nn case 1 :da.Nu$(m)=d$ case 2 :dato$(m) =d$ case 3 :daPNx$(m)=d$ case 4 :daPNy$(m)=d$ case 5 :daPB$(m) =d$ case 6 :daUB$(m) =d$ case 7 :daMOi$(m)=d$ case 8 :daMOj$(m)=d$ case 9 :daCOi$(m)=d$ case 10:daCOj$(m)=d$ case 11:daAXi$(m)=d$ case 12:daAXj$(m)=d$ end select end if if cara$ =" " and cara.a$<>" " then d$="" cara.a$=cara$ next m=0 end ifwend

pepe=0kilo=0

if parame=1 thencolor.rayadoC$=das$(1)cort$ =das$(2)color.rayadoM$=das$(3)mome$ =das$(4)color.rayadoA$=das$(5)axia$ =das$(6)color.rayadoF$=das$(7)color.puntual$=das$(8)F.pu$ =das$(9)gru.fPu =max(val(das$(10)),2)color.valorFu$=das$(11)F.un$ =das$(12)color.longitu$=das$(13)fo.long$ =das$(14)color.barras$ =das$(15)gru.eje =val(das$(16))color.nudos$ =das$(17)nudo$ =das$(18)

Page 5: porti_29

color.aba.izq$=das$(19)gruAbIz =max(val(das$(20)),3)color.arr.der$=das$(21)gruArDe =max(val(das$(22)),3)color.car.Li1$=das$(23)fo.cara$ =das$(24)color.car.Li2$=das$(25)fo.rest$=das$(26)escaB=max(val(das$(27)),24)e.q =max(val(das$(28)),3)e.C =max(val(das$(29)),2)e.M =max(val(das$(30)),2)e.A =max(val(das$(31)),0.5)spa =max(val(das$(32)),1)end if

if parame2=1 then for n=1 to Nnu v=2*n for m=1 to 2 w=v+m-1 desNut(n,m) =val(da.Nu$(w)) desPNxt(n,m)=val(daPNx$(w)) desPNyt(n,m)=val(daPNy$(w)) next:next

for n=1 to Nba v=2*n for m=1 to 2 w=v+m-1 desLot(n,m)=val(dato$(w)) desPBt(n,m)=val(daPB$(w)) desUBt(n,m)=val(daUB$(w)) desMit(n,m)=val(daMOi$(w)) desMjt(n,m)=val(daMOj$(w)) desCit(n,m)=val(daCOi$(w)) desCjt(n,m)=val(daCOj$(w)) desAit(n,m)=val(daAXi$(w)) desAjt(n,m)=val(daAXj$(w)) next:nextend if'............close #datos1'------------elsegosub [noti]end if

#1.eF e.q#1.eM e.M#1.eA e.A#1.eC e.C#1.Sepa spaif valdirene=1 then valdirene=0:goto [plot]wait'..........................'oooooooooooooooooooooooooooo

[noti]notice usuario$+notis$:waitreturn'.....

[escr]if propi(6)=1 then#dat1 "!cls"if ndp>0 then for n=1 to ndp fff$=" 0 0":if n<ndp then fff$=" 0 0, " linea.sismo$=linea.sismo$+d0$(Nu.sis(n))+" "+t2$(FuEEq(n))+fff$ nextend if#dat1 pp$for n=2 to linea if añadir.sismo=1 and ndp>0 then #dat1 linea.sismo$:añadir.sismo=0 #dat1 linea$(n) if upper$(left$(linea$(n-1),2))="FU" and upper$(left$(linea$(n),2))="HI" then añadir.sismo=1next

#dat1 ".";pp$#dat1 ".Nbt=";Nbt;" ";"Nnu=";Nnu;" ";"Nba=";Nba;" ";_"Nap=";Nap;" ";"Nhi=";Nhi;" ";"hip=";hip;" ";_"Nbc2(1)=";Nbc2(1);" ";"Nbc2(2)=";Nbc2(2);" ";"mNbc2=";mNbc2#dat1 ".fuerzas en nudos en cada hip. = ";for h=1 to Nhi: #dat1 f.n.h(h);" ";:next#dat1 ""#dat1 ".Numero de cargas en cada linea= ";for h=1 to Nhi#dat1 " h ";h;" "; for n=1 to Nbc2(h): #dat1 n.c2(n,h);" ";:next

next#dat1 ""

#dat1 "."#dat1 ".parametros de presentacion"#dat1 "..color.rayadoC ";color.rayadoC$ #dat1 "..font.cortante ";cort$#dat1 "..color.rayadoM ";color.rayadoM$#dat1 "..font.momento ";mome$#dat1 "..color.rayadoA ";color.rayadoA$#dat1 "..font.axial ";axia$#dat1 "..color.rayadoF ";color.rayadoF$#dat1 "..color.puntual ";color.puntual$#dat1 "..F.puntual ";F.pu$#dat1 "..grueso.fPu ";gru.fPu#dat1 "..color.valorFu ";color.valorFu$#dat1 "..F.uniforme ";F.un$#dat1 "..color.longitu ";color.longitu$#dat1 "..fo.long ";fo.long$#dat1 "..color.barras ";color.barras$#dat1 "..gru.eje ";gru.eje#dat1 "..color.nudos ";color.nudos$#dat1 "..nudo ";nudo$#dat1 "..color.aba.izq ";color.aba.izq$#dat1 "..gruAbIz ";gruAbIz#dat1 "..color.arr.der ";color.arr.der$#dat1 "..gruArDe ";gruArDe#dat1 "..color.car.Li1 ";color.car.Li1$#dat1 "..fo.cara ";fo.cara$#dat1 "..color.car.Li2 ";color.car.Li2$#dat1 "..fo.restantes ";fo.rest$ #dat1 "..escala ";e#dat1 "..esca.Fuerzas ";e.q

Page 6: porti_29

#dat1 "..esca.Cortan ";e.C#dat1 "..esca.Momentos ";e.M#dat1 "..esca.Axial ";e.A#dat1 "..separa.Rayado ";spa#dat1 ".."

'for h=1 to Nhi#dat1 ".desplazamientos" ' hipotesis ";h#dat1 ".-Nudos ";:for n=1 to Nnu:for m=1 to 2:#dat1 desNut(n,m);" ";:next:next:#dat1 ""#dat1 ".-Longitud ";:for n=1 to Nba:for m=1 to 2:#dat1 desLot(n,m);" ";:next:next:#dat1 ""#dat1 ".-PUxNudo ";:for n=1 to Nnu:for m=1 to 2:#dat1 desPNxt(n,m);" ";:next:next:#dat1 ""#dat1 ".-PUyNudo ";:for n=1 to Nnu:for m=1 to 2:#dat1 desPNyt(n,m);" ";:next:next:#dat1 ""#dat1 ".-PU.Barra ";:for n=1 to Nba:for m=1 to 2:#dat1 desPBt(n,m);" ";:next:next:#dat1 ""#dat1 ".-UN.Barra ";:for n=1 to Nba:for m=1 to 2:#dat1 desUBt(n,m);" ";:next:next:#dat1 ""#dat1 ".-MOi.Barr ";:for n=1 to Nba:for m=1 to 2:#dat1 desMit(n,m);" ";:next:next:#dat1 ""#dat1 ".-MOj.Barr ";:for n=1 to Nba:for m=1 to 2:#dat1 desMjt(n,m);" ";:next:next:#dat1 ""#dat1 ".-COi.Barr ";:for n=1 to Nba:for m=1 to 2:#dat1 desCit(n,m);" ";:next:next:#dat1 ""#dat1 ".-COj.Barr ";:for n=1 to Nba:for m=1 to 2:#dat1 desCjt(n,m);" ";:next:next:#dat1 ""#dat1 ".-AXi.Barr ";:for n=1 to Nba:for m=1 to 2:#dat1 desAit(n,m);" ";:next:next:#dat1 ""#dat1 ".-AXj.Barr ";:for n=1 to Nba:for m=1 to 2:#dat1 desAjt(n,m);" ";:next:next:#dat1 ""'next helsenotice notis$end ifwait'......................................[datos.iniciales] 'lee datos del *.data$=" "+t$+" "m=0dim dato$(41)For di=1 to len(a$) cara$=mid$(a$,di,1) if cara$<>" " and cara.a$= " " then m=m+1 if cara$<>" " then d$=d$+cara$:dato$(m)=d$ if cara$ =" " and cara.a$<>" " then d$="" cara.a$=cara$nextm=0return'.............................sub abrirdat if propi(6)=1 then call closedat if propi(6)=0 then WindowWidth=DisplayWidth/3:UpperLeftX=WindowWidth WindowHeight=DisplayHeight*0.47:UpperLeftY=1 menu #dat1 , "Fichero", "Grabar", [grabar],"Reabrir", [abrir], "guardar+abrir",[guardar.abrir]

open "dat1" for text as #dat1 '****************************

#dat1 "!font courier new 12" #dat1 "!trapclose [closeDat]"; propi(6)=1 end ifend sub

[closeDat] #dat1 "!modified? answer$" ; if answer$="true" then response$="si" prompt "¿Hay modificaciones para guardar? ";response$ if response$="si" then [grabar] else call closedat end ifwait

sub closedat if propi(6)=1 then close #dat1:propi(6)=0 end ifend sub'oooooooooooooooooooooooooooooooooooooooooo[guardar.abrir]valdirene=1goto [grabar]goto [reabrir]'-----------------------------------------[abrir] 'if pp2$<>"" then pp$=pp2$ 'goto[reabrir] ''-----------------------------------------'[grabar] ' 'contador=val(right$(pp1$,1)) 'contador.nuevo=contador+1 'if contador.nuevo>1 then ' lon.pp=len(pp1$) ' pp1$=left$(pp1$,lon.pp-1) 'end if 'pp2$=pp1$ +str$(contador.nuevo)+".dat" 'pp1$=pp1$+str$(contador.nuevo)open pp2$ for output as #dat3 '#dat1 "!lines countVar"; ' 'for n=1 to countVar ' print #dat1, "!line ";n;" string$"; ' #dat3 string$ 'next 'notice "Cambios guardados [";contador.nuevo;"] sin borrar el original [";contador.nuevo-1;"]"

close #dat3if valdirene=1 then valdirene=0:goto [abrir]wait ''-----------------------------------------[AYUD]call SiAyu:waitsub SiAyuif propi(5)=0 thenopen "AYUDA" for text as #5'--------------------------

Page 7: porti_29

#5 "!trapclose [NoAyu]";propi(5)=1ayu$=ruta.ayud$+"AyudaPorti3.txt"open ayu$ for input as #6#5 "!font ";"arial 10";DOline input #6, a$ :#5 a$loop until a$="Fin"close #6end ifend sub[NoAyu] call NoAyu:waitsub NoAyu if propi(5)=1 then close #5:propi(5)=0end sub'--------------------------------[DC2] opc$="d":call configuracion:wait'--------------------------------sub configuracionglobal fi.dc$,mo.hor,mo.ace,mo.rigiglobal ruta.graf$,ruta.conf$,ruta.ayud$,ruta.prin$,ruta.proy$open "config-portic.txt" for input as #conf input #conf, a$,fi.dc$ input #conf, a$,mo.hor input #conf, a$,mo.ace input #conf, a$,mo.rigi input #conf, a$,ruta.graf$ 'graficos , c:\Por-planos\bmp\ input #conf, a$,ruta.conf$ 'configura, c:\Por-planos\ input #conf, a$,ruta.ayud$ 'ayuda , c:\Por-planos\ input #conf, a$,ruta.prin$ 'programa , c:\Por-planos\ input #conf, a$,ruta.proy$ 'proyectos, c:\Por-planos\proyectos\close #confend sub'-----------------------------[fin]call closegFcall closeTclose #1call NoAyucall closedatcall closegMcall closegCcall closegAif propi(10)=1 then close #abif propi(13)=1 then close #wif propi(14)=1 then close #aif propi(18)=1 then close #perfcall closeSismocall closeSismo2end'OOOOOOOOOOOOOOOOOOOOOOOOOOOOO[plot]e=0:escala=0:planta=0calculo=1andres=0#1.UsL, "!contents? CsL$"#1.UsF, "!contents? CsF$"CsL=1:CsF=1lo$="m.":fu$="T."If upper$(CsL$)="M" then lo$="m.":CsL=1If upper$(CsL$)="CM" then lo$="cm":CsL=100if upper$(CsL$)="IN" then lo$="in":CsL=39.37

If upper$(CsF$)="T" then fu$="T.":CsF=1If upper$(CsF$)="KN" then fu$="kN":CsF=10if upper$(CsF$)="KP" then fu$="kP":CsF=2.2046'--------------------------------------------if propi(6)=0 then gosub [noti]call opent ''[.dat]> PORTI_26.exe>[.txt]+[.gra]>TRI3.BSC>[.dc2]>DC2000.exe>[.dc]if opc$="d" then ' ppd$=right$(pp$,9) ' ppd$=left$(ppd$,5) ' ndg$=fi.dc$+ppd$+".gra" ' open ndg$ for output as #3 'escribe el fichero dc2 #3 ndg$: dc2=1 'end if 'open pp$ for input as #d 'lee los datos del porticofff$=pp$ ''0000000000000000000000000000input #d, tit$line INPUT #d, t$ :gosub [datos.iniciales]mo.yo$=left$(dato$(1),1)UeF$ =left$(dato$(2),1)UeL$ =left$(dato$(3),1) 'material y uni.entrada

if upper$(UeF$)="T" then CeF=1if upper$(UeF$)="KN" then CeF=0.1if upper$(UeL$)="M" then CeL=1if upper$(UeL$)="CM" then CeL=0.01'mo.yo$=left$(mo.yo$,1)if mo.yo$="h" then mYoung=mo.hor :E=mo.horif mo.yo$="a" then mYoung=mo.ace :E=mo.ace'-----------------------------------------input #d, a$ 'Tipos de barraDIM Iner(Nbt),Area(Nbt),co(Nbt),ba(Nbt),al(Nbt),forma$(Nbt+2)FOR n=1 TO Nbt ' forma$ p = perfil (mom Inercia y Area) si Iner=0 es articulada ' r =rectangulo (base y altura) r.a=rectangulo articulado ' c =circulo (radio,0) c.a=circulo articulado input #d, t$ :gosub [datos.iniciales] co(n)=val(dato$(1)) ba(n)=val(dato$(2))*CeL 'base, m.inercia, radio al(n)=val(dato$(3))*CeL 'altura, area forma$(n)=dato$(4)

for$=left$(forma$(n),1)if mo.yo$="h" thenselect case for$ case "r" :Area(n)=ba(n)*al(n):Iner(co(n))=ba(n)*al(n)^3/12 case "c" :Area(n)=pi*ba(n)^2 :Iner(co(n))=pi*ba(n)^4/4 case "p" :Area(n)=al(n)*CeL :Iner(n)=ba(n)*CeL^3end selectIf right$(forma$(n),1)="a" then Iner(n)=0end if

t.p=0if mo.yo$="a" then if for$="p" then Area(n)=al(n)*10^-4:Iner(n)=ba(n)*10^-8 if for$="I" or for$="U" then tipo.perfil$= left$(forma$(n),3) perfil$ =right$(forma$(n),3)if n=1 then #1.perfil " h b peso InerX InerY Area"#1.perfil tipo.perfil$;"_";

Page 8: porti_29

gosub [perfil] Area(n)=area.tabla*10^-4:Iner(n)=iner.tabla*10^-8:peso.m(n)=peso.t end ifend if'perfil de acero: Iner cm^4 y area cm^2, se pasan a m^4 y m^2next n'--------------------------input #d, a$dim x(Nnu),y(Nnu),n.nu(Nnu)xmax=0:ymax=0:xmin=0:ymin=0for n=1 to Nnu input #d,t$:gosub [datos.iniciales] n.nu(n)=val(dato$(1)) x(n) =val(dato$(2))*CeL y(n) =val(dato$(3))*CeL xmax=max(xmax,x(n)) xmin=min(xmin,x(n)) ymax=max(ymax,y(n)) ymin=min(ymin,y(n))next' -------------------------dim n.i(Nba),n.j(Nba),t.b(Nba)input #d, a$Ndi=0: dif=0FOR n=1 TO Nba input #d, t$ :gosub [datos.iniciales] n.i(n)=val(dato$(1)) 'nudos extremos n.j(n)=val(dato$(2)) t.b(n)=val(dato$(3)) if n.i(n)>n.j(n) then ni=n.i(n):nj=n.j(n):gosub [error1]:n.i(n)=ni:n.j(n)=nj dif=n.j(n)-n.i(n) Ndi=max(Ndi,dif)nextif opc$="d" then #3 "Nudos": #3 Nnu 'graba en .gra for n=1 to Nnu:#3 n.nu(n):#3 x(n):#3 y(n):#3 "-":next #3 "Barras": #3 Nba: #3 Nhi For n=1 to Nba:#3 n.i(n):#3 n.j(n):#3 "-":Nextend if'-----------------------------------Nec=3*Nnu 'Num. ecuac.Nsb=3*(Ndi+1) 'ancho de semibandadim F(Nec,Nhi):dim R(Nec,Nsb) 'Matrices de Cargas y Rigideces

'#t " n i j i1 j1 jd t i1,1 j1,1 i1,jd+1 "'" t i1,2 j1,2 i1,jd+2 i1+1,jd "+_'" t i1,3 j1,3 i1,jd+3 i1+2,jd-1 t i1+1,1 j1+1,1 i1+1,jd +1 "+_'" t i1+1,2 j1+1,2 i1+1,jd+2 i1+2,jd t i1+2,1 j1+2,1 i1+2,jd+1"

For n=1 to Nbagosub [cosenos]'************** Aportacion de cada barra a la matriz de rigidez'#t d0$(n);" ";d0$(i);" ";d0$(j);" ";d0$(i1);" ";d0$(j1);" ";d0$(jd);" ";S=sena:C=cosat=e1*C^2+e12*S^2:R(i1,1)=R(i1,1)+t:R(j1,1)=R(j1,1)+t:R(i1,jd+1)=-1*t'#t v0$(t);" ";v0$(R(i1,1));" ";v0$(R(j1,1));" ";v0$(R(i1,jd+1))t=(e1-e12)*S*C:R(i1,2)=R(i1,2)+t:R(j1,2)=R(j1,2)+t:R(i1,jd+2)=-1*t:R(i2,jd)=-1*t'#t v0$(t);" ";v0$(R(i1,2));" ";v0$(R(j1,2));" ";_' v0$(R(i1,jd+2));" ";v0$(R(i2,jd));" ";t=e6*S:R(i1,3)=R(i1,3)-t:R(j1,3)=R(j1,3)+t:R(i1,jd+3)=-1*t:R(i1+2,jd-1)=t'#t v0$(t);" ";v0$(R(i1,3));" ";v0$(R(j1,3));" ";_' v0$(R(i1,jd+3));" ";v0$(R(i1+2,jd-1));" ";

t=e1*S^2+e12*C^2:R(i2,1)=R(i2,1)+t:R(j2,1)=R(j2,1)+t:R(i2,jd+1)=-1*t'#t v0$(t);" ";v0$(R(i2,1));" ";v0$(R(j2,1));" ";v0$(R(i2,jd+1));" ";t=e6*C:R(i2,2)=R(i2,2)+t:R(j2,2)=R(j2,2)-t:R(i2,jd+2)=t:R(i1+2,jd)=-1*t'#t v0$(t);" ";v0$(R(i2,2));" ";v0$(R(j2,2));" ";_' v0$(R(i2,jd+2));" ";v0$(R(i1+2,jd));" ";t=2*e2:R(i1+2,1)=R(i1+2,1)+t:R(j1+2,1)=R(j1+2,1)+t:R(i1+2,jd+1)=0.5*t'#t v0$(t);" ";v0$(R(i1+2,1));" ";v0$(R(j1+2,1));" ";v0$(R(i1+2,jd+1))NEXT n'----------------------------input #d, a$ 'APOYOS y coeficientes de coaccionFOR n = 1 TO Nap 'bucle a los apoyos input #d, t$ :gosub [datos.iniciales] na=val(dato$(1)) 'Nudo de apoyo i=3*(na-1)+1 'Filas a modificar for m=1 to 3 cA(m)=val(dato$(m+1)) 'coeficientes elasticos de apoyo if cA(m)<>1 then if cA(m)=0 then R(i+m-1,1)=1E20 else R(i+m-1,1)=R(i+m-1,1)+cA(m) end ifnext:next'----------------------------input #d,a$ 'Fuerzas en NUDOSFOR h=1 TO Nhiinput #d,a$ 'hip. hFOR n=1 to f.n.h(h) input #d,t$:gosub [datos.iniciales] nn=val(dato$(1)) 'Nudo cargado nn f=3*(nn-1)+1 'componente horiz. de la fuerza, vert. y mom. F(f,h) =val(dato$(2))*CeF 'f=contador correlativo para F(f+1,h)=val(dato$(3))*CeF 'introducir fuerzas en la matriz F(f+2,h)=val(dato$(4))*CeL*CeF if abs(F(f+1,h))>10^20 then F(f+1,h)=F(f+1,h)*CeLnext:next'----------------------------------m=mNbc2dim P.u(Nba,m),a.u(Nba,m),b.u(Nba,m),t.u(Nba,m),N.c(Nba)dim n.i2(m), n.j2(m),qq(m,6),aa(m,6),bb(m,6),angu(m,6)'----------------------------------input #d, a$ ' CARGAS EN BARRASfor h = 1 to Nhi input #d, a$ ' hipotesis if Nbc2(h)>0 then ' si hay barras cargadas gosub [CargasBarras] for n=1 to Nba if n.c1(n,h)>0 then ax.i=0:ct.i=0:fl.i=0:ax.j=0:ct.j=0:fl.j=0 gosub [cosenos] gosub [Esfu.Empotr] ' Calculo esfuerzos empotr. '****************** F(i1,h)=F(i1,h)-ax.i*cosa+ct.i*sena F(j1,h)=F(j1,h)+ax.j*cosa-ct.j*sena F(i2,h)=F(i2,h)-ax.i*sena-ct.i*cosa F(j2,h)=F(j2,h)+ax.j*sena+ct.j*cosa F(i1+2,h)=F(i1+2,h)-fl.i F(j1+2,h)=F(j1+2,h)-fl.j end if next end ifnext'-------------------------------------goto [finmatriz] 'de rigidez#t "Modulo de Young E = ";mYoung 'E

Page 9: porti_29

#t "Coeficientes para formar la matriz de rigidez"#t " n i j L cosa sena A I EA/L 2EI/L";_ " 4EI/L 6EI/L^2 12EI/L^3 aC^2+eS^2 (a-e)SC dS aS^2+eC^2 dC "#t " C S a b ";_ " c d e f g h k m "

for n=1 to Nba gosub [cosenos] #t d0$(n);" ";d0$(i);" ";d0$(j);" ";d2$(L);" ";d3$(cosa);" ";d3$(sena);" ";_ d4$(Are);" ";d6$(Ine);" ";v0$(e1);" ";v0$(e2);" ";v0$(e4);" ";v0$(e6);" ";_ v0$(e12);" ";v0$(e1*cosa^2+e12*sena^2);" ";v0$((e1-e12)*cosa*sena);" ";_ v0$(e6*sena);" ";v0$(e1*sena^2+e12*cosa^2);" ";v0$(e6*cosa)next#t ""goto [finmatriz]#t "Matriz de rigidez" 'Grabado por filas de la matrizaaa$= " des.X des.Y Giro": aa$="": bb$=""for ff=1 to Nsb/3 aa$=aa$+aaa$ bbb$=str$(ff)+" "+str$(ff)+" "+str$(ff)+" ":bb$=bb$+bbb$next

#t " ";:for ff=1 to Nsb: #t " ";d0$(ff);:next#t ""#t " Nu ";bb$#t "Ec ";aa$FOR n=1 TO Nec kk=int((n-1)/3)+1 if (n-1) mod 3 =0 then aa$="Fx" if (n-1) mod 3 =1 then aa$="Fy" if (n-1) mod 3 =2 then aa$="Mo" #t d0$(n);" ";d0$(kk);" ";aa$;" "; 'rigidez y terminos independientes FOR m=1 TO Nsb if R(n,m)<10^6 then #t v0$(R(n,m)); if R(n,m)>10^3 then #t s2$(F(n,h)); if F(n,h)>=10^6 or F(n,h)<-10^3 then #t eee$(F(n,h)); NEXT #t "" IF (n mod 3)*3=n THEN #t ""NEXT[finmatriz]' ------------------------------#t,"CALCULO DE DESPLAZAMIENTOS, MOMENTOS, CORTANTES Y AXILES:"FOR n=1 TO Nec-1 'Triangulacion.IF ((n+1)mod 3)*3=n+1 THEN #t USING ("####", n);FOR m=2 TO Nsb 'Fila n se resta de sgtes fi=n+m-1 'Fila a la que se resta la n IF fi<=Nec AND R(n,m)<>0 THEN fac=R(n,m)/R(n,1) :k=1 'Factor que multiplica la fila n FOR l=m TO Nsb: R(fi,k)=R(fi,k)-fac*R(n,l): k=k+1: NEXT FOR h=1 TO Nhi: F(fi,h)=F(fi,h)-fac*F(n,h): NEXT END IFnext:nextFOR n=Nec TO 1 STEP -1 'Sustitucion hacia atrasFOR h=1 TO Nhi sum=0 FOR m=2 TO Nsb fi=n+m-1: if fi<= Nec then sum=sum+R(n,m)*F(fi,h) next F(n,h)=(F(n,h)-sum)/R(n,1)next:next'********

close #d'****************************************CALCULA Y GRABA RESULTADOS[plAA]if pp$="" then gosub [noti]OPEN fff$ FOR INPUT AS #d'2ª LECTURA de datos para calculo de esfuerzos de empotr. en barrainput #d,a$,a$ 'tit$,mat$ UeF$ UeL$input #d,a$:for n=1 to Nbt:input #d,a$:next 'co ba al forma$input #d,a$:for n=1 to Nnu:input #d,a$:next 'nº y coordenadas de nudosinput #d,a$:for n=1 to Nba:input #d,a$:next 'extremos y tipo de barrainput #d,a$:for n=1 to Nap:input #d,a$:next 'apoyos na,cA()if calculo=1 then #t "":#t pp$:#t "" #t "Nudos Barras Difmax Hipot. Mod.Young Uni.e.Fuer Uni.e.Lon." #t d0$(Nnu);" ";d0$(Nba);" ";d0$(Ndi);" ";d0$(Nhi);" ";_ o0$(mYoung);" ";UeF$;" ";d3$(CeF);" ";UeL$;" ";d3$(CeL)end if '--------------------------------------- input #d, a$ 'Fuerzas en nudos dim qx(Nnu,Nhi), qy(Nnu,Nhi), mf(Nnu,Nhi) for h=1 to Nhi input #d, a$ 'hipotesis h if f.n.h(h)>0 then for n=1 to f.n.h(h) 'bucle a los nudos cargados input #d,t$:gosub [datos.iniciales] a=val(dato$(1)) 'a = numero del nudo cargado qx(a,h)=val(dato$(2))*CeF qy(a,h)=val(dato$(3))*CeF mf(a,h)=val(dato$(4))*CeL*CeF if qy(a,h)>10^20 then qy(a,h)=qy(a,h)*CeL/10^20 next end if next h '****************************************[plotA] 'PRESENTACION DE CALCULOS Y GRAFICOSif propi(14)=1 then #a.grufPu , "!contents? gru.fPu" #a.gruAbIz , "!contents? gruAbIz" #a.gruArDe , "!contents? gruArDe" #a.grueje , "!contents? gru.eje"end if

if pp$="" then gosub [noti]if planta=1 then #1.esca, "!contents? e"#1.eF , "!contents? e.q"#1.eM , "!contents? e.M"#1.eC , "!contents? e.C"#1.eA , "!contents? e.A"#1.Sepa,"!contents? spa"

input #d, a$

FOR h=1 TO Nhiinput #d, a$gosub [CargasBarras]'*******************lin$="--------------------------------------------------------------------------------"if calculo=1 then if opc$="d" then print #3, "hipotesis ";h #t ""

Page 10: porti_29

#t " HIPOTESIS NUM."; h #t lin$ #t " Coordenadas DESPLAZAMIENTOS DE NUDOS Fuerzas en nudos" #t " Nudo x y Direc. x Direc. y Giro Fx Fy Mf" #t " ";lo$;" ";lo$;" ";lo$;" ";lo$;_ " rad. Grados ";fu$;" ";fu$;" ";lo$+fu$ #t lin$ i=1 FOR n=1 TO Nnu if qy(n,h)>-1000 then per$=d2$(qy(n,h))+" " else per$= eee$(qy(n,h))+" " #t, d0$(n.nu(n));" ";q2$(x(n)*CsL);" ";q2$(y(n)*CsL);" ";d5$(F(i,h)*CsL);" ";_ d5$(F(i+1,h)*CsL);" ";d5$(F(i+2,h));" ";t3$(F(i+2,h)*360/2/pi);" ";_ t2$(qx(n,h)*CsF) ;" ";per$;t2$(mf(n,h)*CsL*CsF) i=i+3 NEXT #t "" #t "" #t " HIPOTESIS NUM."; h #t lin$ #t " ESFUERZOS EN BARRAS" #t " i j tB Axil i Corte.i Momto.i Axil j Corte.j Momto.j m.centro" #t " ";fu$;" ";fu$;" ";lo$+fu$;" ";_ fu$;" ";fu$;" ";lo$+fu$;" ";lo$+fu$ #t lin$ dim esfu$(Nba),flector.i(Nba),flector.j(Nba),cortant.i(Nba),cortant.j(Nba) dim axiles.i(Nba),axiles.j(Nba) dim flec.i(Nba,Nhi),flec.j(Nba,Nhi),cort.i(Nba,Nhi),cort.j(Nba,Nhi) dim axil.i(Nba,Nhi),axil.j(Nba,Nhi)end if

FOR n =1 TO Nba ax.i=0:ct.i=0:fl.i=0:ax.j=0:ct.j=0:fl.j=0:m.iso=0:m.isos=0 gosub [cosenos] '************** x = F(j1 ,h)-F(i1 ,h) y = F(j1+1,h)-F(i1+1,h) z = F(j1+2,h)+F(i1+2,h) c = x*sena-y*cosa

axh= -1*e1*(x*cosa+y*sena) 'Axiles cth= e12*c+e6*z 'Cortante fih= (z+F(i1+2,h))*e2+c*e6 'Flector i fjh= (z+F(j1+2,h))*e2+c*e6 'Flector j '****************** IF Nbc2(h) > 0 THEN GOSUB [Esfu.Empotr] '******************ax.i=ax.i+axh: ax.j=ax.j+axh 'axilesif ax.i<0 then esfu$(n)="C" else esfu$(n)="T"ct.i=ct.i+cth: ct.j=ct.j+cth 'cortantesIf Ine>0 then fl.i=fl.i+fih: fl.j=fl.j+fjhfl.c=m.iso-(fl.i-fl.j)/2 'mf central =m.iso-semisuma de m.extremos

if calculo=1 then #t d0$(i);" ";d0$(j);" ";d0$(ntip);" ";f3$(ax.i*CsF);esfu$(n);" ";_ f3$(ct.i*CsF);" ";s3$(fl.i*CsL*CsF);" ";f3$(ax.j*CsF);esfu$(n);" ";_ f3$(ct.j*CsF);" ";s3$(fl.j*CsL*CsF);" ";s3$(fl.c*CsL*CsF) ';" ";_ 's2$(Iner(ntip)*10^8);" ";t2$(Area(ntip)*10^4);" ";forma$(ntip)end ifif opc$="d" then if abs(fl.i)<0.01 then fl.i=0

if abs(fl.c)<0.01 then fl.c=0 if abs(fl.j)<0.01 then fl.j=0 #3 q1$(fl.i): #3 q1$(fl.c): #3 q1$(fl.j): #3 "-"end ifflector.i(n)=fl.i :flector.j(n)=fl.jcortant.i(n)=ct.i :cortant.j(n)=ct.jaxiles.i(n) =ax.i :axiles.j(n) =ax.j

flec.i(n,h)=fl.i :flec.j(n,h)=fl.jcort.i(n,h)=ct.i :cort.j(n,h)=ct.jaxil.i(n,h)=ax.i :axil.j(n,h)=ax.jNEXT n

if calculo=1 then#t ""#t " i j sen(a) cos(a) a.a L Area Iner Vol T"#t lin$vol=0peso=0for n=1 to Nba gosub [cosenos] angu=(asn(sena))*180/pi

vol=vol+Are*L if mo.yo$="h" then peso.p=Are*L*2.4:peso=peso+peso.p:volu=Are*L if mo.yo$="a" then peso.p=L*pes/1000:peso=peso+peso.p:volu=pes #t d0$(i);" ";d0$(j);" ";d3$(sena);" ";d3$(cosa);" ";t2$(angu);" ";_ d2$(L);" ";q2$(Are*10^4);" ";v0$(Ine*10^8);" ";d3$(volu);" ";d3$(peso.p);" ";fma$nextif mo.yo$="h" then vol$=d3$(vol)if mo.yo$="a" then vol$=" "#t " ______________"#t " ";vol$;" ";d3$(peso)end if'+++++++++++++++++++++++++++++++++++++++++++++++'red brown yellow green blue darkpink'+++++++++++++++++++++++++++++++++++++++++++++++call comunesif h=1 then call opengM call opengA call opengF call opengC if moment=1 then moment=0:propi(7)=1:call closegM:call opengM if cortan=1 then cortan=0:propi(8)=1:call closegC:call opengC if axial =1 then axial =0:propi(9)=1:call closegA:call opengA if fuerza=1 then fuerza=0:propi(0)=1:call closegF:call opengF g1$="down ; size 1 ; backcolor white":gosub [g4] if planta=0 then w.w=WindowWidth:w.h=WindowHeight e.h=int(0.7*w.w/xmax): e.v=int(0.7*w.h/ymax) e=e.v:if e.h<e.v then e=e.h ' escala definitiva del dibujo e.inicial=e

if uno=0 then ' escala de las cargas q=e/20 if e.q=0 then e.q=q :#1.eF e.q if e.M=0 then e.M=q :#1.eM e.M if e.C=0 then e.C=q :#1.eC e.C if e.A=0 then e.A=q/2:#1.eA e.A end if planta=1

Page 11: porti_29

end ifend if#1.esca ee.q=e.q/CsFgru=gru.eje/2

uno=1

gosub [desplaNu]if h=1 then gosub [desplaLo]gosub [desplaPN]gosub [desplaMi]gosub [desplaPB]Movi=0goto [desplaFin]'next h'goto[final]'...............[origen] d.i=desplazaH +e*(xmax-xmin+4)*(h-1) d.s=desplazaV +e*(ymax-ymin) 'comienzo en y de aba a arr for n=1 to Nba if ii=n.i(n) and jj=n.j(n) then n.Barra=n:n=Nba' exit for ' nextreturn'...................................................[desplaNu]'*********gosub [origen]g1$="font " ;nudo$ :gosub [g4]g1$="color ";color.nudos$ :gosub [g4]if n.nudo>200 and n.nudo<300 then veces=veces+1:no.nudo(veces)=n.nudo-200if n.nudo>300 then n.nudo=n.nudo-300: veces=veces-1for n=1 to Nnu for m=1 to 2 if andres=0 then sepaNu(n,m)=22+gru+desNut(n,m) if (n=n.nudo or andres=0) or n.nudo=111 then desNut(n,m)=desNut(n,m)+desNu(m) desNu2(n,m)=desNu(m) sepaNu(n,m)=sepaNu(n,m)+desNu2(n,m) end if next

if n.nudo=112 then [noNu] g1$="place ";d.i+e*x(n)-sepaNu(n,1);" ";_ d.s-e*y(n)+sepaNu(n,2):gosub [g4] for vez=1 to veces if n=no.nudo(vez) then antonio=1 next

if antonio<>1 then g1$="\ ";n;" ":gosub [g4] antonio=0:if n.nudo>200 then n.nudo=0 [noNu] if noNu=1 then g1$="\ ";chr$(0);chr$(0):gosub [g4]next n

for m=1 to 2:desNu(m)=0:nextreturn'..............................'texto de longi. de barras[desplaLo]'*********gosub [origen]altura=val(right$(fo.long$,2))

#g "font " ;fo.long$ #g "color ";color.longitu$

if ii>200 and ii<300 then veces=veces+1:no.ii(veces)=ii-200if ii>300 then ii=ii-300: veces=veces-1for n=1 to Nba gosub [cosenos] for m=1 to 2 if andres=0 then sepaLo(n,m)=0+desLot(n,m) if n=n.Barra or ii=111 then desLot(n,m)=desLot(n,m)+desLo(m) desLo2(n,m)=desLo(m) sepaLo(n,m)=sepaLo(n,m)+desLo2(n,m) end if next

if n.nudo=113 then [noLo] #g "place ";d.i+e*(x(i)+x(j))/2+sepaLo(n,1)+1*e*cosa;" ";_ d.s-e*(y(i)+y(j))/2+sepaLo(n,2)-(altura+gru/2)*10/6*cosa

for vez=1 to veces if i=no.ii(vez) then antonio=1 next if antonio<>1 then #g "\ ";" (";d2$(L);" m) " antonio=0:if n.ii>200 then ii=0 [noLo]next nfor m=1 to 2:desLo(m)=0:nextreturn' ..............................' TEXTOS DE LAS FUERZAS EN NUDOS' ******************************[desplaPN]gosub [origen]for n = 1 TO Nnu altura=10 qx=qx(n,h)*CsF : qy=qy(n,h)*CsF : x=d.i+e*x(n) : y=d.s-e*y(n) #g "color ";color.puntual$ #g "font " ;F.pu$

if qy<>0 then f.v.n=qy: if abs(f.v.n)>10^10 then f.v.n=f.v.n/10^20 'asiento en apoyo for m=1 to 2 if andres=0 then sepaPNy(n,m)=0 + desPNyt(n,m) if n=n.nudo or andres=0 or n.nudo=111 then desPNyt(n,m)=desPNyt(n,m)+desPNy(m) desPNy2(n,m)=desPNy(m) sepaPNy(n,m)=sepaPNy(n,m)+desPNy2(n,m) end if next if n.nudo=115 then [noPNy] #g "place ";x+gru+sepaPNy(n,1);" ";_ y+gru+sepaPNy(n,2)+altura #g "\";t2$(f.v.n) [noPNy] end if

if qx<>0 then for m=1 to 2 if andres=0 then sepaPNx(n,m)=gru + desPNxt(n,m) if n=n.nudo or andres=0 or n.nudo=111 then desPNxt(n,m)=desPNxt(n,m)+desPNx(m)

Page 12: porti_29

desPNx2(n,m)=desPNx(m) sepaPNx(n,m)=sepaPNx(n,m)+desPNx2(n,m) end if next if n.nudo=114 then [noPNx] #g "place ";x+sepaPNx(n,1);" ";y+sepaPNx(n,2) #g "\";t2$(qx) [noPNx] end ifNEXTfor m=1 to 2:desPNy(m)=0:desPNx(m)=0:nextreturn'..................[desplaMi]gosub [origen]for n=1 to Nba gosub [cosenos] fl.i=e.M*flec.i(n,h): fl.j=e.M*flec.j(n,h) ct.i=escaC*cort.i(n,h): ct.j=escaC*cort.j(n,h) ax.i=e.A*axil.i(n,h): ax.j=e.A*axil.j(n,h) xi=d.i+e*x(i):yi=d.s-e*y(i):di.x=abs(x(j)-x(i)) xj=d.i+e*x(j):yj=d.s-e*y(j):di.y=abs(y(j)-y(i)) x2=(xi+xj)/2 g1$="size 1 ; color ";color.aba.izq$:gosub [g4]'.....................................'MOMENTO abajo e izquierda (verde) altura=8 sepa=-1*e*di.y/2 - 0.7*altura*signo(yj-yi) sepaM(1)=0:sepaM(2)=0:if di.x<di.y then sepaM(1)=gru:sepaM(2)=sepa #gM "font ";mome$

for m=1 to 2 if andres=0 then sepaMi(n,m)=sepaM(m)+desMit(n,m) if n=n.Barra or ii=111 then desMit(n,m)=desMit(n,m)+desMi(m) desMi2(n,m)=desMi(m) sepaMi(n,m)=sepaMi(n,m)+desMi2(n,m) end if next yii=max(yj,yi) #gM "place ";xi-fl.i*sena+sepaMi(n,1);" ";yi-fl.i*cosa+sepaMi(n,2) if di.x<di.y then #gM "place ";x2+sepaMi(n,1);" ";yii+sepaMi(n,2) if abs(flec.i(n,h))>0.1 then #gM "\ ";t2$(flec.i(n,h));" " '...........................................'CORTANTE abajo e izquierda #gC "font ";cort$ sepaC(1)=0:sepaC(2)=0:if di.x<di.y then sepaC(1)=gru:sepaC(2)=sepa for m=1 to 2 if andres=0 then sepaCi(n,m)=sepaC(m)+desCit(n,m) if n=n.Barra or ii=111 then desCit(n,m)=desCit(n,m)+desCi(m) desCi2(n,m)=desCi(m) sepaCi(n,m)=sepaCi(n,m)+desCi2(n,m) end if next #gC "place ";xi-ct.i*sena+sepaCi(n,1);" ";yi-ct.i*cosa+sepaCi(n,2) if di.x<di.y then #gC "place ";x2+sepaCi(n,1);" ";yii+sepaCi(n,2) if abs(cort.i(n,h))>0.1 then #gC "\ ";t2$(cort.i(n,h));" " '..........................................'AXIL abajo e izquierda #gA "font ";axia$ sepaA(1)=0:sepaA(2)=0:if di.x<di.y then sepaA(1)=gru:sepaA(2)=sepa for m=1 to 2 if andres=0 then sepaAi(n,m)=sepaA(m)+desAit(n,m) if n=n.Barra or ii=111 then

desAit(n,m)=desAit(n,m)+desAi(m) desAi2(n,m)=desAi(m) sepaAi(n,m)=sepaAi(n,m)+desAi2(n,m) end if next #gA "place ";xi-ax.i*sena+sepaAi(n,1);" ";yi-ax.i*cosa+sepaAi(n,2) if di.x<di.y then #gA "place ";x2+sepaAi(n,1);" ";yii+sepaAi(n,2) if abs(axil.i(n,h))>2 then #gA "\ ";q2$(axil.i(n,h));" "'.......................................'.......................................'MOMENTO arriba y derecha (rosa) g1$="size 1 ; color ";color.arr.der$ :gosub [g4] yjj=min(yi,yj) if di.x<di.y then sepaM(2)=-1*sepa for m=1 to 2 if andres=0 then sepaMj(n,m)=sepaM(m)+desMjt(n,m) if n=n.Barra or jj=111 then desMjt(n,m)=desMjt(n,m)+desMj(m) desMj2(n,m)=desMj(m) sepaMj(n,m)=sepaMj(n,m)+desMj2(n,m) end if next #gM "place ";xj+fl.j*sena+sepaMj(n,1)-(30+gru);" ";yj+fl.j*cosa+sepaMj(n,2) if di.x<di.y then #gM "place ";x2+sepaMj(n,1);" ";yjj+sepaMj(n,2) if abs(flec.j(n,h))>0.1 then #gM "\ ";t2$(flec.j(n,h));" " '......................................'CORTANTE arriba y derecha for m=1 to 2 if andres=0 then sepaCj(n,m)=sepaC(m)+desCjt(n,m) if n=n.Barra or jj=111 then desCjt(n,m)=desCjt(n,m)+desCj(m) desCj2(n,m)=desCj(m) sepaCj(n,m)=sepaCj(n,m)+desCj2(n,m) end if next #gC "place ";xj-ct.j*sena+sepaCj(n,1);" ";yj-ct.j*cosa-sepaCj(n,2) if di.x<di.y then #gC "place ";x2+sepaCj(n,1);" ";yjj-sepaCj(n,2) if abs(cort.j(n,h))>0.1 then #gC "\ ";t2$(cort.j(n,h));" "'.......................................'AXIL arriba y derecha if di.x>di.y then sepaA(1)=-4*altura for m=1 to 2 if andres=0 then sepaAj(n,m)=sepaA(m)+desAjt(n,m) if n=n.Barra or jj=111 then desAjt(n,m)=desAjt(n,m)+desAj(m) desAj2(n,m)=desAj(m) sepaAj(n,m)=sepaAj(n,m)+desAj2(n,m) end if next #gA "place ";xj-ax.j*sena+sepaAj(n,1);" ";yj-ax.j*cosa-sepaAj(n,2) if di.x<di.y then #gA "place ";x2+sepaAj(n,1);" ";yjj-sepaAj(n,2) if abs(axil.j(n,h))>2 then #gA "\ ";q2$(axil.j(n,h));" " '....next n'......for m=1 to 2 desMi(m)=0:desMj(m)=0 desCi(m)=0:desCj(m)=0 desAi(m)=0:desAj(m)=0nextreturn' *******************************************' CARGAS EN BARRAS' ****************[desplaPB]

Page 13: porti_29

gosub [origen]

for n=1 to NbaPy.old=0 gosub [cosenos] '************** xd=e*(x(j)-x(i))/L 'factor proporcional de la componente x de la distancia yd=e*(y(j)-y(i))/L 'idem de y x=e*x(i)+d.i : y=d.s-e*y(i)

for p=1 to n.c1(n,h) 'bucle al numero de cargas en cada barra P.u=P.u(n,p)*CsF

' if abs(P.u)>0 then a=a.u(n,p) : b=b.u(n,p) :tu=t.u(n,p)

f=8 'componentes x e y de la linea f Px=-1*e.q*P.u*cos(tu*g.r) 'componente x de la carga girada un angulo tu Py=-1*e.q*P.u*sin(tu*g.r) 'idem de y Xa=x+a*xd : Ya=y-a*yd '..................... 'Cargas puntuales if a>0 and b=0 then 'valor de la carga puntual en barra #g "color ";color.puntual$ for m=1 to 2 if andres=0 then sepaPB(n,m)=0+desPBt(n,m)

if Movi=5 and (n=n.Barra or ii=111) then desPBt(n,m)=desPBt(n,m)+desPB(m) desPB2(n,m)=desPB(m) sepaPB(n,m)=sepaPB(n,m)+desPB2(n,m) end if next #g "place ";Xa+sepaPB(n,1);" ";Ya+val(right$(F.pu$,2))+gru+sepaPB(n,2) if P.u>0 then #g "font ";F.pu$ : #g "\";t2$(P.u) end if'--------------------------

' if ii=111 then #1.ndv desUB(1) 'Cargas uniformes if b>0 then #g "color ";color.valorFu$ 'valor de la carga uniforme

for m=1 to 2 if andres=0 then sepaUB(n,m)=0 + desUBt(n,m)

if Movi=6 and (n=n.Barra or ii=111) then desUBt(n,m)=desUBt(n,m)+desUB(m) desUB2(n,m)=desUB(m) sepaUB(n,m)=sepaUB(n,m)+desUB2(n,m) ' #t m;" ";p;" ";n;" ";n.Barra;" ";sepaUB(n,1);" ";ii;" ";jj end if nextif Nhi=1 then pete=0if Nhi>1 thenif h=1 then pete=0 pete=6end if

if (andres=0 or Movi=0 or Movi=pete) then

XXX(n,p)=x+(a+b/2)*xd+Px/2+si(tu)*f ' YYY(n,p)=y-(a+b/2)*yd-Py-Py.old YYY(n,p)=y-Py-Py.old

UUU(n,p)=P.u(n,p)*CsF end if

' if n=n.Barra then #t YYY(n,1)+sepaUB(n,2) ' if n=n.Barra then #t YYY(n,p)+sepaUB(n,2) ' if n=n.Barra then #t Py.old

#g "place ";XXX(n,p) + sepaUB(n,1);" ";YYY(n,p)+sepaUB(n,2)

#g "font ";F.un$ #g "\ ";t2$(UUU(n,p))

end if

Py.old=Py Px.old=Px

next p

next n

for m=1 to 2:desPB(m)=0:desUB(m)=0:next

return'.........................................[desplaFin]'Movi=0noNu=0'.........................................' DIBUJOS DE LAS BARRAS'.........................................'if h=3 then

For n=1 to Nba gosub [cosenos] g1$="size " ;str$(gru.eje):gosub [g4] g1$="color ";color.barras$:gosub [g4] if Area(t.b(n))>0 then g1$="line ";d.i+e*x(i);" ";d.s-e*y(i);" ";d.i+e*x(j);" ";d.s-e*y(j) gosub [g4] end ifnext' ..............................' DIBUJO DE LAS FUERZAS EN NUDOS' ******************************for n = 1 TO Nnu qx=qx(n,h)*CsF : qy=qy(n,h)*CsF : x=d.i+e*x(n) : y=d.s-e*y(n) si=5*signo(qy) f.v.n=qy: if abs(f.v.n)>10^10 then f.v.n=100*f.v.n/10^20 'asiento #g "size " ;gru.fPu #g "color ";color.puntual$ if qy<>0 then #g "line ";x;" ";y;" ";x;" ";y +e.q*f.v.n 'fu. vertical en nudo #g "line ";x-5;" ";y+si;" ";x;" ";y #g "goto ";x+5;" ";y+si end if

Page 14: porti_29

if qx<>0 then si=-5*signo(qx) #g "line ";x ;" ";y ;" ";x-e.q*qx;" ";y 'fu. horizontal en nudo #g "line ";x+si;" ";y-5;" ";x ;" ";y #g "goto ";x+si;" ";y+5 end ifNEXT

'...........................'DIBUJO DE LA CARGA EN BARRA'***************************for n=1 to Nba Px.old=0:Py.old=0:subida=0 #g "size 1" gosub [cosenos] xd=e*(x(j)-x(i))/L 'factor proporcional para la componente x de una distancia yd=e*(y(j)-y(i))/L 'idem de y x=e*x(i)+d.i : y=d.s-e*y(i) 'distancia=0 for m=1 to n.c1(n,h) 'bucle al numero de cargas en cada barra P.u=P.u(n,m)*CsF if P.u>0 then a=a.u(n,m) : b=b.u(n,m) :tu=t.u(n,m) f=8 'componentes x e y de la linea f co1=f*cos((tu+45)*g.r): se1=f*sin((tu+45)*g.r) 'girada 45º mas que la carga co2=f*cos((tu-45)*g.r): se2=f*sin((tu-45)*g.r) 'idem menos que la carga

Px=-1*e.q*P.u*cos(tu*g.r) 'componente x de la carga girada un angulo tu Py=-1*e.q*P.u*sin(tu*g.r) 'idem de y

Xa=x+a*xd : Ya=y-a*yd if a>0 and b=0 then 'puntas de flecha de carga puntual en barra #g "size ";gru.fPu #g "color ";color.puntual$ #g "line ";Xa;" ";Ya;" ";Xa-co1;" ";Ya+se1 #g "line ";Xa;" ";Ya;" ";Xa-co2;" ";Ya+se2 end if

#g "color ";color.rayadoF$ if a>0 and b=0 then #g "color ";color.puntual$;" size ";gru.fPu if a>0 and b=0 then subida=0 else subida=Py.old 'carga en barra if a>0 and b=0 then lado =0 else lado =Px.old 'que es puntual si b=0 if a>0 and b>0 then subida=Py.old #g "place ";Xa+Px+lado;" ";Ya-Py-subida #g "goto " ;x+(a+b)*xd+Px+lado;" ";y-(a+b)*yd-Py-subida #g "goto " ;x+(a+b)*xd +lado;" ";y-(a+b)*yd -subida

if b>0 then 'rallado de la carga continua nd.p=10*b/spa for ralla=0 to nd.p disX=-1*b*xd*ralla/nd.p+(m-1)/2 disY=-1*b*yd*ralla/nd.p+(m-1)/2 #g "place ";Xa-disX +Px.old;" ";Ya+disY -Py.old :#g "circle ";2 #g "goto " ;Xa-disX+Px+Px.old;" ";Ya+disY-Py-Py.old next #g "place ";x+(a+b)*xd+Px.old;" ";y-(a+b)*yd-Py.old :#g "circle ";2 end if end if Px.old=Px Py.old=subida+Py next m

r=0.2 if Ine=0 then g1$="size ";2 :gosub [g4] g1$="color black ; backcolor pink" :gosub [g4] g1$="place " ;x+ r*xd;" ";y-r*yd :gosub [g4] g1$="circlefilled "; r*e :gosub [g4] g1$="place ";x+(L-r)*xd;" ";y-(L-r)*yd:gosub [g4] g1$="circlefilled "; r*e :gosub [g4] end if g1$="color red ; backcolor white" :gosub [g4]next n'............................'MOMENTOS, CORTANTES Y AXILES uno=1'............................................'oooooooooooooooooooooooooooooooooooooooooooo dibujo croquisFOR n=1 TO Nba gosub [cosenos] P.u=P.u(n,1) fl.i=e.M*flector.i(n): fl.j=e.M*flector.j(n) ct.i=e.C*cortant.i(n): ct.j=e.C*cortant.j(n) ax.i=e.A*axiles.i(n) : ax.j=e.A*axiles.j(n) '........................................ xi=d.i+e*x(i) : yi=d.s-e*y(i) xj=d.i+e*x(j) : yj=d.s-e*y(j) g1$="size ";gruAbIz :gosub [g4] g1$=" color ";color.aba.izq$ :gosub [g4] 'valores en nudo abajo e izquierda

#gM "line ";xi;" ";yi;" ";xi-fl.i*sena;" ";yi-fl.i*cosa #gC "line ";xi;" ";yi;" ";xi-ct.i*sena;" ";yi-ct.i*cosa #gA "line ";xi;" ";yi;" ";xi-ax.i*sena;" ";yi-ax.i*cosa '................................... linea que une los valores en los nudos g1$="size 1 ;color red" :gosub [g4] '#gM "line ";xj+fl.j*sena;" ";yj+fl.j*cosa;" ";xi-fl.i*sena;" ";yi-fl.i*cosa '#gC "line ";xj-ct.j*sena;" ";yj-ct.j*cosa;" ";xi-ct.i*sena;" ";yi-ct.i*cosa '#gA "line ";xj-ax.j*sena;" ";yj-ax.j*cosa;" ";xi-ax.i*sena;" ";yi-ax.i*cosa '.......................................... nd.p=10*L/spa distancia=0 for m=0 to nd.p xx=xi-fl.i*sena-(xi-fl.i*sena-(xj+fl.j*sena))/nd.p*m yy=yi-fl.i*cosa-(yi-fl.i*cosa-(yj+fl.j*cosa))/nd.p*m xC=xi-ct.i*sena-(xi-ct.i*sena-(xj-ct.j*sena))/nd.p*m yC=yi-ct.i*cosa-(yi-ct.i*cosa-(yj-ct.j*cosa))/nd.p*m xA=xi-ax.i*sena-(xi-ax.i*sena-(xj-ax.j*sena))/nd.p*m yA=yi-ax.i*cosa-(yi-ax.i*cosa-(yj-ax.j*cosa))/nd.p*m xF=xi+(xj-xi)/nd.p*m yF=yi+e.q*P.u*cosa-(yi-yj)/nd.p*m

'division de la linea anterior en nd.p partes iguales '#gM "place " ;xx;" ";yy : #gM "color red " : #gM "circle ";2 '#gC "place " ;xC;" ";yC : #gC "color red " : #gC "circle ";2 '#gA "place " ;xA;" ";yA : #gA "color red " : #gA "circle ";2 'if P.u<>0 then ' #g "place " ;xF;" ";yF : #g "color ";color.rayadoF$ : #g "circle ";2 ' #g "goto " ;xF;" ";yF-P.u*e.q*cosa 'end if

m.isos=0c.isos=0a.isos=0 FOR q=1 TO n.c1(n,h) ' bucle a las cargas en barras

Page 15: porti_29

gosub [cosenos] P =P.u(n,q):a=a.u(n,q):b=b.u(n,q):tu=t.u(n,q) if b=0 then itc=1 ' carga puntual if a=0 and b=0 then b =abs(L): b.u(n,q)=b' carga uniforme en toda la viga if b>0 then itc=2 ' carga uniforme

sent=SIN(tu*g.r) : cost=COS(tu*g.r) COS.E=sent*sena+cost*cosa SEN.E=cost*sena-sent*cosa Pn= P*SEN.E ' Componente normal Pt=-1*P*COS.E ' " tangencial

l.h=abs(L*SEN.E) a.h=abs(a*SEN.E) b.h=abs(b*SEN.E) dis=l.h*m/nd.p ' ------------------------------------------MOMENTOS Carga puntual if itc=1 then R.i=Pn*(l.h-a.h)/l.h if dis<= a.h then m.isos=m.isos+e.M*R.i*dis if dis> a.h then m.isos=m.isos+e.M*(R.i*dis-Pn*(dis-a.h)) '.........................................CORTANTES y AXILES if right$(forma$(t.b(n)),1)<>"v" then if dis< a.h then c.isos=c.isos '+ct.i if dis>= a.h then c.isos=c.isos-e.C*Pn if dis< a.h then a.isos=a.isos if dis>= a.h then a.isos=a.isos-e.A*Pt end if

if right$(forma$(t.b(n)),1)="v" then if dis>=a.h then c.isos=c.isos-e.C*Pn if dis>=a.h then a.isos=a.isos-e.A*Pt end if end if'......if x(j)<x(i) then SEN.E=-1*SEN.Eif itc=2 then 'MOMENTO carga uniforme R.i=Pn*(b.h/l.h)*(l.h-a.h-b.h/2) if dis<=a.h then m.isos=m.isos+e.M* R.i*dis if dis>a.h and dis<=a.h+b.h then m.isos=m.isos+e.M*(R.i*dis-Pn*0.5*(dis-a.h)^2) if dis>a.h+b.h then m.isos=m.isos+e.M*(R.i*dis-Pn*b.h*(dis-a.h-b.h/2))'..............................................CORTANTE y AXIL carga uniforme if right$(forma$(t.b(n)),1)<>"v" then if dis<a.h then c.isos=c.isos if dis>=a.h and dis<=a.h+b.h then c.isos=c.isos+e.C*Pn*(dis-a.h)/SEN.E if dis>a.h+b.h then c.isos=c.isos+e.C*Pn*b.h/SEN.E if dis<a.h then a.isos=a.isos if dis>=a.h and dis<=a.h+b.h then a.isos=a.isos+e.A*Pt*(dis-a.h)/SEN.E if dis>a.h+b.h then a.isos=a.isos+e.A*Pt*b.h/SEN.E end if

if right$(forma$(t.b(n)),1)="v" then if dis>a.h and dis<=a.h+b.h then c.isos=c.isos-e.C*Pn*(dis-a.h) if dis>a.h+b.h then c.isos=c.isos-e.C*Pn*b.h if dis>a.h and dis<=a.h+b.h then a.isos=a.isos-e.A*Pt*(dis-a.h) if dis>a.h+b.h then a.isos=a.isos-e.A*Pt*b.h end ifend ifnext q'..............................................RAYADO #gM "size 1"

#gM "color ";color.rayadoM$ ;" size 1" : if m<1 then #gM "color white " #gC "color ";color.rayadoC$ ;" size 1" #gA "color ";color.rayadoA$ ;" size 1" #g "color ";color.rayadoF$ ;" size 1"

#gM "goto ";xx+m.isos*sena;" ";yy+m.isos*cosa

xC2=xi+(xj-xi)/nd.p*m yC2=yi+(yj-yi)/nd.p*m

'if abs(abs((xj-xi)/nd.p*m)-abs((xj-xi)/2))<=abs((xj-xi)/nd.p) then #gM "circle ";5 #gM "line ";xC2;" ";yC2;" ";xx+m.isos*sena;" ";yy+m.isos*cosa #gC "line ";xC2;" ";yC2;" ";xC2-ct.i*sena-c.isos*sena;" ";yC2-ct.i*cosa-c.isos*cosa if m>0 then #gC "goto ";xC2.o;" ";yC2.o #gA "line ";xC2;" ";yC2;" ";xC2-ax.i*sena-a.isos*sena;" ";yC2-ax.i*cosa-a.isos*cosa if m>0 then #gA "goto ";xA2.o;" ";yA2.o xC2.o=xC2-ct.i*sena-c.isos*sena:yC2.o=yC2-ct.i*cosa-c.isos*cosa xA2.o=xC2-ax.i*sena-a.isos*sena:yA2.o=yC2-ax.i*cosa-a.isos*cosa next m #gM "goto " ;xj+fl.j*sena;" ";yj+fl.j*cosa #gC "goto " ;xj-ct.j*sena;" ";yj-ct.j*cosa #gA "goto " ;xj-ax.j*sena;" ";yj-ax.j*cosa '00000000000000000000000000000000000000000

g1$="size ";gruArDe :gosub [g4] g1$="color ";color.arr.der$ :gosub [g4] 'valores derecha y arriba #gM "line ";xj;" ";yj;" ";xj+fl.j*sena;" ";yj+fl.j*cosa #gC "line ";xj;" ";yj;" ";xj-ct.j*sena;" ";yj-ct.j*cosa #gA "line ";xj;" ";yj;" ";xj-ax.j*sena;" ";yj-ax.j*cosa P.u(n,1)=0next n'.......................................

g1$="place ";d.i;" ";d.s+60 :gosub [g4] g1$="font ";fo.cara$ :gosub [g4] g1$="color ";color.car.Li1$ :gosub [g4] #g "\ ";"Esquema de CARGAS ACTUANTES" #gM "\ ";"Esquema de MOMENTOS FLECTORES" #gC "\ ";"Esquema de ESFUERZOS CORTANTES" #gA "\ ";"Esquema de ESFUERZOS AXILES" g1$="font ";fo.rest$ :gosub [g4] g1$="color ";color.car.Li2$ :gosub [g4] g1$="\ ";"Hipotesis ";h :gosub [g4] g1$= "| ";pp$ :gosub [g4] g1$="flush" :gosub [g4]'returnnext h'[final]if opc$="d" and dc2=1 then close #3close #dcalculo=0wait'..................................[g4] #g g1$:#gM g1$:#gC g1$:#gA g1$return'------------------------------------------------ FUERZASsub opengF'*********if propi(0)=0 then menu #g,"&File","&Nuevo",[nuevo],"&Guardar",[save],"&print(PDF)",[printIt]

Page 16: porti_29

menu #g,"Esquema","Fuerzas",[fuer],"Momento",[mome],"Cortante",[cort],"Axil",[axia] menu #g,"&Dibujo","&Box",[setForBox],"&Texto",[edTextF],"&Linea recta",[LineaF],_ "&Trazo libre",[LibreF],"&Grueso",[grueso],"&Color",[lineColor],"Esquema", [esquema] dim tipo$(15) open "Portico con ACCIONES" for graphics as #g #g "trapclose [closegF]":propi(0)=1else WindowHeight=DisplayHeight*0.95:#g "cls"end ifend sub[closegF] call closegF:waitsub closegF if propi(0)=1 then close #g: propi(0)=0end sub'---------------------------------------------------sub comunes UpperLeftX=DisplayWidth*2/3:WindowWidth=DisplayWidth/3 UpperLeftY=1:WindowHeight=DisplayHeight*0.95end sub'---------------------------------------------------------- MOMENTOSsub opengM'*********if propi(7)=0 then menu #gM,"&File","&Nuevo",[nuevoM],"&Guardar",[save],"&print(PDF)",[printItM] menu #gM,"Esquema","&Fuerzas",[fuer],"Momento",[mome],"Cortante",[cort],"Axil",[axia] menu #gM,"&Dibujo","&Box",[setForBox],"&Texto",[edTextM],"&Linea recta",[LineaM],_ "&Trazo libre",[LibreM],"&Grueso",[grueso],"&Color",[lineColor] dim tipo$(15) open "Portico con MOMENTOS" for graphics as #gM #gM "trapclose [closegM]":propi(7)=1else WindowHeight=DisplayHeight*0.95:#gM "cls"end ifend sub[closegM] call closegM :waitsub closegM if propi(7)=1 then close #gM: propi(7)=0end sub'------------------------------------------------------- CORTANTESsub opengC'*********if propi(8) = 0 then menu #gC,"&File","&Nuevo",[nuevoC],"&Guardar",[save],"&print(PDF)",[printItA] menu #gC,"Esquema","Fuerzas",[fuer],"Momento",[mome],"Cortante",[cort],"Axil",[axia] menu #gC,"&Dibujo","&Box",[setForBox],"&Texto",[edTextC],"&Linea recta",[LineaC],_ "&Trazo libre",[LibreC],"&Grueso",[grueso],"&Color",[lineColor] dim tipo$(15) open "Portico con ESFUERZOS CORTANTES" for graphics as #gC #gC "trapclose [closegC]":propi(8)=1else #gC "cls"end ifend sub[closegC] call closegC :waitsub closegC if propi(8)=1 then close #gC:propi(8)=0end sub'---------------------------------------------------------- AXILES

sub opengA'*********if propi(9)=0 then menu #gA,"&File","&Nuevo",[nuevoA],"&Guardar",[save],"&print(PDF)",[printItA] menu #gA,"Esquema","Fuerzas",[fuer],"Momento",[mome],"Cortante",[cort],"Axil",[axia] menu #gA,"&Dibujo","&Box",[setForBox],"&Texto",[edTextA],"&Linea recta",[LineaA],_"&Trazo libre",[LibreA],"&Grueso",[grueso],"&Color",[lineColor] dim tipo$(15) open "Portico con AXILES" for graphics as #gA #gA "trapclose [closegA]":propi(9)=1else#gA "cls"end ifend sub[closegA] call closegA :waitsub closegA if propi(9)=1 then close #gA: propi(9)=0end sub'nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn[nuevo] #g "cls":wait[nuevoM] #gM "cls":wait[nuevoC] #gC "cls":wait[nuevoA] #gA "cls":wait'----------------------------------------------'[save]filedialog "Save Drawing As","*.bmp",saveFile$if saveFile$="" then wait

if X<oMouseX then x1=X:x2=oMouseX else x1=oMouseX:x2=Xif Y<oMouseY then y1=Y:y2=oMouseY else y1=oMouseY:y2=Yselect case panta$ case "F" :#g "delsegment";" ";segId-1 : #g "redraw" #g "getbmp saver ";x1;" ";y1;" ";x2-x1;" ";y2-y1 case "M" :#gM "delsegment";" ";segId-1 : #gM "redraw" #gM "getbmp saver ";x1;" ";y1;" ";x2-x1;" ";y2-y1 case "C" :#gC "delsegment";" ";segId-1 : #gC "redraw" #gC "getbmp saver ";x1;" ";y1;" ";x2-x1;" ";y2-y1 case "A" :#gA "delsegment";" ";segId-1 : #gA "redraw" #gA "getbmp saver ";x1;" ";y1;" ";x2-x1;" ";y2-y1end selectbmpsave "saver",saveFile$unloadbmp "saver"segId=0wait'------------------------------[printIt] #g "print vga":wait[printItM] #gM "print vga":wait[printItC] #gC "print vga":wait[printItA] #gA "print vga":wait'................................[LineaF] panta$="F":goto [LINEAS][LineaM] panta$="M":goto [LINEAS][LineaC] panta$="C":goto [LINEAS][LineaA] panta$="A":goto [LINEAS]

[esquema] panta$="F" :goto [adLinea]

[LibreF] panta$="F" :goto [libre][LibreM] panta$="M" :goto [libre][LibreC] panta$="C" :goto [libre][LibreA] panta$="A" :goto [libre]

Page 17: porti_29

[libre] linea.libre=1:text$="":goto [adText]'................................[LINEAS]texto=0g1$= "size 1"g2$= "when leftButtonDown [startDraw]"g3$= "when leftButtonMove [firstLine]"g4$= "when leftButtonUp [finishLine]"g5$= "when rightButtonDown [borrarlinea]"

if texto=0 then select case panta$ case "F": #g g1$:#g g2$:#g g3$:#g g4$:#g g5$ case "M": #gM g1$:#gM g2$:#gM g3$:#gM g4$:#gM g5$ case "C": #gC g1$:#gC g2$:#gC g3$:#gC g4$:#gC g5$ case "A": #gA g1$:#gA g2$:#gA g3$:#gA g4$:#gA g5$ end selectend ifwait'.............................[borrarlinea] call borralinea:wait

sub borralinea global segId, panta$ select case panta$ case "F":#g "delsegment";" ";segId-1:#g "redraw":segId=segId-2 case "M":#gM "delsegment";" ";segId-1:#gM "redraw":segId=segId-2 case "C":#gC "delsegment";" ";segId-1:#gC "redraw":segId=segId-2 case "A":#gA "delsegment";" ";segId-1:#gA "redraw":segId=segId-2 end selectend sub'..............................[borrarTexto] call borraTexto : wait'..............................sub borraTexto global segId, panta$ select case panta$ case "F":#g "delsegment";" ";segId-1:#g "redraw":segId=segId-1 case "M":#gM "delsegment";" ";segId-1:#gM "redraw":segId=segId-1 case "C":#gC "delsegment";" ";segId-1:#gC "redraw":segId=segId-1 case "A":#gA "delsegment";" ";segId-1:#gA "redraw":segId=segId-1 end selectend sub'.................................[startDraw]if texto=0 then X=MouseX: Y=MouseYgosub [pla]select case panta$ case "F":#g pla$ case "M":#gM pla$ case "C":#gC pla$ case "A":#gA pla$end selectwait'..........[firstLine]if texto=0 thengosub [LM]g6$="when leftButtonMove [trackLine]"select case panta$ case "F":#g g6$:#g LM$

case "M":#gM g6$:#gM LM$ case "C":#gC g6$:#gC LM$ case "A":#gA g6$:#gA LM$end selectend ifoMouseY=MouseY :oMouseX=MouseXwait'...........[trackLine]if texto=0 then gosub [LM] LMo$="line ";str$(X);" ";str$(Y);" ";str$(oMouseX);" ";str$(oMouseY) gosub [pla] select case panta$ case "F" :#g "rule XOR":#g LMo$ :#g pla$:#g LM$ case "M" :#gM "rule XOR":#gM LMo$ :#gM pla$:#gM LM$ case "C" :#gC "rule XOR":#gC LMo$ :#gC pla$:#gC LM$ case "A" :#gA "rule XOR":#gA LMo$ :#gA pla$:#gA LM$ end selectend ifoMouseY=MouseY:oMouseX=MouseXwait[LM] LM$ ="line ";str$(X);" ";str$(Y);" ";str$(MouseX);" ";str$(MouseY)return[pla] pla$="place ";str$(X);" ";str$(Y)return'...........[finishLine]if texto=0 theng7$=" discard ; rule OVER"g8$="flush ; redraw"select case panta$ case "F" :#g g3$ :#g g7$ :#g LM$ :#g g8$ case "M" :#gM g3$ :#gM g7$ :#gM LM$ :#gM g8$ case "C" :#gC g3$ :#gC g7$ :#gC LM$ :#gC g8$ case "A" :#gA g3$ :#gA g7$ :#gA LM$ :#gA g8$end selectgosub [pepe]end ifwait'**************************************[pepe]g8$="flush ; redraw"select case panta$ case "F":#g "segment":input #g, segId:#g "\";:#g g8$ case "M":#gM "segment":input #gM,segId:#gM "\";:#gM g8$ case "C":#gC "segment":input #gC,segId:#gC "\";:#gC g8$ case "A":#gA "segment":input #gA,segId:#gA "\";:#gA g8$end selectreturn'-------------------------------------[setForBox] texto=0 #g "when leftButtonDown [startDraw]" #g "when leftButtonMove [firstFrame]" #g "when leftButtonUp [finishBox]"wait'-------------------------------------[lineas]data 15,"1","2","3","4","5","6","7","8","9","10","12","14","16","18","20"[colores]Data 13,"black","darkpink","darkblue" ,"darkgreen","darkred","darkgray"

Page 18: porti_29

Data "brown","darkcyan","lightgray","pink","cyan","white","red"

[grueso]restore [lineas] :a$="Grueso":gosub [comboCaja]:wait[lineColor]restore [colores]:a$="Color" :gosub [comboCaja]:wait'...................................................[comboCaja]if propi(10)=0 then propi(10)=1 for n=1 to 15:tipo$(n)="":next read ndd for n=1 to ndd:read c$:tipo$(n)=c$:next WindowWidth=190:WindowHeight=70 UpperLeftX =658:UpperLeftY=90 combobox #col.sel,tipo$(),[Selec],10,10,120,300 button #col.new,"Ok" ,[new],UL,140,10, 30, 24 Open a$ for dialog as #col '************************* #col "trapclose [closeCol]"end ifreturn'.....[Selec] #col.sel "selection? selec$"wait[closeCol] if propi(10)=1 then close #col :propi(10)=0wait'...................................................[new]if a$="Grueso" then size=val(selec$) select case panta$ case "F" :#g "size ";selec$ case "M" :#gM "size ";selec$ case "C" :#gC "size ";selec$ case "A" :#gA "size ";selec$ end selectend ifif a$="Color" then lineColor$=selec$ select case panta$ case "F" :#g "color ";selec$ case "M" :#gM "color ";selec$ case "C" :#gC "color ";selec$ case "A" :#gA "color ";selec$ end selectend ifgoto [closeCol]'........................................................[edTextF] panta$="F":prompt "TEXT>"; text$ :goto [adText] 'Edita el texto[edTextM] panta$="M":prompt "TEXT>"; text$ :goto [adText][edTextC] panta$="C":prompt "TEXT>"; text$ :goto [adText][edTextA] panta$="A":prompt "TEXT>"; text$ :goto [adText]'...................................................[libreF] panta$="F": goto [adText][libreM] panta$="M": goto [adText][libreC] panta$="C": goto [adText][libreA] panta$="A": goto [adText]

'...................................................[adText] select case panta$

case "F" : #g "when leftButtonDown [add]" case "M" : #gM "when leftButtonDown [add]" case "C" : #gC "when leftButtonDown [add]" case "A" : #gA "when leftButtonDown [add]" end selecttexto=0 :wait'**********************************************[add] dim pixel$(3000,8) texto=1 call SetDraw if lineColor$="" then lineColor$="black" color$=lineColor$ 'se toma el color del ultimo color de linea lineColor$ alt$="white" 'se fija el color de fondo de texto blanco startX = MouseX : startY=MouseY g1$= "color ";color$;" ;backcolor ";alt$ g2$= "font ";font$;" ";str$(size) select case panta$ case "F" :#g g1$ : #g g2$ #g "place ";MouseX;" ";MouseY: #g "|";text$ :#g "flush" case "M" :#gM g1$ : #gM g2$ #gM "place ";MouseX;" ";MouseY: #gM "|";text$ :#gM "flush" case "C" :#gC g1$ : #gC g2$ #gC "place ";MouseX;" ";MouseY: #gC "|";text$ :#gC "flush" case "A" :#gA g1$ : #gA g2$ #gA "place ";MouseX;" ";MouseY: #gA "|";text$ :#gA "flush" end select text=text+1 text$(text,1)=str$(MouseX) :text$(text,2)=str$(MouseY) text$(text,3)=color$ :text$(text,4)=alt$ fuente$=Fo.rest$: if fuente$="" then fuente$="Arial" text$(text,5)=fuente$ :text$(text,6)=text$ texto=1gosub [pepe]if linea.libre=0 then call StopDrawwait'......................................'detecta Mouse Inputsub SetDraw global panta$ startX = MouseX : startY=MouseY lDd$="when leftButtonDown [draw]" lMd$="when leftButtonMove [draw]"' rDa$="when rightButtonDown [altDraw]"' rMa$="when rightButtonMove [altDraw]" select case panta$ case "F" :#g, lDd$ :#g, rDa$ :#g, lMd$ :#g, rMa$ case "M" :#gM, lDd$ :#gM, rDa$ :#gM, lMd$ :#gM, rMa$ case "C" :#gC, lDd$ :#gC, rDa$ :#gC, lMd$ :#gC, rMa$ case "A" :#gA, lDd$ :#gA, rDa$ :#gA, lMd$ :#gA, rMa$ end selectend SUB'................sub StopDraw global panta$ 'ignora Mouse Input select case panta$ case "F": #g, "when leftButtonDown" :#g, "when rightButtonDown [borrarTexto]" #g, "when leftButtonMove" :#g, "when rightButtonMove" case "M": #gM, "when leftButtonDown" :#gM,"when rightButtonDown [borrarlinea]" #gM, "when leftButtonMove" :#gM,"when rightButtonMove" case "C": #gC, "when leftButtonDown" :#gC,"when rightButtonDown [borrarlinea]" #gC, "when leftButtonMove" :#gC,"when rightButtonMove" case "A": #gA, "when leftButtonDown" :#gA,"when rightButtonDown [borrarlinea]"

Page 19: porti_29

#gA, "when leftButtonMove" :#gA,"when rightButtonMove" end selectend SUB'--------------------------[draw]global panta$, textoif linea.libre=0 then size=max(alturaM,6) pixel=pixel+1 color$=lineColor$ if color$="" then color$="black" pixel$(pixel, 1)=str$(size) : pixel$(pixel, 2)=color$ pixel$(pixel, 3)=str$(MouseX) : pixel$(pixel, 4)=str$(MouseY) select case panta$ case "F" :#g "size ";size;" ; color ";color$;" ; set ";MouseX;" ";MouseY:#g "flush" case "M" :#gM "size ";size;" ; color ";color$;" ; set ";MouseX;" ";MouseY:#gM "flush" case "C" :#gC "size ";size;" ; color ";color$;" ; set ";MouseX;" ";MouseY:#gC "flush" case "A" :#gA "size ";size;" ; color ";color$;" ; set ";MouseX;" ";MouseY:#gA "flush" end select modr=1wait'------------------------------[altDraw] global panta$ texto=1 pixel=pixel+1 alt$="white" pixel$(pixel,1)=str$(size) :pixel$(pixel,2)=alt$ pixel$(pixel,3)=str$(MouseX) :pixel$(pixel,4)=str$(MouseY) select case panta$ case "F" :#g "size ";size;" ;color ";alt$;" ;set ";MouseX;" ";MouseY:#g "flush" case "M" :#gM "size ";size;" ;color ";alt$;" ;set ";MouseX;" ";MouseY:#gM "flush" case "C" :#gC "size ";size;" ;color ";alt$;" ;set ";MouseX;" ";MouseY:#gC "flush" case "A" :#gA "size ";size;" ;color ";alt$;" ;set ";MouseX;" ";MouseY:#gA "flush" end select modr=1call StopDrawwait'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[adLinea]'aaaaaaaacall addLinea:waitsub addLinea'aaaaaaaaaaaaglobal g$dim xA(20), yA(20)if propi(17) = 0 then statictext #Li.n,"Nudo i",10,10,50,20 textbox #Li.ni, 60,10,30,18 'nudo de inicio textbox #Li.ppi, 100,10,28,18 '>0 en un punto de otra linea textbox #Li.inii, 175,10,30,20 'inicio de la otra linea textbox #Li.fini, 215,10,30,20 'fin de la otra linea

statictext #Li.n,"Nudo j",10,30,50,20 textbox #Li.nj, 60,30,30,18 'nudo final

textbox #Li.ppj, 100,30,28,18 textbox #Li.inij, 175,30,30,20 textbox #Li.finj, 215,30,30,20

bmpbutton #Li.mas.i,g$+" mas.bmp",[mas.i],UL,134,10 bmpbutton #Li.por.i,g$+" div.bmp",[por.i],UL,155,10 bmpbutton #Li.mas.j,g$+" mas.bmp",[mas.j],UL,134,30 bmpbutton #Li.por.j,g$+" div.bmp",[por.j],UL,155,30

statictext #Li.x,"DistanciaX",2,50,55,18 textbox #Li.x, 60,50,30,18 statictext #Li.y,"DistanciaY",2,70,55,18 textbox #Li.y, 60,70,30,18 bmpbutton #Li.ok, g$+"marcar.bmp", [XY],UL,70,94 bmpbutton #Li.des,g$+"bomb.bmp",[borrar],UL,30,94

TexteditorColor$="white" ForegroundColor$="blue" Texteditor #Li.nu, 100,50,190,65 '******************************* WindowWidth=300 :UpperLeftX=400 WindowHeight=150:UpperLeftY=100 open "Esquema" for dialog as #Li '******************************* #Li "trapclose [closeLin]"; #Li "font ";"arial 8"; propi(17)=1end ifend sub[closeLin] call closeLi :waitsub closeLi if propi(17)=1 then close #Li:propi(17)=0end sub'......[XY]

#Li.ni, "!contents? ni"#Li.inii, "!contents? ini.i"#Li.fini, "!contents? fin.i"#Li.ppi, "!contents? pp.i"#Li.nj, "!contents? nj"#Li.inij, "!contents? ini.j"#Li.finj, "!contents? fin.j"#Li.ppj, "!contents? pp.j"#Li.x, "!contents? xr"#Li.y, "!contents? yr"yr=-1*e*yrxr=e*xr

if pp.i>0 thenif por.i=1 then xA(ni)=xA(ini.i)+(xA(fin.i)-xA(ini.i))/pp.i yA(ni)=yA(ini.i)+(yA(fin.i)-yA(ini.i))/pp.iend ifif mas.i =1 then Lon.i=sqr((xA(fin.i)-xA(ini.i))^2+(yA(fin.i)-yA(ini.i))^2)/e Xpp.i=xA(ini.i)+(xA(fin.i)-xA(ini.i))*pp.i/Lon.i Ypp.i=yA(ini.i)+(yA(fin.i)-yA(ini.i))*pp.i/Lon.i xA(ni)=Xpp.i yA(ni)=Ypp.iend if#g "place ";xA(ni);" ";yA(ni)

Page 20: porti_29

#g "\";niend if

if pp.j>0 then if por.j=1 then xr=(xA(fin.j)-xA(ini.j))/pp.j-(xA(ni)-xA(ini.j)) yr=(yA(fin.j)-yA(ini.j))/pp.j-(yA(ni)-yA(ini.j)) end if if mas.j=1 then Lon.j=sqr((xA(fin.j)-xA(ini.j))^2+(yA(fin.j)-yA(ini.j))^2)/e Xpp.j=xA(ini.j)+(xA(fin.j)-xA(ini.j))*pp.j/Lon.j Ypp.j=yA(ini.j)+(yA(fin.j)-yA(ini.j))*pp.j/Lon.j end ifend if

if ni=1 then xA(ni)=DisplayWidth/2:yA(ni)=DisplayHeight/1.2if pp.j>0 and mas.j=1 then xr=Xpp.j-xA(ni): yr=Ypp.j-yA(ni)

if ni=1 then #g "place ";xA(ni);" ";yA(ni): #g "\";niif xr<>0 then xA(nj)=xr+xA(ni)if yr<>0 then yA(nj)=yr+yA(ni)if xr<>0 and yr=0 then yA(nj)=yA(ni)if yr<>0 and xr=0 then xA(nj)=xA(ni)

#g "line ";xA(ni);" ";yA(ni);" ";xA(nj);" ";yA(nj)#g "place ";xA(nj);" ";yA(nj)#g "\";nj#g "flush "panta$="F": gosub [pepe]#Li.ni "":#Li.nj "":#Li.x "":#Li.y ""#Li.inii "":#Li.inij "":#Li.fini "":#Li.finj ""pp.i=0:pp.j=0x1=xA(1):y1=yA(1)

'#Li.nu ni;" (";xA(ni);",";yA(ni);")";" ";nj;" (";xA(nj);",";yA(nj);")"#Li.nu d0$(ni);" (";d2$((xA(ni)-x1)/e);",";d2$((yA(ni)-y1)/e);")";" ";_ d0$(nj);" (";d2$((xA(nj)-x1)/e);",";d2$((yA(nj)-y1)/e);")"wait

[borrar]panta$="F":gosub [borrarlinea]wait[mas.i] mas.i=1:por.i=0:wait[por.i] mas.i=0:por.i=1:wait[mas.j] mas.j=1:por.j=0:wait[por.j] mas.j=0:por.j=1:wait'-------------------------------------sub opent'******** if propi(1)=0 then WindowWidth=DisplayWidth/3 :UpperLeftX=WindowWidth WindowHeight=DisplayHeight*0.47:UpperLeftY=DisplayHeight*0.47 open "Calculos" for text as #t '----------------------------- #t "!trapclose [closet]"; #t "!font ";"courier 8"; propi(1)=1 else #t "!cls"; 'Si la ventana esta abierta end if 'puede realizarse algo aquiend sub[closet] call closeT:wait

sub closeT if propi(1)=1 then close #t:propi(1)=0end sub'-------------------------------------[Mensaje] #t "ERROR EN "; er$ #t "i= ";i;" ";"Nnu= ";Nnu;_ " j= ";j;" Nnu= ";Nnu;" i= ";i;" j=";j;" j-i=";j-i #t "PULSAR UNA TECLA PARA TERMINAR" WHILE INKEY$ = "": WEND RETURN'************--------------------------[Esfu.Empotr] ' Esfuerzos de empotramiento en cada barra'************FOR q=1 TO n.c1(n,h) ' bucle a las cargas de cada barra P =P.u(n,q):a=a.u(n,q):b=b.u(n,q):tu=t.u(n,q) if b=0 then itc=1 ' carga puntual if a=0 and b=0 then b =abs(L): b.u(n,q)=b 'carga uniforme en toda la viga if b>0 then itc=2 ' carga uniforme sent=SIN(tu*g.r) : cost=COS(tu*g.r) Pn= P*(cost*sena-sent*cosa) 'Componente normal Pt=-1*P*(sent*sena+cost*cosa) ' " tangencial ' ----------- if itc=1 then 'Carga puntual ax.i=ax.i+Pt*(1-a/L) ax.j=ax.j-Pt* a/L 'Axiles i j

bL = (3-2*a/L)*(a/L)^2 'if a<=abs(L/2) then m.isos= Pn*a/2 'se han cambiado < y > P por Pn 'if a> abs(L/2) then m.isos=-1*Pn*(1-a)/2 'idem

ct.i=ct.i+Pn*(1-bL) : ct.j=ct.j-Pn*bL 'Cortantes i j If Ine>0 then fl.i=fl.i+Pn*a* (1-a/L)^2 fl.j=fl.j-Pn*a*a*(1-a/L)/L 'Momentos i j end if end if '------------ IF itc=2 THEN 'Carga repartida ax.i = ax.i+Pt*b*(1-(a+a+b)/2/L) 'Axil ax.j = ax.j-Pt*b* (a+a+b)/2/L

a2=(a+b)^2-a^2: a3=(a+b)^3-a^3: a4=(a+b)^4-a^4

ct.i = ct.i+Pn/2/L/L*(a4/L-2*a3+2*b*L*L) 'Cortante ct.j = ct.j+Pn/2/L/L*(a4/L-2*a3)

If Ine>0 then fl.i = fl.i+Pn*(3*a4/L/L-8*a3/L+6*a2)/12 'momento de emp. perfecto fl.j = fl.j+Pn*(3*a4/L/L-4*a3/L )/12 end if m.isos= Pn*L^2/8 'isostatico [he cambiado P por Pn] end if '------------ if itc>2 then er$ = "CARGA BARRA "+STR$(i)+" - "+STR$(j): GOSUB [Mensaje] END END IF '------------ m.iso=m.iso+m.isos 'suma de los m. isostaticosNEXT q

Page 21: porti_29

RETURN'-----------------------------[cosenos] i=n.i(n) : j=n.j(n) : ntip=t.b(n) i1=3*(i-1)+1 : j1=3*(j-1)+1 :jd=3*(j-i) i2=i1+1:j2=j1+1 dx= x(i)-x(j): dy=y(i)-y(j) L = SQR(dx^2+dy^2) cosa=dx/L : sena=dy/L if sena>1 then sena=1 if sena<-1 then sena=-1 if cosa>1 then cosa=1 if cosa<-1 then cosa=-1 fma$=forma$(ntip) Are=Area(ntip) Ine=Iner(ntip) pes=peso.m(ntip) e1 =mYoung*Are/L 'mYoung=E e2 =2*mYoung*Ine/L e4 =2*e2 '4*E*Ine/rl e6 =3*e2/L '6*E*Ine/rl^2 e12=2*e6/L '12*E*Ine/rl^3return'-----------------------------[CargasBarras] dim n.i2(40),n.j2(40), angu(40,5), qq(40,5),aa(40,5),bb(40,5) for o=1 to Nbc2(h) input #d, t$ : gosub [datos.iniciales] n.i2(o)=val(dato$(1)) n.j2(o)=val(dato$(2)) if n.i2(o)>n.j2(o) then ni=n.i2(o):nj=n.j(o):gosub [error1]:n.i2(o)=ni:n.j2(o)=nj for oo=1 to n.c2(o,h) input #d, t$ : gosub [datos.iniciales] qq =val(dato$(1)) aa =val(dato$(2)) bb =val(dato$(3)) angu(o,oo)=val(dato$(4)) qq(o,oo)=qq*CeF/CeL: aa(o,oo)=aa*CeL: bb(o,oo)=bb*CeL if bb=0 then qq(o,oo)=qq(o,oo)*CeL next oo next o

For n=1 to Nba 'bucle "n" a todas las barras n.c1(n,h)=0 'ponemos a 0 el nº de cargas por barra e hipot. for o=1 to Nbc2(h) 'bucle "o" a todas las barras cargadas de c/hip. If n.i(n)=n.i2(o) and n.j(n)=n.j2(o) then 'coincide barra de "o" con "n" n.c1(n,h)=n.c2(o,h) for oo=1 to n.c1(n,h) 'bucle a todas las cargas de c/barra y c/hip. P.u(n,oo)=qq(o,oo) a.u(n,oo)=aa(o,oo) b.u(n,oo)=bb(o,oo) t.u(n,oo)=angu(o,oo) next oo end if next nextreturn'---------------------------------[error1]i.old$=str$(ni):j.old$=str$(nj)i.nueva=ni

ni=nj :i$=str$(ni)nj=i.nueva:j$=str$(nj)asa$= "¡Hola!, ¡¡soy el Programa!!, he corregido la barra "+i.old$+" "+j.old$+_" que esta mal en"+" BARRAS i j TIPOS. Ponla asi "+i$+" ";j$+" y grabalo despues"notice asa$return

'wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww[po]' ndv=nº de vanos np=nº de pilares por piso ndp=nº de pisos ndh=nº de hipotesis' qp =peso propio qu=carga de uso lf = Ancho forjado lv =Luz vigas' ap =altura pilar en PP apb= altura pilares en PB' vi / vd = existe si=1 no=0 voladizo izquierdo o derecho#1.ndv "!contents? ndv":#1.ndp "!contents? ndp": #1.ndh "!contents? ndh"#1.qp "!contents? qp" :#1.qu "!contents? qu" : #1.lf "!contents? lf"#1.lv "!contents? lv" :#1.vii "!contents? vii": #1.vdd "!contents? vdd"#1.apb "!contents? apb":#1.ap "!contents? ap" : #1.num$ "!contents? num$"#1.fn "!contents? fn"if vii>0 then vi=1 else vi=0if vdd>0 then vd=1 else vd=0n.f$=nf$+num$+"_"+u0$(ndv)+"x"+u0$(ndp)+"_i"+u0$(vi)+"d"+u0$(vd)+".dat"open n.f$ for output as #port q=qp+qu : ndn=(ndv+1)*(ndp+1)+(vi+vd)*ndp 'numero de nudos ndb=(ndv+vi+vd)*ndp+(ndv+1)*ndp 'numero de barras np=ndv+1 'nº de pilares por piso'-------------------------------------------------------------------------- #port "Nombre del fichero: ";n.f$ : #port "h T m" #port "Tipo de barra: b h. forma" : #port "1 0.3 0.3 r, 2 0.5 0.3 r"'---------------------------------------------------------------------- #port "Nudos: Numero ABSCISA y ORDENADA"nb=4:xx=ndn: n=0for v=1 to np: n=n+1:#port t0$(n);" ";d2$((v-1)*lv);" ";d2$(0);:gosub [formato]:nextfor p=1 to ndp if vi=1 then n=n+1:#port t0$(n);" ";d2$(-1*vii) ;" ";d2$(apb+(p-1)*ap);:gosub [formato] for v=1 to np:n=n+1:#port t0$(n);" ";d2$((v-1)*lv);" ";d2$(apb+(p-1)*ap);:gosub [formato]:next if vd=1 then n=n+1:#port t0$(n);" ";d2$((np-1)*lv+vdd);" ";d2$(apb+(p-1)*ap);:gosub [formato]next p'---------------------------------------------------------------------------- #port "BARRA: i j Tipo de barra"n =0 :nb=7 :xx=ndb :np=ndv+1 'numero de pilares por pisonpv=np+vi+vdfor p=1 to ndp 'bucle de los pisosfor v=1 to np 'sub-bucle para numerar pilares de cada piso n=n+1: if p =1 then #port d0$(v) ;" ";d0$(v+np+vi) ;" ";"1"; if p >1 then #port t0$(v+np+vi+(p-2)*npv);" ";t0$(v+np+vi+(p-1)*npv);" ";"1"; gosub [formato]next'.................for v=1 to ndv+vi+vd 'sub-bucle para numerar vigas de cada piso n=n+1 :#port t0$(v+np+(p-1)*npv);" ";t0$(v+np+1+(p-1)*npv);" ";"2"; gosub [formato]next:next'-----------------------------------------------#port "APOYOS: nudo y coeficientes de Coaccion"nb=5:xx=np :n=0: for n=1 to np: #port t0$(n);" 0 0 0 ";:gosub [formato]:next'------------------------------------------------ #port "Fuerzas en NUDOS"nb=5:xx=ndpfor h= 1 to ndh

Page 22: porti_29

n=0 :#port "hipotesis ";u0$(h)for p=1 to ndp if fn>0 then v=1: n=n+1:#port t0$(v+np+vi+(p-1)*npv);" ";d2$(fn);" 0 0";:gosub [formato] end ifnext:next'-------------------------------------------------#port "CARGA (P) puntual o uniforme en BARRAS: pilar o viga p/v"for h=1 to ndh #port "hipotesis ";h for p=1 to ndp 'bucle de los pisos for v=1 to ndv+vi+vd 'sub-bucle para numerar vigas de cada piso if h=1 then_ #port t0$(v+np+(p-1)*npv);" ";t0$(v+np+1+(p-1)*npv);",";d2$(lf*q);" 0 0 270" if h=2 then q1=q if v mod 2 =0 then q1=qp #port t0$(v+np+(p-1)*npv);" ";t0$(v+np+1+(p-1)*npv);",";d2$(lf*q1);" 0 0 270" end ifnext:next:nextn=0close #portwait'wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww function u0$(kk):u0$=using ("#",kk) end function function u2$(kk):u2$=using ("#.##",kk) end function function u3$(kk):u3$=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 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 f3$(kk):f3$=using ("#####.###",kk) end function '----------- function s1$(kk):s1$=using ("######.#",kk) end function function s2$(kk):s2$=using ("######.##",kk) end function function s3$(kk):s3$=using ("######.###",kk) end function '----------- function v0$(kk):v0$=using ("#######",kk) end function '----------- function o0$(kk):o0$=using ("########",kk) end function '-----------[formato]if n mod nb<>0 and n<xx then #port ", ";if n mod nb =0 or n=xx then #port ""return'-------------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 si(ee) if ee<180 then si=1 else si=-1end function'-------------------------------function signo(qwq) if qwq<0 then signo=-1 if qwq>0 then signo=1 if qwq=0 then signo=0end function'------------------------------------------------function min(a, b): if a>=b then min=b else min=aend functionfunction max(a, b): if a>=b then max=a else max=bend function'------------------------------------------------[famg]WindowWidth = 250WindowHeight= 230UpperLeftX=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)+_

Page 23: porti_29

" http:\arquitectur.blogspot.com" +chr$(13)+_" ------------------------------" +chr$(13)+chr$(13)+_"Calculo de porticos planos por " +chr$(13)+_"metodos matriciales. " +chr$(13)+_"" +chr$(13)+_"" +chr$(13)+_"El programa permite introducir " +chr$(13)+_"diferentes escuadrias o perfiles" +chr$(13)+_"y materiales, " +chr$(13)+_"" +chr$(13)+_"" +chr$(13)+_"" +chr$(13)+_"" +chr$(13)+_"" +chr$(13)+_"" +chr$(13)+_"(Cartagena/2013)" +chr$(13)+_""texteditor #ab.tx , 10, 10,220,160button #ab.okBut,"OK",[ok],UL,90,175, 40, 20if propi(10)=0 then open programa$ for dialog as #ab:propi(10)=1#ab "font ms_sans_serif 10"#ab "trapclose [ok]"#ab.tx, aboutMessage$#ab.tx "!origin 1 1"

dim info$(1,3)

fileChoosen$=DefaultDir$+"\"+programa$

files GetPath$(fileChoosen$), info$()#ab.tx "Disco ............... "; info$(0,2)#ab.tx "Carpeta ............. "; info$(0,3)#ab.tx ""

for num = 1 to val(info$(0,0)) if info$(0,2)+info$(0,3)+info$(num,0)=fileChoosen$ then #ab.tx " Nombre ....... "; info$(num,0) #ab.tx " Tamaño ....... "; info$(num,1) #ab.tx " Fecha ........ "; info$(num,2) #ab.tx " Atributos .... "; info$(num,3) end ifnextwait'------------------------------------------------------function GetPath$(input$)bsPos = len(input$)while mid$(input$, bsPos, 1) <> "\" and bsPos>0 bsPos = bsPos - 1wendif bsPos<>0 then GetPath$=left$(input$,bsPos) else GetPath$=""end function'------------------------------------------------------[ok] if propi(10)=1 then close #ab :propi(10)=0 :wait'......................................................'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[foto]notis$="Hola ";usuario$;", soy el programa, lo siento,";chr$(10);_ "no puedo hacer nada si no buscas antes algun fichero.";chr$(10);_ "si lo prefieres puedes crear un portico nuevo con" ;chr$(10);_ "el boton <crear portico>" Open g$+"famg.bmp" for Input as #F gosub [bmp]

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]return

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 SelectEnd Function'-----------------------------------------------------[colo] if propi(14)=0 then propi(14)=1 WindowHeight=335 WindowWidth =286 UpperLeftX =300 UpperLeftY = 1

statictext #a.t1, "Color elegido:",1, 86, 76,20 statictext #a.t2, " ",90, 86,100,20 graphicbox #a.picked, 194, 85, 15,15 checkbox #a.marcarC,"",[setC],[resetC] ,10,105, 15,15 statictext #a.Cor, "Rallado de Cortantes",26,105,106,20 checkbox #a.marcarM,"",[setM],[resetM] ,10,125, 15,15 statictext #a.Mom, "Rallado de Momentos" ,26,125,106,20 checkbox #a.marcarF,"",[setF],[resetF] ,10,145, 15,15 statictext #a.Fue, "Rallado de Fuerzas" ,26,145,106,20 checkbox #a.marcarA,"",[setA],[resetA] ,10,165, 15,15 statictext #a.Axi, "Rallado de Axiles" ,26,165,106,20 checkbox #a.marcarP,"",[setP],[resetP] ,10,185, 15,15 textbox #a.grufPu ,140,185, 20,18 statictext #a.Pun, "Fuerzas puntuales" ,26,185,106,20 checkbox #a.valorF,"",[setvF],[resetvF],10,205, 15,15 statictext #a.vaF,"Valor Fuerza uniforme",26,205,106,20 checkbox #a.longitu,"",[setL],[resetL] ,10,225, 15,15 statictext #a.Lon, "Longitud de barras" ,26,225,100,20 checkbox #a.nudos ,"",[setN],[resetN] ,10,245, 15,15 statictext #a.Nud, "Nudos" ,26,245,106,20 checkbox #a.ValAbIz,"",[setI],[resetI] ,10,265, 15,15 textbox #a.gruAbIz,140,265, 20,18 statictext #a.Izq, "Valores a izq y aba" ,26,265,106,20 checkbox #a.ValArDe,"",[setD],[resetD] ,10,285, 15,15 textbox #a.gruArDe,140,285, 20,18 statictext #a.Der, "Valores a der y arr" ,26,285,106,20 checkbox #a.caraLi1,"",[set1],[reset1],140,105, 15,15 statictext #a.ca1, "Caratula 1ª linea" ,156,105,106,20 checkbox #a.caraRes,"",[set2],[reset2],140,125, 15,15 statictext #a.ca2,"Cara. resto de linea",156,125,176,20 checkbox #a.barras ,"",[setB],[resetB],200,225, 15,15 textbox #a.grueje,140,225, 20,18

Page 24: porti_29

statictext #a.bar,"Barras",163,225, 40,20

graphicbox #a.a, 1,10,69,69 graphicbox #a.b, 70,10,69,69 graphicbox #a.c,140,10,69,69 graphicbox #a.d,210,10,69,69 ForegroundColor$ = "darkgreen"

open "Paleta de colores" for dialog_nf as #a '******************************************* #a.grueje gru.eje #a.gruArDe gruArDe #a.gruAbIz gruAbIz #a.grufPu gru.fPu #a.a "down;size 2":#a.b "down;size 2" #a.c "down;size 2":#a.d "down;size 2" #a.picked "down" #a "trapclose [end]" ' #a.gru.fPu, "!contents? gru.fPu" ' #a.gruAbIz, "!contents? gruAbIz" ' #a.gruArDe, "!contents? gruArDe" ' #a.gru.eje, "!contents? gru.eje"

for Y=0 to 256 step 8 W=256-Y for X=0 to 256 step 8 #a.a "color 0 ";X;" ";W :#a.a "set ";X/4;" ";Y/4 #a.b "color ";X;" ";W;" 0" :#a.b "set ";X/4;" ";Y/4 #a.c "color ";W;" 0 ";X :#a.c "set ";X/4;" ";Y/4 #a.d "color ";W;" ";W;" ";X:#a.d "set ";X/4;" ";Y/4 next:next #a.a "flush": #a.b "flush": #a.c "flush": #a.d "flush"[input] #a.a "when leftButtonDown [a8]" #a.b "when leftButtonDown [b8]" #a.c "when leftButtonDown [c8]" #a.d "when leftButtonDown [d8]"end ifwait

[a8] X=MouseX*4:Y=MouseY*4:r=0 :g=X:b=256-Y:gosub [picked]:goto [input][b8] X=MouseX*4:Y=MouseY*4:r=X :g=256-Y:b=0:gosub [picked]:goto [input][c8] X=MouseX*4:Y=MouseY*4:r=256-Y:g=0 :b=X:gosub [picked]:goto [input][d8] X=MouseX*4:Y=MouseY*4:r=256-Y:g=256-Y:b=X:gosub [picked]:goto [input][picked] rgb$=str$(r);" ";str$(g);" ";str$(b) #a.picked "fill ";r;" ";g;" ";b

if colorCor=1 then color.rayadoC$ =rgb$ if colorMom=1 then color.rayadoM$ =rgb$ if colorAxi=1 then color.rayadoA$ =rgb$ if colorFue=1 then color.rayadoF$ =rgb$ if colorPun=1 then color.puntual$ =rgb$ if colorvaF=1 then color.valorFu$ =rgb$ if colorLon=1 then color.longitu$ =rgb$ if colorNud=1 then color.nudos$ =rgb$ if colorIzq=1 then color.aba.izq$ =rgb$ if colorDer=1 then color.arr.der$ =rgb$ if colorCa1=1 then color.car.Li1$ =rgb$ if colorCa2=1 then color.car.Li2$ =rgb$ if colorBar=1 then color.barras$ =rgb$ #a.t2 "R:";r;" G:";g;" B:";b

return[end] if propi(14)=1 then close #a:propi(14)=0: wait'-------------------------------------------------------[setC] colorCor=1:wait[resetC] colorCor=0:wait[setM] colorMom=1:wait[resetM] colorMom=0:wait[setA] colorAxi=1:wait[resetA] colorAxi=0:wait[setF] colorFue=1:wait[resetF] colorFue=0:wait[setP] colorPun=1:wait[resetP] colorPun=0:wait[setvF] colorvaF=1:wait[resetvF] colorvaF=0:wait[setL] colorLon=1:wait[resetL] colorLon=0:wait[setN] colorNud=1:wait[resetN] colorNud=0:wait[setI] colorIzq=1:wait[resetI] colorIzq=0:wait[setD] colorDer=1:wait[resetD] colorDer=0:wait[set1] colorCa1=1:wait[reset1] colorCa1=0:wait[set2] colorCa2=1:wait[reset2] colorCa2=0:wait[setB] colorBar=1:wait[resetB] colorBar=0:wait'.......................[fuentes] data 29 data "arial","arial_black","arial_narrow","book_antiqua","bookman_old_style" data "century_gothic","comic_sans_ms","Consolas","courier","courier_new" data "DejaVu Sans Mono","fixedsys","garamond","GungsuhChe","Helvetica" data "impact","Linux Biolinum","lucida_console","monotype_corsiva","ms_sans_serif" data "mS_Serif","small_fonts","symbol","system","tahoma" data "terminal","times_new_roman","Trebuchet_MS","verdana"'........................................................ [formas] data 9 data "regular","bold","italic","bold italic","underscore","bold underscore" data "italic underscore","bold italic underscore","strikeout"'....................................................... [altura] data 25 data "6", "8", "9","10","11","12","14","16","18","20","22","24","26" data "28","30","34","38","40","44","48","52","56","60","66","72"'........................................................ [textos3] data 9 data "nudos","longitud","F.puntual","F.uniforme","momento","cortante","axial" data "caratula.L.1","resto.caratula"'--------------------------------------------------------[font]

t$= "Texto de PRUEBA 012 345 67 89." fuente$ = "ms_sans_serif" tipo$ = "bold italic" altura$ = "20"

dim ption$(30)

Page 25: porti_29

dim size$ (26) dim point$ (10) '.................................................... restore [fuentes] read ndF:for n=1 to ndF:read fuen$:ption$(n)=fuen$:next combobox #w.face, ption$() , [Face] ,3,5,160,120

restore [formas] read ndf:for n=1 to ndf:read forma$:point$(n)=forma$:next combobox #w.poi, point$() , [Point],170,5,130,120

restore [altura] read nda:for n=1 to nda:read altu$:size$(n)=altu$:next combobox #w.si, size$() , [Size] ,310,5,60,120

restore [textos3] read ndt:for n=1 to ndt:read tex$:textE$(n)=tex$:next combobox #w.tex, textE$() , [text3] ,380,5,100,120'........................................................

WindowWidth =500 : WindowHeight=200 UpperLeftY =150 : UpperLeftX = 20 BackgroundColor$ = "white" texteditor #w.T, 1,30,482,112 if propi(13)=0 then propi(13)=1 open "Editor de textos" for window as #w '*************************************** #w "trapclose [endE]" #w.T "!autoresize" end if

[N.E]

#w.face "select ";fuente$ #w.poi "select ";tipo$ #w.si "select ";altura$ #w.tex "select ";texto$

#w.T "!font ";fuente$;" ";altura$;" ";tipo$ tipo.t$= fuente$;" ";altura$;" ";tipo$ #w.T "!cls" #w.T texto$;" ";tipo.t$ select case texto$ case "nudos" :nudo$ =tipo.t$ case "longitud" :fo.long$=tipo.t$ case "F.puntual" :F.pu$ =tipo.t$ case "F.uniforme":F.un$ =tipo.t$ case "momento" :mome$ =tipo.t$:alturaM=val(altura$) case "cortante" :cort$ =tipo.t$:alturaC=val(altura$) case "axial" :axia$ =tipo.t$:alturaA=val(altura$) case "caratula.L.1" :fo.cara$=tipo.t$ case "resto.caratula":fo.rest$=tipo.t$ end select texto$="" #w.T t$ #w.T "!setfocus"wait'.............................................. [Face] #w.face "contents? fuente$":goto [N.E] [Point] #w.poi "contents? tipo$" :goto [N.E] [Size] #w.si "contents? altura$":goto [N.E]

[text3] #w.tex "contents? texto$" :goto [N.E] '................................. [endE] if propi(13)=1 then close #w: propi(13)=0 wait '--------------------------------------------[sism]'******TF2=1: coN=1 :co.te3=1.6

if propi(15) = 0 then WindowWidth=500 : UpperLeftX=400 WindowHeight=420: UpperLeftY=100 BackgroundColor$ = "grey" ForegroundColor$ = "darkblue" TextboxColor$="cyan"statictext #sis,"Edificio (Periodo fundamental)", 3, 12,160,20 textbox #sis.TF, 165, 12, 33,18statictext #sis,"Tipo de construccion", 220, 12,160,20 textbox #sis.TiCon, 382, 12, 33,18TextboxColor$="green"statictext #sis," De importancia Normal", 220, 32,160,20 checkbox #sis.cN,"",[si.cN],[no.cN] , 382, 32, 16,16statictext #sis," De importancia Especial ", 220, 52,160,20 checkbox #sis.cE,"",[si.cE],[no.cE] , 382, 52, 16,16statictext #sis,"Muros de fabrica de ladrillo o bloque", 3, 32,160,30 checkbox #sis.1,"",[si1],[no1] , 165, 32, 16,16statictext #sis,"Portico de hormigon armado sin pantallas", 3, 62,160,30 checkbox #sis.2,"",[si2],[no2] , 165, 62, 16,16statictext #sis,"Portico de hormigon armado con pantallas", 3, 92,160,30 checkbox #sis.3,"",[si3],[no3] , 165, 92, 16,16statictext #sis,"Aceleracion sismica basica", 220, 82,160,45 textbox #sis.asb, 382, 82, 33,20statictext #sis,"Portico rigido de acero laminado", 3,122,160,40 checkbox #sis.4,"",[si4],[no4] , 165,122, 16,16statictext #sis,"Portico de acero laminado con triangulaciones",3,152,160,40 checkbox #sis.5,"",[si5],[no5] , 165,152, 16,16statictext #sis,"Tipo de terreno ", 220,112,110,20TextboxColor$="cyan" textbox #sis.coTe, 382,112, 33,18statictext #sis,"Numero de plantas sobre rasante", 3,232,160,40 textbox #sis.p, 165,232, 33,20TextboxColor$="green"statictext #sis,"Espesor", 420,112, 50,20statictext #sis,"Roca compacta, suelo cementado o granular"+_ " muy denso Vs>750 m/s", 220,132,160,40 checkbox #sis.5,"",[si.tt1],[no.tt1] , 382,132, 16,16 textbox #sis.Et1, 420,132, 33,20statictext #sis,"Roca muy fracturada, granular denso o "+_ "cohesivo duro Vs>400 m/s", 220,182,160,40 checkbox #sis.6,"",[si.tt2],[no.tt2] , 382,182, 16,16 textbox #sis.Et2, 420,182, 33,20statictext #sis,"Granular de compacidad media, cohesivo de"+_ " consistencia firme a muy firme Vs>200 m/s", 220,232,160,40 checkbox #sis.7,"",[si.tt3],[no.tt3] , 382,232, 16,16 textbox #sis.Et3, 420,232, 33,20statictext #sis,"Coeficiente de contribucion K", 3,202,160,20 textbox #sis.coeCon, 165,202, 33,20statictext #sis,"Dimension del edificio en plano de oscilacion",3,272,160,40 textbox #sis.d, 165,272, 33,20statictext #sis,"Dimension de la pantalla rigidizadora.", 3,312,160,40statictext #sis,"Granular suelto o cohesivo blando. Velocidad"+_ " de propagacion transversal Vs<200 m/s", 220,282,160,40

Page 26: porti_29

textbox #sis.r, 165,312, 33,20 checkbox #sis.8,"",[si.tt4],[no.tt4] , 382,282, 16,16 textbox #sis.Et4, 420,282, 33,20statictext #sis,"Masa media inicial por piso y portico (T/m2)",220,342,160,40 textbox #sis.masa, 382,342, 33,18TextboxColor$="cyan"statictext #sis,"Coeficiente de amplificacion del terreno", 3,342,160,40 textbox #sis.cAt, 165,342, 33,18

button #sis.seg,"Seguir" ,[seguir] ,UL,445,342, 40, 20

open "Calculo sismico" for dialog as #sis'----------------------------------------#sis "trapclose [closeSis]";#sis "font ";f.a8$;propi(15) = 1#sis.coeCon 1#sis.asb 0.07#sis.Et3 30#sis.2, "set"#sis.7, "set"#sis.cN, "set"#sis.masa 3

dime=xmax-xmin:#sis.d dimeelse#sis "cls"; 'Si la ventana esta abiertaend if 'puede realizarse algo aquiwait'.......[sismo2]'******dim num$(25)ducti=2:CdS=1:Fa.mo.es=1if propi(16)=0 thenBackgroundColor$="gray"ForegroundColor$="darkblue"TextboxColor$="green"WindowWidth=560 :UpperLeftX=400WindowHeight=410:UpperLeftY=130

TextboxColor$="cyan"statictext #sis2,"Ductilidad de la estructura", 3, 12,160,20 textbox #sis2.Duc, 165, 12, 33,18TextboxColor$="green"statictext #sis2,"Porticos, pantallas acopladas y"+_ " triangulaciones incompletas", 3, 32,160,40 checkbox #sis2.1,"",[siDu1],[noDu1] , 165, 32, 16,16statictext #sis2,"Porticos, pantallas y cruces", 3, 72,160,40 checkbox #sis2.2,"",[siDu2],[noDu2] , 165, 72, 16,16statictext #sis2,"Losas, reticulados, vigas planas,"+_ " muros de arriostramiento y diagonales",3,112,160,40 checkbox #sis2.3,"",[siDu3],[noDu3] , 165,112, 16,16statictext #sis2,"Muro de carga y acodado en K" ,3,152,160,40 checkbox #sis2.4,"",[siDu4],[noDu4] , 165,152, 16,16TextboxColor$ = "cyan"statictext #sis2,"aceleracion Sismica de calculo",3,195,160,20 textbox #sis2.aSc, 165,192, 40,18statictext #sis2,"Coeficiente de respuesta", 3,212,160,20 textbox #sis2.coRe, 165,212, 40,18statictext #sis2,"Hormigon armado o acero "+_ "laminado y planta diafana", 3,232,160,40

checkbox #sis2.5,"",[siRe1],[noRe1] , 165,232, 16,16statictext #sis2,"Hormigon armado o acero"+_ " laminado y planta compartimentada",3,272,160,40 checkbox #sis2.6,"",[siRe2],[noRe2] , 165,272, 16,16statictext #sis2,"Muros y tipos similares y "+_ "planta compartimentada", 3,312,160,40 checkbox #sis2.7,"",[siRe3],[noRe3] , 165,312, 16,16 button #sis2.cal,"Calcular",[calcular] ,UL,395,352, 45,20 button #sis2.seg,"Terminar",[closeSis2],UL,445,352, 45,20TexteditorColor$="white"Texteditor #sis2.pi, 220, 12, 320, 150'*************************************statictext #sis2,"Altura de la edificacion sobre rasante en m.",220,164,160,32 textbox #sis2.h, 385,167, 40,20statictext #sis2, "Coeficiente de forma" , 240,195,120,13 checkbox #sis2.CdF,"",[siCdF],[noCdF] , 220,196, 13,13statictext #sis2, "Factor de distribucion", 240,208,120,13 checkbox #sis2.FdD,"",[siFdD],[noFdD] , 220,208, 13,13statictext #sis2, "Coeficiente sismico" , 240,221,120,13 checkbox #sis2.CdS,"",[siCdS],[noCdS] , 220,221, 13,13statictext #sis2, "Fuerza sismica estatica",240,233,150,13 checkbox #sis2.FsH,"",[siFsH],[noFsH] , 220,233, 13,13statictext #sis2, "Cortante de cada planta",240,246,150,13 checkbox #sis2.FsH,"",[siCdP],[noCdP] , 220,246, 13,13

statictext #sis2,"Periodo caracteristico del espectro de respuesta B (s)",220,262,160,40 textbox #sis2.peCaB, 385,262, 40,20statictext #sis2,"Periodo coe.alfa",270,292,100,20statictext #sis2," Modo 1",220,312,50,20 textbox #sis2.T1, 270,312,40,20 textbox #sis2.coAlf1, 315,312,40,20statictext #sis2," Modo 2",220,332,50,20 textbox #sis2.T2, 270,332,40,20 textbox #sis2.coAlf2, 315,332,40,20statictext #sis2," Modo 3",220,352,50,20 textbox #sis2.T3, 270,352,40,20 textbox #sis2.coAlf3, 315,352,40,20

open "Calculo sismico 2ª " for dialog as #sis2'---------------------------------------------#sis2.pi "!cls"#sis2 "trapclose [closeSis2]";#sis2 "font ";f.a8$;#sis2.pi "!font ";f.a8$#sis2.3, "set"#sis2.6, "set"if CdS=1 then #sis2.CdS, "set"propi(16) = 1else#sis2 "cls";end ifwait'......................[calcular]'*********dim al.pi(40), altur(40), lineaS$(40), Nu.sis(40)#sis.p "!contents? ndp"#sis.d "!contents? dime"#sis.masa "!contents? masa";

ndp=0

Page 27: porti_29

for n=2 to Nnu if y(n)>y(n-1) then ndp=ndp+1: al.pi(ndp)=y(n)-y(n-1):altur(ndp)=y(n):Nu.sis(ndp)=n next nif ndp=0 then ndp=1#sis.p ndp

dim masa$(ndp), masa(ndp),dime$(ndp),dime(ndp)for n=1 to ndp dime(n)=dime dime$(n)=str$(dime(n))next n

if linea$="" thenlineaS$(1)="a"for n=2 to ndp+1 lineaS$(n)=" ";d0$(Nu.sis(n-1));" ";d2$(al.pi(n-1));" ";d2$(altur(n-1));" ";d2$(dime(n-1))nextend if

dim al.pi$(ndp), altur$(ndp), coFor(ndp,3)dim faDis(ndp,3), coSis(ndp,3), FuSis(ndp,3), CoPla(ndp,3), CoCom(ndp)dim altur(ndp)TF=0

for n=1 to 3: T(n)=0:next#sis2.T1 " "#sis2.T2 " "#sis2.T3 " "#sis.r "!contents? panta"'................................for n=1 to ndp+1 'alturas de piso y totales if lineaS$(n)<>"" then if n>1 then #sis2.pi, "!line ";n;" ";" lin$"; if lin$<>"" then al.pi$(n-1)=word$(lin$ ,2):al.pi(n-1)=val(al.pi$(n-1)) dime$(n-1) =word$(lin$ ,4):dime(n-1) =val(dime$(n-1)) end if end if end ifnext

altu=0#sis2.pi "!cls ";#sis2.pi "Nudo h s/r dime masa Modo1 Modo2 Modo3"

altur(0)=0

for n=1 to ndp masa(n)=masa*dime(n) if al.pi(n)=0 then al.pi(n)=3 if altur(n)=0 then altur(n)=3*n

lineaS$(n)=" ";d0$(Nu.sis(n));" ";d2$(al.pi(n));" ";d2$(altur(n));" ";d2$(dime(n)) al.pi$(n)=word$(lineaS$(n) ,2) al.pi(n)=val(al.pi$(n)) dime$(n)=word$(lineaS$(n) ,4) dime(n)=val(dime$(n)) altur(n)=altur(n-1)+al.pi(n) lineaS$(n)=" ";d0$(Nu.sis(n));" ";d2$(al.pi(n));" ";d2$(altur(n));" ";d2$(dime(n))

next

altu=altur(ndp)#sis2.h altu'................................for n=1 to ndp 'coeficiente de forma for m=1 to 3 coFor(n,m)=sin((2*m-1)*pi*altur(n)/2/altu)next:next

for m=1 to 3: suma(m)=0:suma2(m)=0:next mfor n=1 to ndp if masa(n)=0 then masa(n)=masa for m=1 to 3 suma(m) =suma(m) +masa(n)* coFor(n,m) suma2(m)=suma2(m)+masa(n)*(coFor(n,m)^2)next:next

for n=1 to ndp 'factor de distribucion for m=1 to 3 faDis(n,m)=coFor(n,m)*suma(m)/suma2(m)next:next'................................Periodo fundamental if TF1=1 then if dime=0 then notice "Indicar dimension en el plano de oscilacion": wait TF=0.06*altu*sqr(altu/(2*dime+altu))/sqr(dime) end if if TF2=1 then TF=0.09*ndp if TF3=1 then TF=0.07*ndp*sqr(altu/(panta+altu)) if TF4=1 then TF=0.11*ndp if TF5=1 then TF=0.085*ndp*sqr(altu/(panta+altu)) For n=1 to 3:T(n)=TF/(2*n-1):next#sis.TF TF#sis2.T1 T(1)if TF>0.75 then #sis2.T2 T(2)if TF>1.25 then #sis2.T3 T(3)'................................if coN=1 then coe.ris=1 'coeficiente de riesgoif coE=1 then coe.ris=1.3#sis.TiCon coe.ris

#sis.Et1 "!contents? E.t1"#sis.Et2 "!contents? E.t2"#sis.Et3 "!contents? E.t3"#sis.Et4 "!contents? E.t4"#sis.coeCon "!contents? coe.Con" 'coeficiente de contribucion 'coeficiente del terrenocoef.Te=(E.t1*co.te1+E.t2*co.te2+E.t3*co.te3+E.t4*co.te4)/(E.t1+E.t2+E.t3+E.t4)#sis.coTe coef.Te

pe.CaB=coe.Con*coef.Te/2.5 'Periodo caracteristico B#sis2.peCaB pe.CaB'.................................coeficiente alfafor n=1 to 3if T(n)<=pe.CaB then coef.alfa(n)=2.5if T(n)> pe.CaB then coef.alfa(n)=2.5*pe.CaB/T(n)next n#sis2.coAlf1 coef.alfa(1)#sis2.coAlf2 coef.alfa(2)#sis2.coAlf3 coef.alfa(3)'.................................#sis.asb "!contents? asb" 'aceleracion sismica basica

Page 28: porti_29

a=coe.ris*asb 'coeficiente de amplificacion del terrrenoif a<=0.1 then co.am.te=coef.Te/1.25if a>0.1 and a<0.4 then co.am.te=coef.Te/1.25+3.33*(a-0.1)*(1-coef.Te/1.25)if a>=0.4 then co.am.te=1#sis.cAt co.am.te

aSc=co.am.te*coe.ris*asb 'aceleracion sismica de calculo#sis2.aSc aSc#sis2.Duc ducti 'ductibilidadcoef.resp=Fa.mo.es/ducti 'coeficiente de respuesta#sis2.coRe u3$(coef.resp)'.................................coeficiente sismicofor n=1 to ndp for m=1 to 3 coSis(n,m)=aSc*coef.alfa(m)*coef.resp*faDis(n,m) FuSis(n,m)=coSis(n,m)*masa(n)next:next

for m=1 to 3 CoPla(ndp,m)=FuSis(ndp,m) for n= ndp-1 to 1 step-1 CoPla(n,m)=CoPla(n+1,m)+FuSis(n,m)next:next

for n=1 to ndp CoCom(n)=sqr(CoPla(n,1)^2+CoPla(n,2)^2+CoPla(n,3)^2)nextfor n=1 to ndp-1 FuEEq(n)=CoCom(n)-CoCom(n+1)next FuEEq(ndp)=CoCom(ndp)

for n=1 to ndp masa$(n)=str$(masa(n)) if CdF=1 then lineaS$(n)=lineaS$(n)+" "+t2$(masa(n))+" "+t2$(coFor(n,1))+_ " "+t2$(coFor(n,2))+" "+t2$(coFor(n,3)) if FdD=1 then lineaS$(n)=lineaS$(n)+" "+t2$(masa(n))+" "+t2$(faDis(n,1))+_ " "+t2$(faDis(n,2))+" "+t2$(faDis(n,3)) if CdS=1 then lineaS$(n)=lineaS$(n)+" "+t2$(masa(n))+" "+t2$(coSis(n,1))+_ " "+t2$(coSis(n,2))+" "+t2$(coSis(n,3)) if FsH=1 then lineaS$(n)=lineaS$(n)+" "+t2$(masa(n))+" "+t2$(FuSis(n,1))+_ " "+t2$(FuSis(n,2))+" "+t2$(FuSis(n,3)) if CdP=1 then lineaS$(n)=lineaS$(n)+" "+t2$(masa(n))+" "+t2$(CoPla(n,1))+_ " "+t2$(CoPla(n,2))+" "+t2$(CoPla(n,3))+_ " "+t2$(CoCom(n)) +" "+t2$(FuEEq(n)) #sis2.pi, lineaS$(n)nextwait'*****************************************[seguir] #sis.p "!contents? ndp" if propi(16)=0 then goto [sismo2]wait'...............[si1] TF1=1:wait[no1] TF1=0:wait[si2] TF2=1:wait[no2] TF2=0:wait[si3] TF3=1:wait[no3] TF3=0:wait[si4] TF4=1:wait[no4] TF4=0:wait

[si5] TF5=1:wait[no5] TF5=0:wait'---------------[si.cN] coN=1:wait[no.cN] coN=0:wait[si.cE] coE=1:wait[no.cE] coE=1:wait'----------------[si.tt1] co.te1=1:wait[no.tt1] wait[si.tt2] co.te2=1.3:wait[no.tt2] wait[si.tt3] co.te3=1.6:wait[no.tt3] wait[si.tt4] co.te4=2:wait[no.tt4] wait'...................[siDu1] ducti=4:wait[noDu1] wait[siDu2] ducti=3:wait[noDu2] wait[siDu3] ducti=2:wait[noDu3] wait[siDu4] ducti=1:wait[noDu4] wait'...................[siRe1] Fa.mo.es=1.09:wait[noRe1] wait[siRe2] Fa.mo.es=1:wait[noRe2] wait[siRe3] Fa.mo.es=0.93:wait[noRe3] wait'.................[siCdF] CdF=1:wait[noCdF] CdF=0:wait[siFdD] FdD=1:wait[noFdD] FdD=0:wait[siCdS] CdS=1:wait[noCdS] CdS=0:wait[siFsH] FsH=1:wait[noFsH] FsH=0:wait[siCdP] CdP=1:wait[noCdP] CdP=0:wait'.................[closeSis] call closeSismo :waitsub closeSismo if propi(15)=1 then close #sis: propi(15)=0end sub

[closeSis2] call closeSismo2 :waitsub closeSismo2 if propi(16)=1 then close #sis2: propi(16)=0end sub

'------------------------------------------------------[perfil]open "perfiles.dat" for input as #perfwhile eof(#perf)=0 line input #perf, per$ if left$(per$,1)<>"." then if tipo.perfil$=per$ then t.p=1 if t.p=1 and perfil$=left$(per$,3) then

Page 29: porti_29

#1.perfil per$ perfil.tabla$= word$(per$,1) h.t =val(word$(per$,2)) b.t =val(word$(per$,3)) peso.t =val(word$(per$,4)) iner.tabla=val(word$(per$,5)) iner.y =val(word$(per$,6)) area.tabla=val(word$(per$,7)) exit while end if end ifwendclose #perfreturn'-------[tabla]open "perfiles.dat" for input as #perf#1.perfil "!cls"#1.perfil tipo.perfil$;" h b peso InerX InerY Area"while eof(#perf)=0 line input #perf, per$ if tipo.perfil$=per$ and len(per$)<5 then t.p=1 if tipo.perfil$<>per$ and len(per$)<5 then t.p=0 if t.p=1 and len(per$)>5 then #1.perfil per$ end ifwendclose #perfreturn

[IPN] tipo.perfil$="IPN":gosub [tabla]:wait[IPE] tipo.perfil$="IPE":gosub [tabla]:wait[IPH] tipo.perfil$="IPH":gosub [tabla]:wait[UPN] tipo.perfil$="UPN":gosub [tabla]:wait[ALV] tipo.perfil$="ALV":gosub [tabla]:wait