9.25 Discussion Notes

Embed Size (px)

Citation preview

  • m*(dv/dt) = (-mg) - 0.5*C_DpA*V*|V| ----> divide by mdv/dt = -g - [1/(2m)]*C_DpA*V|V|T_v = 0.99*(Analytic T_v)

    ode45 solves differential equations[TOUT,YOUT] = ode45(ODEFUN,TSPAN,Y0,OPTIONS)where ODEFUN is a function handle that accepts 2 inputs (t,y) and outputs f(t,y)

    TSPAN = [T0 TFINAL]

    To create a function handle:f_handle = @(V,t)homework_1(var1,var2,...)

    -Will evaluate homework_1 as a function of V,t-V,t does not need to be an input for homework_1

    (5,9.81,0.8,1.2,0.01,0)

    TSPAN = [0 5]V0 = 0f_handle = @(V,t)homework_1(5,9.81,0.8,1.2,0.01,0)[TOUT, VOUT] = ode45(f_handle, TSPAN, V0)plot(TOUT,VOUT)