You may want to use the method I used while hacking the old mechanics module to do the kind of re-expression we want to achieve. say a vector v from frame A to frame B First, we need to calculate the coordinate variables of frame A in terms of those of B. We can do this using - [vector of A's vars] = [Pos-vector of B wrt A] + DCM(A, B) * [vector of B's vars] In above equation, don't take the LHS as a 'vector field'. It's just a column matrix with the respective symbols denoting coordinate variables of A. Comparing the entries in LHS and RHS will help you contrust a dict mapping A.x, A.y and A.z in terms of B.x, B.y, B.z
Use the sympy subs method on v to remove A.x, A.y and A.z from its expression. Suppose we now get v1 Then just do [final vector] = DCM(A, B) * [v1] The above will give the required re-expressed vector. For the above method to work, you *just* need to separate the vector into components based on the basis _vectors_, not scalars. Since we are going to 'subs' them, their occurences don't matter. And according to me, thats what separate should do- just think of basis vectors. Then use the above algo on each component thus found out to get the final result. You can try this with an example and confirm the validity. @stefan, @gilbert, am I correct? On Tue, Jul 30, 2013 at 11:46 PM, Prasoon Shukla <[email protected]>wrote: > @All: This is a cry for help. > > I am completely stumped at the *express* method. The implementation that > I had before had a flaw that I hadn't noticed until now (until Gilbert's PR > on by branch). Anyway, let me try to describe the situation. > > Initially, I had an separate method that would take a vector and return it > separated by coordinate systems in dictionary form. To my chagrin, this > kind of separation cannot always work. Consider two coordinate systems, c0 > and c1, both rectangular. Let us have a vector, v. > > v = c0.x * c1.e_y > express > Obviously, this cannot be separated into vectors separated by coordinate > systems. This is the case I wasn't considering when I wrote the express > method last. And that's why, I need to rewrite a new express method. > > I have been thinking of how to implement this but I'm getting nowhere. I > do have one way, that I think might work and am currently writing the code > for it. But, I'm not at all too sure of it. > > I think that by now, all three of you have a fair idea of the code. Please > suggest an algorithm to accomplish this. > > -- > You received this message because you are subscribed to a topic in the > Google Groups "sympy" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/sympy/t-Je0beTIIU/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/sympy. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- 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 http://groups.google.com/group/sympy. For more options, visit https://groups.google.com/groups/opt_out.
