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

All Samples(5)  |  Call(5)  |  Derive(0)  |  Import(0)
Used to set the potential energy of the Particle.

Parameters
==========

scalar : Sympifyable
    The potential energy (a scalar) of the Particle.

Examples
========(more...)

src/s/y/sympy-HEAD/sympy/physics/mechanics/tests/test_particle.py   sympy(Download)
    assert p.linear_momentum(N) == m2 * (v1 * N.x + v2 * N.y + v3 * N.z)
    assert p.angular_momentum(O, N) == m2 * r * (v3 * N.x - v1 * N.z)
    p.set_potential_energy(m * g * h)
    assert p.potential_energy == m * g * h
    # TODO make the result not be system-dependent

src/s/y/sympy-HEAD/sympy/physics/mechanics/tests/test_lagrange.py   sympy(Download)
    # Lagrangian generated.
    Pa = Particle('Pa', P, m)
    Pa.set_potential_energy(- m * g * l * cos(q))
    L = Lagrangian(N, Pa)
 
    ParR = Particle('ParR', R, m)
 
    ParP.set_potential_energy(- m * g * l * cos(q1))
    ParR.set_potential_energy(- m * g * l * cos(q1) - m * g * l * cos(q2))
    L = Lagrangian(N, ParP, ParR)

src/s/y/sympy-HEAD/sympy/physics/mechanics/tests/test_functions.py   sympy(Download)
    I = outer(N.z, N.z)
    A = RigidBody('A', Ac, a, M, (I, Ac))
    Pa.set_potential_energy(m * g * h)
    A.set_potential_energy(M * g * H)
    assert potential_energy(A, Pa) == m * g * h + M * g * H