def read_inc(): nn,N,nm,Inc,nc,F,nr,R = importa('entrada.xlsx') # matrix_inc_1 = Inc[:,0] # matrix_inc_2 = Inc[:,1] # matrix_inc = np.matrix([matrix_inc_1, matrix_inc_2]) # return matrix_inc return Inc
def __init__(self, entry): [nn, N, nm, Inc, nc, F, nr, R] = importa(entry) self.n_nodes = nn self.nodes_matrix = nn self.n_members = nm self.incidence_matrix = Inc self.n_charges = nc self.loading_vector = F self.n_restrictions = nr self.restriction_vector = R
def ler_nos(): [nn, N, nm, Inc, nc, F, nr, R] = importa("entrada.xlsx") return N
from xlsx import importa import numpy as np nn,N,nm,Inc,nc,F,nr,R = importa('entrada.xlsx') def read_inc(): nn,N,nm,Inc,nc,F,nr,R = importa('entrada.xlsx') # matrix_inc_1 = Inc[:,0] # matrix_inc_2 = Inc[:,1] # matrix_inc = np.matrix([matrix_inc_1, matrix_inc_2]) # return matrix_inc return Inc def calculate_sin(co, hip): sin = co/hip return sin def calculate_cos(ca, hip): cos = ca/hip return cos matrix_inc = read_inc() for i print(len(matrix_inc)) matrix_kg = np.zeros([len(matrix_inc)*2,len(matrix_inc)*2]) print(matrix_kg)
def generate_restriction_vector(self, load_vector, restrition_vector_origin): restriction_vector = np.zeros(len(load_vector)) + 1 for i in restrition_vector_origin: restriction_vector[int(i)] = 0 return restriction_vector # vigas = [] # for i in range(len(list_knots)): # viga = Viga(list_nodes[int(list_knots[i][0]-1)], list_nodes[int(list_knots[i][1]-1)], list_A[i], list_E[i], list_knots[i]) # vigas.append(viga) #Importing Excel nn, N, nm, Inc, nc, F, nr, R = xl.importa("entrada.xlsx") #Ploting Graph xl.plota(N, Inc) #Starting App app = App(nn, N, nm, Inc, nc, F, nr, R) #Constructing Lists and Vectors list_nodes = app.generate_list_nodes() list_A = app.generate_list_A() print(list_A) list_E = app.generate_list_E() list_knots = app.generate_list_knots() restriction_vector_origin = app.generate_restriction_vector_origin() load_vector = app.generate_load_vector()