The evalf method of the expression (like expr.evalf()) will evaluate all the parts of the expression that it can to floating point numbers.
Aaron Meurer On Fri, Sep 28, 2018 at 10:15 AM, scurrier <[email protected]> wrote: > I have a Vector whose components are long expressions. I'd like to evaluate > them so I can see the numerical value of the components. Is there an easy way > to do so? > > Seems like it should be simpler than the easiest way that I can come up with, > which involves taking dot products. I was hoping for one function or method > that could do this. > > Specifically, the Vectors are sympy.physics.vector.vector.Vector objects. To > give you an idea what mine look like, they are in a form kind of like this, > but much longer: > (243 + cos(0.362)) * myframe.x + (sin(0.381) + 5) * my frame.y > > I'd like to evaluate them to end up with something like this: > 243.9351 * myframe.x + 5.371 * myframe.y > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/sympy. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sympy/b6a28405-c9fc-4d25-83fa-cd5c6c3bd40a%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAKgW%3D6KzUqmXbfkFuGBs2V%3DXzxtPBiAt9uwkp4a52R_WHtXBdg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
