DCM helps in modeling of relationship between base vectors as well as base
scalars.
The re-expression of a vector V in a frame A should proceed in three steps-
1) Substitute base scalars of all other frames except A, in terms of A, in V
2) Separate the vector we get from step1 into its constituents in various
frames (B1, B2, ... Bn) using the separate() method, and then multiply [dcm
of the corresponding frame (Bi) wrt frame A] by the respective constituent.
3) Add the vectors generated in step2
I guess you propose the system (*) for step1. However, I think there is an
error with that. Consider a frame B, having some rotation and some
pos_vector(P) wrt A. As we wont include base scalars in position vectors,
expressing P in A wont be difficult (just steps 2 and 3 of above).
Hence, [xA, yA, zA] = [P.x, P.y, P.z] + A.DCM(B) * [xB, yB, zB] ...(Column
vectors, not row vectors)
The above equation would give xA, yA, zA in terms of xB, yB, zB, which can
be used for step 1.
I think we should have a cached method _map_variables which does step1, as
it can also be used to express scalar fields in any frame. _map_variables,
as I have said earlier, can return a dict as {xA : f(xB, yB, zB), yA :
f(...}. This dict can be directly used for the 'subs' method.
(All the above applies for rect coords)
On Wed, Jul 10, 2013 at 12:44 AM, Prasoon Shukla
<[email protected]>wrote:
> I'm having some problems with implementing the `express` function. This
> function would be called on a vector and would take a CoordSys object as
> and argument. The function should return a vector expressed in the CoordSys
> provided to this method.
>
> Now, as a first step, we need to take care of the position.
> Say, we have two coordinate systems, C0 and C1, each having their origin
> at a different point in space. Now, we have a vector field in C1, say F.
>
> Now, we know the position coordinates of each of the frames in the global
> frame. But, these coordinates could have been expressed in any coordinate
> system. So, here's the algo:
>
> 1. Convert the position of both C0 and C1 into rectangular coordinates.
>
> 2. Subtract both the positions term wise. This way, we will have the
> difference of coordinates between C0 and C1.
>
> 3. Now, we can have relations such as:
>
> x0 = x1 + a
> y0 = y1 + b
> z0 = z1 + c
>
> -----------------Equations (*)
>
> Where the variables suffixed with 0 are in C0 and similarly for C1.
>
> 4. Now, we need to convert F from whatever coordinate system it was
> expressed in to rectangular so that we can substitute the variables from
> system (*). Also, we need to convert the base vectors to rectangular
> coordinates - because they stay constant throughout space.
>
> 5. Now, we have F in C1 expressed in rectangular coordinates. Now,
> substitute from system (*) into F. Base vectors remain the same because F
> has already been converted to rectangular coordinates.
>
> 6. Now effectively, we have F in C0, albeit in rectagular coordinates.
>
> Now, we can proceed from here to take care of orientation or change the
> coordinates back to some other coordinate system (spherical for example).
>
> Now, I want you guys to verify whether the procedure I have written above
> is correct or not.
> -----------------------
> Now, we have to take care of the orientation. Now that we have positioned
> ourselves at C0, let as say we need to rotate C0 to another coordinate
> system, Cr, where C0 and Cr have the same origin. We already have the DCM
> between C0 and Cr.
>
> Now, I need to ask something. Does DCM represent the relation between
> coordinate variables or does it represent relation between coordinate
> variables? Or does it represent the relation between base vectors? Or both?
>
> Because of the way the DCM is derived, I think that it is the relation
> should hold for both. Is that correct?
>
> --
> 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.