Пример #1
0
    def test_deflection_under_load(self):
        F = 4.2  # N/m
        M = (F * self.length) * (self.length / 2)
        expected_rotation = M / self.stiffness
        expected_tip_motion = expected_rotation * self.length

        # First, calculate directly
        loading = zeros((50, 3))
        loading[:, 2] = F
        Qr, Qw, Qs = self.beam.modes.distributed_loading(loading, [0])
        actual_tip_motion = Qs / self.beam.stiffness

        assert_aae(actual_tip_motion[0], expected_tip_motion, decimal=4)

        # Now check using system equilibrium
        self.beam.loading = lambda beam, time: loading
        system = System()
        system.add_leaf(self.beam)
        system.setup()
        system.find_equilibrium()
        actual_tip_motion2 = system.q[system.elements['beam'].istrain]
        assert_aae(actual_tip_motion2[0], expected_tip_motion, decimal=4)
Пример #2
0
    def test_deflection_under_load(self):
        F = 4.2  # N/m
        M = (F * self.length) * (self.length / 2)
        expected_rotation = M / self.stiffness
        expected_tip_motion = expected_rotation * self.length

        # First, calculate directly
        loading = zeros((50, 3))
        loading[:, 2] = F
        Qr, Qw, Qs = self.beam.modes.distributed_loading(loading, [0])
        actual_tip_motion = Qs / self.beam.stiffness

        assert_aae(actual_tip_motion[0], expected_tip_motion, decimal=4)

        # Now check using system equilibrium
        self.beam.loading = lambda beam, time: loading
        system = System()
        system.add_leaf(self.beam)
        system.setup()
        system.find_equilibrium()
        actual_tip_motion2 = system.q[system.elements['beam'].istrain]
        assert_aae(actual_tip_motion2[0], expected_tip_motion, decimal=4)
Пример #3
0
    def test_find_equilibrium(self):
        g = 9.81
        m = 23.1
        k = 45.2
        s = System(gravity=g)
        slider = PrismaticJoint('slider', [0, 0, 1])
        slider.stiffness = k
        body = RigidBody('body', mass=m)
        s.add_leaf(slider)
        slider.add_leaf(body)
        s.setup()

        # Initially position should be zero and acceleration nonzero
        s.solve_accelerations()
        assert_aae(slider.xstrain, 0)
        assert_aae(slider.astrain, -g)

        # At equilibrium, position should be nozero and force on body zero
        s.find_equilibrium()
        s.update_matrices()      # recalculate stiffness force
        s.solve_accelerations()
        assert_aae(slider.xstrain, -m * g / k)
        assert_aae(slider.astrain, 0)