[Python] python jupyter simplify equality with 2 expression doesn't work and cannot put...

Discussão em 'Python' iniciado por Stack, Setembro 23, 2024.

  1. Stack

    Stack Membro Participativo

    From this code :

    Declare symbols :

    from sympy import *
    r,l,c=symbols('r,l,c', real=True)


    The first equation :

    b=sqrt(2)*sqrt((-r**2/l + 2/c)/l)/2
    display(b.simplify())
    display(b.subs({r:1,l:2,c:3}))


    [​IMG]

    Second equation :

    d=sqrt(-c**2*r**2+2*c*l)/(sqrt(2)*c*l)
    display(d.simplify())
    display(d.subs({r:1,l:2,c:3}))


    [​IMG]

    There are equals but not here :

    display(simplify(b-d) == 0)


    False
    ​

    h=simplify(b-d)
    display(simplify(h))


    It cannot be simplified [​IMG]
    ​

    I have 2 questions :

    1. How cant I get equation in 2 lines (pretty print ) like the 'd' equation ?
    2. How to retrieve equality ?

    Thanks

    Continue reading...

Compartilhe esta Página