Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(4)  |  Derive(0)  |  Import(0)
Method to form Lagrange's equations of motion.

Returns a vector of equations of motion using Lagrange's equations of
the second kind.

src/s/y/sympy-HEAD/sympy/physics/mechanics/tests/test_lagrange.py   sympy(Download)
    coneq = [yd - R * thetad]
    m = LagrangesMethod(L, q, coneq)
    m.form_lagranges_equations()
    assert m.rhs()[2] == 2*g*sin(alpha)/3
 
    # The 'LagrangesMethod' class is invoked to obtain equations of motion.
    lm = LagrangesMethod(L, [q])
    lm.form_lagranges_equations()
    RHS = lm.rhs()
    assert RHS[1] == -g*sin(q)/l
    L = Lagrangian(N, ParP, ParR)
    lm = LagrangesMethod(L, [q1, q2])
    lm.form_lagranges_equations()
 
    assert simplify(l*m*(2*g*sin(q1) + l*sin(q1)*sin(q2)*q2dd
    q3 = Function('q3')
    l = LagrangesMethod(Lag, q)
    l.form_lagranges_equations()
    RHS = l.rhs()
    RHS.simplify()