More MatLab Woes

Not only did ME10 have a final project, but so did ME17 (the one with Excel and MatLab). Our final project asked us to write 1) A main file to determine the velocity and position of a space shuttle over a period of time by using 2) a function with constant drag force and 3) a function with a variable drag force.

Luckily, the equation for determining acceleration over a period of time with given constants was provided for us, so we didn’t need to think of that ourselves. The hard part was knowing how to write a main code that would call the function files that I wrote to print out the calculated y and V values.

It’s hard to express in word so I’ll just show you what I did.

me17woes

The main code calls the functions then prints and plots out the results of the ode45 function, the integration function.

me17woes1

This function code calculates the velocity and acceleration when drag force varies with time.

me17woes2

This does the same but with constant drag force.

me17woes3

The result of running the code. It prints out a table of all the values and plots the velocity and position vs time graphs for an user inputted value for the mass of the shuttle.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s