Write a function that accepts temperature in degree


Question 1:

The capacitance of two parallel conductors of length L and radius r, separated by a distance d in air, is given by

C = Π∈L/ln[(d-r)/r]

where c is the permittivity of air (∈ = 8.854x 10-12 F/m).

Write a script file that accepts user input for d, L, and r and computes and displays C. Test. the file with the values L=1m, r= 0.001 m, and d =0.004 m.

Question 2:

Write a function that accepts temperature in degree Fahrenheit(0F)and computes the corresponding value in degrees Celsius (0c). The relation between the two is

T0C = 5/9(T0F - 32)

Be sure to test your function.

Question 3:

The height and speed of a projectile (such as a thrown ball) launched with a speed of u0 at an angle A to the horizontal are given by

h(t) = vot sin A - 0.5 gt2

v(t) = √(v2o- 2vogt sinA + g2t2)

where g is the acceleration due to gravity. The projectile will the ground when h(t) = 0, which gives the time to hit thit= 2(u0/g) sin A.

Suppose that A. 300, u0 = 40 m/s, and g = 9.81 m/s2. Use the MATLAB relational and logical operators to find times when

a. The height is no less than 15 rn.

b. The height is no less than 15 m and the speed is simultaneously no greater than 36 m/s.

c. The. height is less Man 5 m or the speed is greater Man 35 m/s.

Question 4:

Figure P20 shows a mass-spring model of the type used to design packaging systems and vehicle suspensions, for example. The springs exert a force that is proportional to their compression, and the proportionality constant is the spring constant k. The two side springs provide additional resistance if the weight W is too heavy for the center spring. When the weight W is gently placed, it moves through a distance x before coming to rest. From statics, the weight force must balance the spring forces at this new position. Thus

W=k1x if x

W=k1x+2k2(x-d)if xd

These relations can be used to generate the plot of x versus W.

a. Create a function file that computes the distance x, using the input parameters W, k1, k2 and d. Test your function for the following two cases, using the values k1 = 104 N/m; k2 =1.5 x 104 N/m; d =0.1 m.

W=500 N

W=2000 N

b. Use your function to pot x versus W for 0 ≤ Ws ≤ 3000 N for the values of k1. k2, and d given in part a.

2079_function.png

Question 5:

We want to analyze the mass spring system discussed in Problem previous problem for the case in which the weight W is dropped onto the platform attached to the center spring. If the weight is dropped from a height h above the platform. we can find the maximum spring compression x by equating the weight's gravitational potential energy with the potential energy stored in the springs. Thus

W(h+x) = 1/2k1x2 if x< d

which can be solved for x as

x = [W ± √(W2 + 2k1Wh)]/k1 if x < d

and

W(h+ x) = 1/2k1x2 + ½(2k2(x - d)2 if x ≥ d

which gives the following quadratic equation to solve for x: (k1 + 2k2)x2 - (4k2d + 2 W) + 2k2d2 - 2 wh =0 if x ≥ d

a. Create a function file that computes the maximum compression x due to the failing weight. The function's input parameters are k1, k2,d, w and h. Test your function for the following two cases, using the values. K1

= 104 N/m k2 = 1.5 x 104 N/m; and d = 0.1 m.

W=100 N h=0.5 m W =2000 N h =0.5 M

b. Use the function file to generate a plot of x versus h for 0 ≤ h  ≤ 2 m. Use w = 100N and proceeding  values for k1, k2, k3 and d.

Question 6:

Engineers often need to estimate the pressures and volumes of a gas in a container. The van der Waals equation is often used for this purpose. It is

P = RT/V' - b = a/v'2

where the term b is a. correction for the vokene of the molecules and the term a/v^2 is a correction for molecular attractions. The gas constant is R, the absolute temperature is T, and the gas specific volume is V^. The value of is the same for all gases; it is R = 0.08206 L.atm/mol-k. The values of a and b depend on the type C4 gas. Some values are given in the following table. Write a user defined function using the switch structure that computes the pressure P on the basis of the van der Waals equation. The function's input arguments should be T, V^, and a string variable containing the name of a gas fisted in the table.

Test your function for chlorine (C12) for T= 300 K and V^= 20 Land.

Gas

a(L2-atm/mol2)

b(L/mol)

Helium, He

0.0341

0.0237

Hydrogen, 112

0.244

0.0266

Oxygen. 02

1.36

0.0318

Chlorine, Cl2

6.49

0.0562

Carbon dioxide. CO2

3.59

0.0427

Request for Solution File

Ask an Expert for Answer!!
MATLAB Programming: Write a function that accepts temperature in degree
Reference No:- TGS01037587

Expected delivery within 24 Hours

©TutorsGlobe All rights reserved 2022-2023.