terminal velocity graphing

i need to be able to plot the vertical speed and the altitude as a function of time. attached is the code. any help would be appreciated

Comments

  • I can't understand what is your problem, in your code you already plot the altitude as a function of time.
  • the graph is not plotting properly and i do not know how to get it to look the right way, also need to have seperate plots for the velocity and altitude
  • If you don't explain what you mean with "plot properly" I can't help you.
    To plot two different figures you can code in this way:

    figure(); plot(time, altitude);
    figure(); plot(time, velocity);
  • the velocity graph was only using one point for the entire graph, we need it to use all the points for the velocity graph. i also can't figure out how to get the altitude to plot. attached is the revised information.
  • Can you give me some test input values so that I can check the code, because it gives me some errors and perhaps it depends on my "random" input values.
  • initial altitude is 3800
    parachute diameter is 10
    opens at 40
    time step is .1
  • Now it runs!
    To plot all the velocity values you have to code in this way (I underline the lines that I have added):

    [u]figure();[/u]
    while t1000
    if V>-Vt_before
    a=(1/2)*(pair/m)*(V^2)*Ab*Cdb-g;
    V=Vi+a*TS;
    Alt=Alt+V*TS+(1/2)*a*TS^2
    Vi=V;
    t=t+TS
    time=t;
    disp('The skydiver did not reach terminal velocity.')
    else Vterm=1;
    Alt=-Vt_before*TS+Alt
    t=t+TS
    disp('The skydiver reached terminal velocity.')
    end
    [u]plot(t,V,'.');hold on[/u]
    end
  • To plot the altitude:

    [u]figure();[/u]
    while Alt>0
    Alt=Alt-Vt_after*TS;
    t=t+TS;
    [u]plot(t,Alt,'.');hold on[/u]
    end
  • thank you, we modified what you gave us to graph for the entire duration of the jump.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion