parachute problem please help
14 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
A skydiver jumps from a stationary platform (i.e. helicopter) and uses a parachute to safely land on the ground. The parachute opens after 60 seconds but the duration of the entire jump is unknown. The starting height is known (4000m) and the time step is pre-determined to be .1 s (value of dt term). You must construct a code that will simulate the skydivers jump from start to finish taking into consideration the effects of drag.
Start a new script file that will be the basis of the entire Parachute project. Save all iterations of the code for each task (name the file for task 2: parachute_T2…etc). Use the code from Task 1 as a reference as you write the following code (also please follow the format of using comments throughout the code to describe what is happening):
1. Ask the user to input a starting height, an amount of time before the parachute is deployed, and the time step to use.
2. Instead of calculating for a fixed amount of time, have the loop stop when the parachutist reaches the ground. Start the jump at 4,000 m and use a value for dt of 0.1 s. Initially have the parachutist open their chute after 60 s. Note that this means you must use a while loop. Don’t forget that if your program takes more than a couple of seconds to run, you likely have an infinite loop. Typing <CNTL>C will stop execution.
3. Add the effect of air resistance to the model (following the Meade reference given to you). In this model, air resistance is a force opposing the motion of the skydiver whose magnitude is proportional to the speed at which the skydiver is falling. a. When updating the velocity of the diver, Δv=g dt becomes Δv=(g-(k/m)v )*dt (We’ll include a better model of air resistance in a later task). b. When the parachute opens, the drag increases. You need to add a conditional statement based on time such that the coefficient k/m will change after the time of deployment of the parachute. c. For this task, use the values from Abell/Braselton of 1/6 and 5/3 respectively for your k/m coefficients for the two different stages of the sky dive.
4. Make plots of height and velocity versus time using subplot.
what i have so far i'm stuck on part 2
% Acceleration due to gravity
g = -9.81;
% set time interval and number of computational steps
h=input('Enter your starting height');
t=input('Enter time it took for parachute to deployed');
dt=input('Enter time step');
v=0;
while t==60
i=1;
t(i+1)=t(i)+dt;
h(i+1)=h(i)+(v(i)*dt);
v(i+1)=v(i)+(g*dt);
end
0 Kommentare
Antworten (1)
Image Analyst
am 13 Nov. 2013
I think your while statement should go until the height is less than or equal to zero:
while h(end) > 0
% Code
end
2 Kommentare
Image Analyst
am 13 Nov. 2013
Think about it some more. You could use two loops - one for free fall, and on for when the parachute is deployed.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!