hey all!

I have a vector with symbolic variables in it:
In [1]: from sympy import *
In [2]: import scipy as s
In [3]: t,x,z,phi = symbols('t','x','z','phi')
In [4]: vec = s.array([cos(phi(t)),x(t),z(t)])

Now, I define the derivative w.r.t time 't'
In [5]: dvec = diff(vec,t)
In [6]: dvec
Out[6]: [-sin(phi(t))*D(phi(t), t), D(x(t), t), D(z(t), t)]

I need to compute the unit vector along the direction of 'dvec', but I
get the following error:

In [7]: evec = dvec/sqrt(s.dot(dvec,dvec))
TypeError: unsupported operand type(s) for /: 'list' and 'Pow'

Any clue how to circumvent this? I guess the problem comes from the
'D(blah(t),t)' in the expression of dvec. I's rather not do a 'subs',
for which I obtain nothing. See my test below:

In [8]: dvec[1].subs(diff(x(t),t),dx)
Out[8]: D(x(t), t)

thanks for any suggestions!
Astozzia

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sympy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to