2023 Summer Computing Methods
Homework #1 (100)
Problem #1 ( 20)
In the triangle shown a = 10 cm, b = 14 cm , and γ = 25°. Define a, b, and y as variables, and then: Calculate the length of c by substituting the variables in the Law of Cosines. (Law of Cosines: 𝑐2= 𝑎2 + 𝑏2 – 2 𝑎𝑏 𝑐𝑜𝑠𝛾 ) Calculate the angles 𝛼 and 𝛽 (in degrees) using the Law of Sines. (Law of Sines : 𝑎 𝑠𝑖𝑛𝛼=𝑏 𝑠𝑖𝑛𝛽=𝑐 𝑠𝑖𝑛𝛾 ) Verity the Law of Tangents by substituting the results into the right and left sides o f the next equation Law of Tangents: 𝑎−𝑏 𝑎+𝑏=tan (𝛼−𝛽2)tan(𝛼+𝛽)
Problem #2 ( 15)
In the ice cream cone shown, L = 10 cm and 𝜃 = 35°. The cone is filled with ice cream such that the portion above the cone is a hemisphere. Determine the volume of the ice cream.
Problem # 3 (20)
The number of combinations 𝐶𝑛,𝑟 of taking 𝑟 objects out of 𝑛 objects is given by 𝐶𝑛,𝑟=𝑛! 𝑟!(𝑛−𝑟)! Determine how many combinations are possible in a lottery game for selecting 6 numbers that are drawn out of 49. Using the following formula, determine the probability of guessing two out of the six drawn numbers.
𝐶6,2𝐶43,4 𝐶49,6
Problem # 4 (25)
The ideal gas equation states that 𝑃=𝑛𝑅𝑇 𝑉, where 𝑃 is the pressure, 𝑉 is the volume, 𝑇 is the temperature, 𝑅 = 0.08206 (L atm)/(mol K) is the universal gas constant, and 𝑛 is the number of moles. Real gases, especially at high pressure, deviate from this behavior. Their response can be modeled with the van der Waals equation
𝑃=𝑛𝑅𝑇 𝑉−𝑛𝑏−𝑛2𝑎 𝑉2,
where a and b are material constants. Consider 1 mole ( 𝑛 = 1 ) of nitrogen gas at T = 300K. (For nitrogen gas 𝑎 = 1.39 (𝐿2 𝑎𝑡𝑚 )/𝑚𝑜𝑙2, and 𝑏 = 0.0391 𝐿/𝑚𝑜𝑙 .)
- Create a vector with values of 𝑉 for 0.1≤𝑉≤1 L, using increments of 0.02 L.
- Using this vector calculate 𝑃 twice for each value of 𝑉, once using the ideal gas equation and once with the van der Waals equation.
- Using the two sets of values for 𝑃, calculate the percent of error (𝑃𝑖𝑑𝑒𝑎𝑙 −𝑃𝑤𝑎𝑎𝑙𝑠𝑃𝑤𝑎𝑎𝑙𝑠×100) for each value of 𝑉.
- Finally, by using MATLAB's built -in function max, determine the maximum error and the corresponding volume.
Problem # 5 (20)
A rocket flying straight up measures the angle θ with the horizon at different heights ℎ.
Write a MATLAB program that calculates the radius of the earth 𝑅 (assuming the earth is a perfect sphere) at each data point and then determines the average of all the values.
h, km 4 8 12 16 20 24 28 32 36 40 Θ, deg 2.0 2.9 3.5 4.1 4.5 5.0 5.4 5.7 6.1 6.4
Bonus Problem (10)
The volume 𝑉 and the surface area 𝑆 of a torus -shaped water tube are given by: 𝑉=𝜋2 4(𝑟1+𝑟2)(𝑟2−𝑟1)2
𝑆=𝜋2(𝑟22−𝑟12).
If 𝑟1=0.7𝑟2, determine 𝑉 and 𝑆 for 𝑟2 = 12, 16, 20, 24, and 28 cm.
Display the results in a four -column table where the first column is 𝑟2, the second 𝑟1, the third 𝑉, and the fourth 𝑆. .