Skip to main content
16-Pearl
May 20, 2015
Solved

rotating co-ordinate system with multiple vector and through range of angles?

  • May 20, 2015
  • 1 reply
  • 3573 views

To all

I am looking for the mathcad syntax to carry out the rotation of multiple vectors through a range of angle (from 0deg to 90 deg).

I have a number of vectors containing 3 values (Nx,Ny,Nz) given in a reference co-ordinate system (fixed) (subscript ac)

A local co-ordinate system (subscript ‘) is defined

I am attempting to write the operation of rotating the local co-ordinate by angle theta (around Xac axis) to get the new vector values (in the
local co-ordinate) - for each vector and through the whole range of angle.

I am struggling a bit with the syntax required and any help would be appreciated. Attached a mcad sheet

Thanks in advance

Regards

JXB

Best answer by StuartBruff

J B wrote:

Add a look at the info provided and I think it starting to make sense. I slightly reviewed the approach but I am stuck at extracting the data from the nested arrays

The approach is

step 1 . rotate global vectors (17 of them) into the local co-ordinate

step 2: rotate each vector through a range of angle (around x axis). (Which lead to the nested arrays)


I think I can extract the data for a given angle but ultimately I'd like to be able to extract the max values across all the cases and all the angles.

I think I may need to have a look at a matrix N x M = (91*17) x 3 = (nb of angle *nb of cases) x 3 set of values. see attached picture

Any ideas?

Thanks

Regards

JXB

I have had no time to do anything more than glance at your worksheet, but I think one of my general purpose functions (flatten) should do what you want

There are other ways of doing it, but I don't have time to make it any shorter or simpler!

Stuart

1 reply

23-Emerald V
May 20, 2015

I've only had a chance to skim the beginning (work is somewhat getting in the way!), but a few simple points:

Mathcad indices run, by default, from 0 not 1, so the highest row number is rows(array)-1 and not (rows(array)).

If you use range variables in an assignment, they must appear on both sides of the := or global equals operators.

You can't have units in an array index.

You can use Mathcad's matrix functionality to apply R(theta) to the whole of LFvec rather than deal with it a row at a time.

Stuart

16-Pearl
May 21, 2015

Thanks StuartB for the pointers. Much appreciated. Not sure I fully understand the indexing but will start looking into it.