def setUp(self): # FE model for beam - no modes, i.e. rigid x = linspace(0, self.length, 20) density = (2 * self.mass / self.length) * (1 - x / self.length) fe = BeamFE(x, density=density, EA=0, EIy=1, EIz=0) fe.set_boundary_conditions('C', 'F') self.beam = ModalElementFromFE('beam', fe, 0) # Set loading - in Z direction load = np.zeros((len(x), 3)) load[:, 2] = self.force self.beam.loading = load # Offset from hinge axis self.conn = RigidConnection('offset', [self.offset, 0, 0]) # Hinge with axis along Y axis self.hinge = Hinge('hinge', [0, 1, 0]) # Build system self.system = System() self.system.add_leaf(self.hinge) self.hinge.add_leaf(self.conn) self.conn.add_leaf(self.beam) self.system.setup() self.system.update_kinematics() # Set up nodal values initially
def setUp(self): # FE model for beam - no modes, i.e. rigid self.x = x = linspace(0, self.length, 20) fe = BeamFE(x, density=2, EA=0, EIy=0, EIz=0) # Build the elements self.shaft = Hinge('shaft', [1, 0, 0]) self.roots = [] self.blades = [] self.pitch_bearings = [] for ib in range(1): R = rotations(('x', ib * 2 * pi / 3), ('y', -pi / 2)) root_offset = dot(R, [self.root_length, 0, 0]) root = RigidConnection('root%d' % (ib + 1), root_offset, R) bearing = Hinge('pitch%d' % (ib + 1), [1, 0, 0]) blade = ModalElementFromFE('blade%d' % (ib + 1), fe, 0) self.shaft.add_leaf(root) root.add_leaf(bearing) bearing.add_leaf(blade) self.roots.append(root) self.blades.append(blade) self.pitch_bearings.append(bearing) # Build system self.system = System() self.system.add_leaf(self.shaft) self.system.setup() self.system.update_kinematics() # Set up nodal values initially self.system.update_matrices()
def test_static_deflection(self): x = array([0.0, 4.0, 10.0]) EI = 144.0 # Using the z axis as the transverse direction gives the same # sign convention as Reddy uses in 2D, namely that rotations # are positive clockwise. fe = BeamFE(x, density=10, EA=0, EIy=EI, EIz=0) fe.set_boundary_conditions('C', 'F') fe.set_dofs([False, False, True, False, True, False]) element = ModalElementFromFE('elem', fe) # Distributed load, linearly interpolated load = np.zeros((3, 3)) load[-1, 2] = -100 # Load in z direction at tip element.apply_distributed_loading(load) defl = -element.applied_stress / np.diag(element.K) # Check against directly calculating static deflection from FE Q = fe.distribute_load(interleave(load, 6)) defl_fe, reactions_fe = fe.static_deflection(Q) assert_aae(dot(element.shapes, defl), defl_fe, decimal=2)
def setUp(self): x = linspace(0, self.L, 15) fe = BeamFE(x, density=self.m, EA=0, EIy=self.EI, EIz=0) fe.set_boundary_conditions('C', 'F') fe.set_dofs([False, False, True, False, True, False]) beam = ModalElementFromFE('beam', fe, num_modes=1, damping=self.damping_coeff) system = System() system.add_leaf(beam) system.setup() system.update_kinematics() self.beam, self.system = beam, system
def test_first_mode_frequency(self): # From Reddy1993, p. 160 x = np.linspace(0, 1, 16) # Using the z axis as the transverse direction gives the same # sign convention as Reddy uses in 2D, namely that rotations # are positive clockwise. fe = BeamFE(x, density=1, EA=0, EIy=1, EIz=0) fe.set_boundary_conditions('C', 'F') fe.set_dofs([False, False, True, False, True, False]) element = ModalElementFromFE('elem', fe) Mmodal = element.mass_ee Kmodal = element.K w = np.sqrt(np.diag(Kmodal) / np.diag(Mmodal)) assert_aae(w[0], 3.5160, decimal=4)
def test_rigid_element_reference_loading(self): # Make an element with no modes (rigid) fe = BeamFE(np.linspace(0, 1, 11), density=1, EA=0, EIy=1, EIz=0) fe.set_boundary_conditions('C', 'F') fe.set_dofs([False, False, True, False, True, False]) element = ModalElementFromFE('elem', fe, 0) # Distributed load, linearly interpolated load = np.zeros((11, 3)) load[:, 2] = -100 # Uniform load in z direction element.apply_distributed_loading(load) assert_aae(element.applied_stress, []) assert_aae(element.applied_forces[0:6], [0, 0, -100 * 1, 0, 50, 0]) assert_aae(element.applied_forces[6:12], 0) # Distributed load, triangle at tip load = np.zeros((11, 3)) load[-1, 2] = -100 # tapered load in z direction element.applied_forces[:] = 0 # reset element.apply_distributed_loading(load) F = -100 * 0.1 / 2 assert_aae(element.applied_forces[0:6], [0, 0, F, 0, -F * (0.9 + 0.1 * 2 / 3), 0]) assert_aae(element.applied_forces[6:12], 0)