Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
LW2_3 TheoryCoordinateSystems.doc
Скачиваний:
9
Добавлен:
10.11.2019
Размер:
624.13 Кб
Скачать

Standard task for laboratory work

It is necessary to define rotational matrix that transforms an initial reference frame to a new one. Build a plot that includes the initial reference frame and the reference frame derived due to rotation.

Consider the following coordinate system transformation:

  1. Body-Fixed Form Stability

  2. Body- Fixed From Inertial

In order to perform the laboratory work a Matlab Symbolic Math Toolbox is necessary.

  1. At the first stage define rotational matrix.

  2. Create symbolic variables that define rotational angles. In our case, we have only one angle (angle of attack) marked with alpha:

syms alpha

Then enter the rotational matrix in Matlab, e.g.

Mx= [1 0 0;

0 cos(alpha) sin(alpha)

0 -sin(alpa) cos(alpha)];

It is known that Body-Fixed from Stability reference frame is characterized with a single rotation about the ys – axis through the angle of attack, α. Thus, the matrix of total rotations is equal to the matrix of a single rotation (e.g., Mx).

Mf=Mx;

To plot the coordinate system in Matlab environment, it is necessary to initialize an orthonormalized basis in a matrix form in the following way:

A=eye(3);

On the next stage, it is possible to plot these vectors by applying the following syntax:

col='rgb'

for k=1:3,

line([0 A(1,k)], [0 A(2,k)], [0 A(3,k)],...

'Color', col(k),...

'LineStyle', '-',...

'LineWidth',2);

end;

grid on

hold on

To build the obtained reference frame after rotation it is necessary define value

for corresponding rotation angle (angle of attack, α).

Example:

alpha=5;

Al=eval(Mf)*A;

At this stage, it is possible to plot the rotated reference frame (the body fixed reference frame) according to above given instructions.

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]