Tải bản đầy đủ (.docx) (8 trang)

Matlab code

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (6.93 MB, 8 trang )

The code:

Explaination for line 7 – 9:
The position vector, r, can be expressed as:

where

We see that

For

, and thus,

we have:

.


y=

=

Substitute
equation gives:

and

into the

This is a function of y with respect to a single variable, x.
Line 7:


(needs teacher’s help)

Line 8 and 9:
Since MATLAB does not include any syntax for ± operation, we need to split the equation into 2 separated sub-function
y1 (plus sign) and y2 (minus sign). Then we can plot the trajectory later using each of the y function respectively.

Some examples to test the above code:
Case 1:
a)

:


b)


Case 2:
a)

b)


c) In a special case where x0 = y0


Case 3 (general cases):

+ If



If




Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Tải bản đầy đủ ngay
×