Está en la página 1de 3

#Importamos los módulos necesarios

from scipy import linalg


from pylab import *
import matplotlib.pyplot as plt
import matplotlib.colors as colors
from matplotlib import collections

#Definimos las fuerzas aplicada en KN (kilonewtons)


Q = 500
FA = 0.0
FD = 0.0
FF = 0.0
FB = 0.0

#Se definen las longitudes de las barras y la total

#Longitud total
L = 12.0

#Longitud de la barra
LB = 4.0
l1 = 0.0
l2 = 0.0

#Distancia a la que se irá moviento la fuerza F


dl = 2

#Creamos el arreglo de la matriz de la armadura


#Definimos las ecuaciones de fuerzas en los nodos

#Matriz de incógnitas
HG=array(['Rax','Ray','Rby','Fac','Fad','Fcd','Fce','Fdf','Fde','Feg','Fef','Ffb','Ffg','Fgb'])

#NODO A
AX = array([1,0,0,2/sqrt(13),1,0,0,0,0,0,0,0,0,0])
AY = array([0,1,0,3/sqrt(13),0,0,0,0,0,0,0,0,0,0])
#NODO C
CX = array([0,0,0,-2/sqrt(13),0,2/sqrt(13),1,0,0,0,0,0,0,0])
CY = array([0,0,0,-3/sqrt(13),0,-3/sqrt(13),0,0,0,0,0,0,0,0])
#NODO D
DX = array([0,0,0,0,-1,-2/sqrt(13),0,1,2/sqrt(13),0,0,0,0,0])
DY = array([0,0,0,0,0,3/sqrt(13),0,0,3/sqrt(13),0,0,0,0,0])
#NODO E
EX = array([0,0,0,0,0,0,-1,0,-2/sqrt(13),1,2/sqrt(13),0,0,0])
EY = array([0,0,0,0,0,0,0,0,-3/sqrt(13),0,-3/sqrt(13),0,0,0])
#NODO F
FX = array([0,0,0,0,0,0,0,-1,0,0,-2/sqrt(13),1,2/sqrt(13),0])
FY = array([0,0,0,0,0,0,0,0,0,0,3/sqrt(13),0,3/sqrt(13),0])
#NODO G
GX = array([0,0,0,0,0,0,0,0,0,-1,0,0,-2/sqrt(13),2/sqrt(13)])
GY = array([0,0,0,0,0,0,0,0,0,0,0,0,-3/sqrt(13),-3/sqrt(13)])
#NODO B
BX = array([0,0,0,0,0,0,0,0,0,0,0,-1,0,-2/sqrt(13)])
BY = array([0,0,1,0,0,0,0,0,0,0,0,0,0,3/sqrt(13)])

#Creamos el bucle para que la fuerza f se recorra a lo largo de la armadura


for x in arange(0,L+dl, dl, dtype=float):
#Matriz de equilibrio de fuerzas
ME = array([AX,AY,CX,CY,DX,DY,EX,EY,FX,FY,GX,GY,BX,BY])
#Matriz de fuerzas resultatntes en los nodos
For = array([0,0,0,0,0,0,0,0,0,0,0,0,0,0], dtype= float)
#Condicionales para los distintos casos
if x < 4 and x != 0:
l1 = x/LB
l2 = (4-x)/LB
For[1] = Q*l1
For[5] = Q*l2
if x == 0:
For[1] = Q
if x == 4:
For[5]=Q
if x == 8:
For[9]=Q

else:
if x > 4 and x < 8:
l2 = (8-x)/LB
l1 = (x-4)/LB
For[5] = Q*l2
For[9] = Q*l1
else:
if x > 8 and x < L:
l2 = (12-x)/LB
l1 = (x-8)/LB
For[9] = Q*l1
For[13] = Q*l2

else:
if x == 12:
For[13] = Q

También podría gustarte