Project 1

advertisement
Project 1
Part 3
The objective of this project is to accurately predict the trajectory of a solid object. In this
part of the project we will attempt to incorporate the air resistance using nonlinear model. Denote
the coordinate of the object by z(t) = (x(t), y(t)). The motion of the object will be modeled with
z00 = −(0, g) − b|z0 |z0 ,
where |z0 | =
p
(x0 )2 + (y 0 )2 . The object is launched with initial velocity
x0 (0) = v0 cos(θ),
y 0 (0) = v0 sin(θ)
and the initial position is given by x(0) = 0, y(0) = y 0 . For this project you will need to use Euler’s
method (described below).
1) Calculate b from the following data: it takes 0.95 sec for a dart to fall from the height 4.06
meter (initial velocity is zero).
2) Calculate v0 from the following data: the time that takes for a dart fired straight up from a
height 0.39 meters to hit ground is 2.13 seconds.
3) Calculate d(θ) (the travel distance) for θ = 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85
degrees. Take y0 = 0.18.
4) Compare the data with an experimental data obtained with y 0 = 0.18 and θ = 5, 10, 15, ..., 85
degrees. The data are given in a separate file along with M-file that will plot the distance traveled
in horizontal direction (see first part of the project).
5) Compute the error in the following way. First use the following lines in your matlab code to
obtain four different data sets, d1, d2, d3, d4 from the data.
>>f id = f open(0 ballistic meter.dat0 ,0 r 0 );
>>y = f scanf (f id,0 %f 0 , inf );
>>z = reshape(y, 2, size(y, 1)/2);
>>q = reshape(z(2, :), 4, 17);
>>d1 = q(1, :);
(1)
>>d2 = q(2, :);
>>d3 = q(3, :);
>>d4 = q(4, :);
Use the following relative error estimate
sP
17
c
2
c
2
c
2
c
2
i=1 [(d1(i) − d (i)) + (d2(i) − d (i)) + (d3(i) − d (i)) + (d4(i) − d (i)) ]
,
P17
2
2
2
2
i=1 [(d1(i)) + (d2(i)) + (d3(i)) + (d4(i)) ]
where dc (i) is the distance computed from part 4 for θ(i). Note that the corresponding error in the
first part of the project is 18.28 percent.
Euler’s method. Consider x0 (t) = f (t, x), x(t = t0 ) = x0 . We would like to calculate the
solution with δt increments in time. Then
x(t + δt) = x(t) + δt ∗ f (t, x(t)).
1
Download