vatly bai tap lon
TRANSCRIPT
![Page 1: Vatly Bai Tap Lon](https://reader036.vdocuments.us/reader036/viewer/2022082708/55cf9955550346d0339cd7bf/html5/thumbnails/1.jpg)
USING SYMBOLIC MATH TO SOLVE A BALLISTICS PROBLEM
We can use the symbolic math capabilities of MATLAB ®
to explore the equations
representing the trajectory of an unpowered projectile, such as the cannonball
shown in Figure 12.5 .
Range
vertical
distance
horizontal distance
Figure 12.5
The range of a projectile depends on the initial velocity and the launch
angle.
We know from elementary physics that the distance a projectile travels horizontally is
dxv0
t cos1u2
and the distance traveled vertically is
dy v0
t sin(u)
1
2
gt
2
where
v0velocity at launch,
t time,
u launch angle, and
g acceleration due to gravity.
Use these equations and MATLAB
®
![Page 2: Vatly Bai Tap Lon](https://reader036.vdocuments.us/reader036/viewer/2022082708/55cf9955550346d0339cd7bf/html5/thumbnails/2.jpg)
’s symbolic capability to derive an equation for
the distance the projectile has traveled horizontally when it hits the ground (the
range).
1. State the Problem
Find the range equation.
2. Describe the Input and Output
Input Equations for horizontal and vertical distances
Output Equation for range
3. Develop a Hand Example
dy v0
t sin1u2 -1
2
gt
20
Rearrange to give
v0
t sin1u2
1
2
gt
2
12.2 Solving Expressions and Equations 445
Divide by t and solve:
t
2v0sin1u2
g
Now substitute this expression for t into the horizontal-distance formula to obtain
dxv0
t cos1u2
![Page 3: Vatly Bai Tap Lon](https://reader036.vdocuments.us/reader036/viewer/2022082708/55cf9955550346d0339cd7bf/html5/thumbnails/3.jpg)
rangev0a
2v0sin1u2
g
bcos1u2
We know from trigonometry that 2 sin u cos u is the same as sin12u2, which
would allow a further simplification if desired.
4. Develop a MATLAB
®
Solution
First define the symbolic variables:
syms v0 t theta g
Next define the symbolic expression for the vertical distance traveled:
Distancey = v0 * t *sin(theta) - 1/2*g*t^2;
Now define the symbolic expression for the horizontal distance traveled:
Distancex = v0 * t *cos(theta);
Solve the vertical-distance expression for the time of impact, since the vertical
distance0 at impact:
impact_time = solve(Distancey,t)
This returns two answers:
impact_time =
[0] [ 2*v0*sin(theta)/g]
This result makes sense, since the vertical distance is zero at launch and again at
impact. Substitute the impact time into the horizontal-distance expression. Since
we are interested only in the second time, we’ll need to use impact_time(2) :
impact_distance = subs(Distancex,t,impact_time(2))
The substitution results in an equation for the distance the projectile has
traveled when it hits the ground:
impact_distance =
2*v0^2*sin(theta)/g*cos(theta)
![Page 4: Vatly Bai Tap Lon](https://reader036.vdocuments.us/reader036/viewer/2022082708/55cf9955550346d0339cd7bf/html5/thumbnails/4.jpg)
5. Test the Solution
Compare the MATLAB
®
solution with the hand solution. Both approaches give
the same result.
MATLAB ®
can simplify the result, although it is already pretty simple. We
chose to use the simple command to demonstrate all the possibilities. The
command
simple(impact_distance)
(continued)
446Chapter 12 Symbolic Mathematics
gives the following results:
simplify: (v0^2*sin(2*theta))/g
radsimp: (2*v0^2*cos(theta)*sin(theta))/g
simplify(100): (v0^2*sin(2*theta))/g
combine(sincos): (v0^2*sin(2*theta))/g
combine(sinhcosh): (2*v0^2*cos(theta)*sin(theta))/g
combine(ln): (2*v0^2*cos(theta)*sin(theta))/g
factor: (2*v0^2*cos(theta)*sin(theta))/g
expand: (2*v0^2*cos(theta)*sin(theta))/g
combine: (2*v0^2*cos(theta)*sin(theta))/g
rewrite(exp): (2*v0^2*((1/exp(theta*i))/2
+exp(theta*i)/2)*(((1/exp(theta*i))*i)/
2-(exp(theta*i)*i)/2))/g
rewrite(sincos): (2*v0^2*cos(theta)*sin(theta))/g
rewrite(sinhcosh): (2*v0^2*cosh(-theta*i)*sinh
(-theta*i)*i)/g
rewrite(tan): -(4*v0^2*tan(theta/2)*(tan(theta/2)^
![Page 5: Vatly Bai Tap Lon](https://reader036.vdocuments.us/reader036/viewer/2022082708/55cf9955550346d0339cd7bf/html5/thumbnails/5.jpg)
2-1))/(g*(tan(theta/2)^2 + 1)^2) mwcos2sin: -(2*v0^2*sin(theta)*(2*sin(theta/2)^
2-1))/g
collect(v0): ((2*cos(theta)*sin(theta))/g)*v0^2
ans =
(v0^2*sin(2*theta))/g
Xác định phương trình chuyển động của tên lửa
1. Yêu cầu
Tên lửa dịch chuyển bằng dòng khí đẩy từ đuôi. Dòng khí đẩy này sinh ra bằng các phản ứng đốt cháy nhiên liệu chứa trong tên lửa nên khối lượng của nó giảm dần theo thời gian. Giải phương trình định luật II Newtom cho tên lửa:
Với m là khối lượng của tên lửa, v’ là vận tốc của dòng khí thoát ra.
Giải phương trình này ta xác định được gia tốc của tên lửa từ đó ta suy ra phương trình chuyển động của nó.
Bài tập này yêu cầu sinh viên sử dụng MATLAB để biểu diễn bằng đồ thị phương trình chuyển động của tên lửa y(t).
2. Điều kiện
1) Sinh viên cần có kiến thức về lập trình cơ bản trong MATLAB.
2) Tìm hiểu các lệnh Matlab liên quan symbolic và đồ họa.
3. Nhiệm vụ
Xây dựng chương trình Matlab:
![Page 6: Vatly Bai Tap Lon](https://reader036.vdocuments.us/reader036/viewer/2022082708/55cf9955550346d0339cd7bf/html5/thumbnails/6.jpg)
1. Nhập vào các thông số tốc độ đốt nhiên liệu dm/dt, khối lượng, vị trí ban đầu của tên lửa, vận tốc đẩy khí của tên lửa v’.
2. Sử dụng công cụ Symbolic để xác định phương trình chuyển động của tên lửa và biểu diễn bằng đồ thị
Chú ý: Sinh viên có thể dùng các cách tiếp cận khác không dùng symbolic.