Problems with Matlab Projects? You may face many Problems, but do not worry we are ready to solve your Problems. All you need to do is just leave your Comments. We will assure you that you will find a solution to your project along with future tips. On Request we will Mail you Matlab Codes for Registered Members of this site only, at free service...Follow Me.

Programming with M-Files: A Rocket Trajectory Analysis Using For Loops


NOTE:

This example requires an understanding of the relationships between position, velocity, and acceleration of an object moving in a straight line. The Wikipedia articleMotion Graphs and Derivatives has a clear explanation of these relationships, as well as a discussion of average and instantaneous velocity and acceleration and the role derivatives play in these relationships. Also, in this example, we will approximate derivatives with forward, backward, and central differences; Lecture 4.1 by Dr. Dmitry Pelinovsky at McMaster University contains useful information about this approximation. We will also approximate integrals using the trapezoidal rule; The Wikipedia articleTrapezium rule has an explanation of the trapezoidal rule.

Trajectory Analysis of an Experimental Homebuilt Rocket

On his web page Richard Nakka's Experimental Rocketry Web Site: Launch Report - Frostfire Two Rocket, Richard Nakka provides a very detailed narrative of the test firing of his Frostfire Two homebuilt rocket and subsequent data analysis. (His site provides many detailed accounts of tests of rockets and rocket motors. Some rocket launches were not as successful as the Frostfire Two launch; his site provides very interesting post-flight analysis of all launches.)

Computation of Velocity and Acceleration from Altitude Data

In this section, we will use m-files to analyze the altitude data extracted from the plot "Altitude and Acceleration Data from R-DAS" on Richard Nakk's web page. This data is in the fileAltitude.txt. We will use this data to estimate velocity and acceleration of the Frostfire Two rocket during its flight.

EXERCISE 1

Get the data

Download the altitude data set in the file Altitude.txt onto your computer (right click on this link). The file is formatted as two columns: the first column is time in seconds, and the second column is altitude in feet. Load the data and plot the altitude as a function of time.
The following sequence of commands will load the data, create a vector t of time values, create a vector s of altitude values, and plot the altitude as a function of time.
 load Altitude.txt -ascii t = Altitude(:,1); s = Altitude(:,2); plot(t,s) 
The plot should be similar to that in Figure 1.
Figure 1: Plot of altitude versus time.
Figure 1 (AltPlot.png)

EXERCISE 2

Forward Differences

Write a script that uses a for loop to compute velocity and acceleration from the altitude data using forward differences. Your script should also plot the computed velocity and acceleration as function of time.

EXERCISE 3

Backward Differences

Modify your script from Exercise 2 to compute velocity and acceleration using backward differences. Remember to save your modified script with a different name than your script fromExercise 2.

EXERCISE 4

Central Differences

Modify your script from Exercise 2 to compute velocity and acceleration using central differences. Remember to save your modified script with a different name than your script from Exercise 2 and Exercise 3.
Compare the velocity and acceleration values computed by the different approximations. What can you say about their accuracy?

EXERCISE 5

Can it be done without loops?

Modify your script from Exercise 2 to compute velocity and acceleration without using a for loop.

Computation of Velocity and Altitude from Acceleration Data

In this section, we will use m-files to analyze the acceleration data extracted from the plot "Altitude and Acceleration Data from R-DAS" on Richard Nakk's web page. Download the acceleration data set in the file Acceleration.txt onto your computer (right click on this link). The first column is time in seconds, and the second column is acceleration in g's. The following commands load the data and plot the acceleration as a function of time.
 load Acceleration.txt -ascii t = Acceleration(:,1); a = Acceleration(:,2); plot(t,a) 
The plot should be similar to that in Figure 6.
Figure 6: Plot of acceleration versus time.
Figure 6 (AccPlot.png)

EXERCISE 6

Trapezoidal Rule

Write a script that uses a for loop to compute velocity and altitude from the acceleration data using the trapezoidal rule. Your script should also plot the computed velocity and altitude as function of time.

EXERCISE 7

Can it be done without loops?

Modify your script from Exercise 6 to compute velocity and altitude without using a for loop.

0 comments:

Post a Comment

Recent Comments

Popular Matlab Topics

Share your knowledge - help others

Crazy over Matlab Projects ? - Join Now - Follow Me

Sites U Missed to Visit ?

Related Posts Plugin for WordPress, Blogger...

Latest Articles

Special Search For Matlab Projects

MATLAB PROJECTS

counter

Bharadwaj. Powered by Blogger.