Two cars had a race over a distance of 1508m. The two cars began from different
ID: 662611 • Letter: T
Question
Two cars had a race over a distance of 1508m. The two cars began from different positions, car 1 started 1508 m above the finish line while car 2 had to travel the 1508m distance on land. It was estimated that car 2 could complete the 1508m in 37 seconds. Which car will win the race?
The velocity of a car dropped from a position of 1508m can be found using:
Develop a MATLAB program to calculate the velocity and the travel distance, and make a graph of the velocity of car 1 as a function of time and a graph of the travelled distance of car 1 measured from the drop position as a function of time for the following cases:
i)No drag force
ii) Drag force
Explanation / Answer
public class Skydiver
{
public static void main ( String args [ ] )
{
double gravity = 9.8 ; // m/s^2
double density = 1.225 ; // kg/m^2
double mass = 100 ; // kg
double area1 = 0.5 ; // m^2
double drag1 = 0.7 ; // CoD
double diameter = 10 ; // m
double area2 = Math.PI * diameter * diameter / 4 ; // m^2
double drag2 = 1.4 ; // CoD
double height = 3800 ; // m
double open_time = 40 ; // s
double open_height = 1000 ; // m
double step = 1.0 ; // s
//initialize simulation:
double area = area1 ; // m^2
double drag = drag1 ; // CoD
double y = height ; // m
double v = 0 ; // m/s
double a = gravity ; // m/s^2
double t = 0 ; // s
//run simulation:
boolean open = false ;
while ( y >= 0 )
{
//update position:
double old_y = y ;
y -= v * step ;
//update velocity:
v += a * step ;
//check for terminal velocity:
double vterm = 0.99 * Math.sqrt ( 2 * mass * gravity ) / ( density * area * drag ) ;
System.out.println("vterm="+vterm);
if ( v > vterm ) v = vterm ;
//advance time:
double old_t = t ;
t += step ;
//check for open_height:
if ( ! open && old_y > open_height && y <= open_height )
{ open = true ;
area = area2 ;
drag = drag2 ;
System.out.println("open at y = "+open_height);
}
//check for open_time:
if ( ! open && old_t < open_time && t >= open_time )
{ open = true ;
area = area2 ;
drag = drag2 ;
System.out.println("open at t = "+open_time);
}
System.out.println("t = "+t+", y = "+y+", v = "+v);
}
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.