def view_abd(self, event=None): '''Computes ABD matrix and shows it''' try: path = self._save_path if path is None: raise ValueError except: self.save_as() path = Path(path) A, B, D, _ = calculate_ABD(lam_file=path.parts[-1], lam_dir=str(path.parent) + '\\', mat_dir=str(path.parent) + '\\') t = tk.Toplevel(self) abd = ABDInputFrame(t) abd.display_mode = True abd.a_frame.A = A abd.b_frame.B = B abd.d_frame.D = D abd.grid()
import numpy as np from abd import calculate_ABD, get_layers A, B, D, layers = calculate_ABD(lam_file='takehome.csv', lam_dir='designlib/takehomeproblem/', mat_dir='designlib/takehomeproblem/') # print('A = \n{}\n'.format(A)) # print('B = \n{}\n'.format(B)) # print('D = \n{}'.format(D)) AB = np.append(A, B, axis=1) BD = np.append(B, D, axis=1) ABD = np.append(AB, BD, axis=0) # applied strain strains = np.array([0, 0, 0, 1 / 254, 0, 0]).T # compute strains from loads, matrix multiplication loads = ABD @ strains print() print('Loads:') print(loads)
import numpy as np from abd import calculate_ABD, get_layers A, B, D = calculate_ABD(lam_file='problem4.csv', lam_dir='designlib/hw4/', mat_dir='designlib/hw4/') layers = get_layers(lam_file='problem4.csv', lam_dir='designlib/hw4/', mat_dir='designlib/hw4/') # print('A = \n{}\n'.format(A)) # print('B = \n{}\n'.format(B)) # print('D = \n{}'.format(D)) AB = np.append(A, B, axis=1) BD = np.append(B, D, axis=1) ABD = np.append(AB, BD, axis=0) # applied load applied_loads = np.array([0, 0, 0, -900, 0, 0]).T # allowable loads, matrix multiplication strains = np.linalg.inv(ABD) @ applied_loads K = strains[3:] # compute stress in bottom layer bottom_layer = layers[0] stress = bottom_layer.Q @ K * bottom_layer.z_lower
import numpy as np from abd import calculate_ABD, get_layers A,B,D, layers = calculate_ABD( lam_file='BladeLaminateCored.csv', lam_dir='designlib/project/', mat_dir='designlib/project/' ) # print('A = \n{}\n'.format(A)) # print('B = \n{}\n'.format(B)) # print('D = \n{}'.format(D)) AB = np.append(A,B,axis=1) BD = np.append(B,D,axis=1) ABD = np.append(AB,BD,axis=0) # applied load applied_loads = np.array([ 0, 0, 0, 1695, 0, 0 ]).T # compute strains from loads, matrix multiplication strains = np.linalg.inv(ABD) @ applied_loads e = strains[:3]