Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In an experiment, car 1 had a race with car 2 over a distance of 1508m. The two

ID: 662601 • Letter: I

Question

In an experiment, car 1 had a race with car 2 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 distance on land. It was estimated that car 2 could do the 1508m in 37 seconds. Write a MATLAB code to estimate the velocity of car 1 as it falls and the time it takes for car 1 to fall 1508m and complete the race - taking into account air resistance as it falls. Based on your calculations and the time estimate for car 2, which car will win?

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);
}
}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote