示例#1
0
 def setup(self):
     # Define a mode shape with deflection x^2 in the y direction
     self.x = x = arange(0, 10.1, 1)
     self.L = self.x[-1]
     zero = 0 * x
     shapes = c_[zero, x**2, zero].reshape((len(x), 3, 1))
     rotations = c_[zero, 2 * x, zero].reshape((len(x), 3, 1))
     self.modes = ModalRepresentation(x,
                                      freqs=[1],
                                      shapes=shapes,
                                      rotations=rotations)
    def setup(self):
        x = linspace(0, self.length, 50)
        density = self.mass / self.length
        # One mode shape: linear in z direction.
        shape = linspace(0, 1, 50)
        rotation = -np.ones(50) / self.length
        shapes = c_[0 * x, 0 * x, shape].reshape((len(x), 3, 1))
        rotations = c_[0 * x, rotation, 0 * x].reshape((len(x), 3, 1))

        # Natural frequency: w^2 = k/I
        I0 = self.mass * (self.length**2 / 3)  # inertia about end
        freq = (self.stiffness / I0)**0.5
        modes = ModalRepresentation(x, density, shapes, rotations, [freq])
        self.beam = ModalElement('beam', modes)
def make_a_modal_beam(length, density=None, section_inertia=None):
    x = linspace(0, length, 10)
    modes = ModalRepresentation(x, density, section_inertia=section_inertia)
    beam = ModalElement('beam', modes)
    return beam
def _mock_rigid_uniform_modes(density, length):
    """Return empty modal representation of 20m long rigid beam"""
    x = arange(0, length + 0.01)
    return ModalRepresentation(x, density * ones_like(x))
示例#5
0
 def setup(self):
     self.x = arange(0, 10.1, 1)
     self.L = self.x[-1]
     self.modes = ModalRepresentation(self.x)