Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

ESG111 Final Exam Example 2

Instruction:

•   Compute the problem by using MATLAB.

•   Submit all requested files in in your course drive

•   DO NOT USE any other applications (other than MATLAB) to find the solutions!

•   DO NOT USE symbolic” tool to find the solutions!

   SAVE work history in diary or doc. file to prove your work

•  ADD NAME on all of the files: 3pt

•  Write the answer in the Exam sheet as well

Table 1: The density of air, p [kg/m3], at various elevations, z [km]

z [km]

-1

0

1

2

3

4

5

6

7

p [kg/m3]

1.347

1.225

1.112

1.007

0.9093

0.8194

0.7364

0.6601

0.59

 

8

9

10

15

20

25

30

40

0.5258

0.4671

0.4135

0.1948

0.08891

0.04008

0.01841

0.003996

 

50

60

70

80

0.001027

0.0003097

0.00008283

0.00001846


Iron Man took Spiderman and ascended in the air. He accidentally dropped Spiderman at 43 km high from the sea level and made him a free-fall jump, rushing toward the Earth at supersonic speeds before reaching to the ground. As Spiderman fell, his drag coefficient changed primarily because the air density changed. The terminal velocity, vt  [m/s], of a free-falling object can be computed as

vt  = #      ⋯ (1)

where g is a gravitational acceleration [m/s2], m is mass [kg], and cd  is drag coefficient [kg/m].

The drag coefficient can be computed as      cd    =  0.5pACd         ⋯ (2)

where p is the fluid density [kg/m3], A is the projected area [m2], and Cd  is a dimensionless drag coefficient. Note that the gravitational acceleration, 6 [m/s2], can be related to elevation by

g  =  9.806412  −  0.003039734z       (3)

where z is elevation above the sea level [km].

The density of air, p [kg/m3], at various elevations can be found in Table 1 and the file stored in the course drive, as well.

1.    Develop a function, fn_ TerminalV to calculate the terminal velocity vt  at given height from the sea level. Input arguments should be the height from the sea level, the corresponding air density, mass of the object, area of the object and a dimensionless drag coefficient. Make two subfunctions, fn_cd and fn_g to evaluate the drag coefficient cd  and the gravitational acceleration g to compute vt .

2.    Write a script, TerminalV which reads the air density data, fits the data and evaluates the terminal velocity vt  [m/s] at selected height. Script should include the following requirements.

•    Fit the data with  5th   degree of polynomial by using a built-in function, polyfit.  Save the error estimation structure and the centering and scaling values for better fitting result.

•    Fit the data with double exponential model by using a built-in function, fit.

If you  don’t know what the  double  exponential  model  is, you  may look  up the  document  in MATLAB. Find “List if Library Models for Curve and Surface Fitting” in the document of MATLAB.

•    Plot the data and fitted results. For actual data, plot with a marker but no connected lines. For fitted data, choose to plot with just a line. Add legend, and all other necessary graph information.

•    Evaluate the air density at any height that user wants. Output air density based on two fitted models. If user input outside the rage of altitudes, display an error message and terminate the program.

•    Once air density is evaluated, call the function to calculate the  vt  based on each fitted model and display the result by using fscanf.

3.    Input the height as -2km and 80.1km to check that your program shows the error and quits successfully.

4.    Assume Spiderman’s weight is 75 kg and the body surface is 0.95 m2 . Set the dimensionless drag coefficient as Cd    =  1.1. Find the terminal velocity at the sea level, so that Iron Man can catch Spiderman before he reaches to the surface.