You can pass a list to lambdify and it will create a function that
returns a list, like

lambdify(tt, [fvecx, fvecy, fvecz])

Aaron Meurer

On Tue, Jun 28, 2016 at 4:44 PM, Poul Riis <[email protected]> wrote:
> The example below works but I would like to do something like
> fvec=vector([tt*sin(tt),tt*cos(tt),sqrt(tt)])
> in stead of
> fvecx=tt*sin(tt)
> fvecy=tt*cos(tt)
> fvecz=sqrt(tt)
> Is that possible? If yes, how?
>
>
> Poul Riis
>
>
>
>
> from math import *
> from sympy import *
>
>
> tt=Symbol('tt')
> fvecx=tt*sin(tt)
> fvecy=tt*cos(tt)
> fvecz=sqrt(tt)
> fvecxlambdified = lambdify(tt, fvecx)
> fvecylambdified = lambdify(tt, fvecy)
> fveczlambdified = lambdify(tt, fvecz)
> fvecxdiff=fvecx.diff(tt)
> fvecxdifflambdified=lambdify(tt,fvecxdiff)
> fvecydiff=fvecy.diff(tt)
> fvecydifflambdified=lambdify(tt,fvecydiff)
> fveczdiff=fvecz.diff(tt)
> fveczdifflambdified=lambdify(tt,fveczdiff)
>
>
> print("fx(1)=",fvecxlambdified(1))
> print("fy(1)=",fvecylambdified(1))
> print("fz(1)=",fveczlambdified(1))
>
>
> print("fx'(1)=",fvecxdifflambdified(1))
> print("fy'(1)=",fvecydifflambdified(1))
> print("fz'(1)=",fveczdifflambdified(1))
>
> --
> 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/9050bf01-19e2-423a-8467-f2175e21275f%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%3D6%2BZJcSiAfCQos%3DVrZzbpev7scBpzdHsvB17uC3de7VFrw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to