Create a function file that computes the distance

Assignment Help MATLAB Programming
Reference no: EM13767511

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<d

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

Reference no: EM13767511

Questions Cloud

Write a paper on communication theory : write a paper on Communication Theory. Discuss what Communication scholars have learned about your topic that could be relevant to your own experiences (give examples).
Specific uses of diamond and graphite allotropes of carbon : Diamond and graphite are the two primary allotropes of carbon. Neither is generally considered hazardous, but they have their own specific uses. Choose which of the following statements is TRUE regarding these allotropes.
Compute the equivalent units of production : Compute the equivalent units of production for the first department for June, assuming that the company uses the weighted-average method of accounting for units and costs.
Measurement and basis of accounting : Question 1. Fiduciary funds are to use which of the following measurement and basis of accounting?
Create a function file that computes the distance : Write a function that accepts temperature in degree Fahrenheit and computes the corresponding value in degrees Celsius. The weight force must balance the spring forces at this new position.
Michael is a professor of biology at devry university : Michael is a Professor of Biology at DeVry University and has collected "30" largemouth bass from "4" separate lakes to get weight distributions, measure of girth, and length. He currently has the data saved in a Microsoft Excel workbook with data fr..
A discussion on improving the technology : You work at a High School. The High School currently lost their IT specialist and are in the process of hiring a new one. In the meantime, you were asked to join a discussion on improving the technology at the high school based on your background and..
Problem related to the inventory errors : At December 31, 2014, McGlaggen Corporation reported current assets of $638,000 and current liabilities of $384,000. The following items may have been recorded incorrectly.
Rolls presents a model of visual consciousness : Rolls presents a model of visual consciousness. Mandik presents his view on the neurophilosophy of consciousness. In your opinion, is Rolls''s model a trivial or substantive view of consciousness?

Reviews

Write a Review

MATLAB Programming Questions & Answers

  Solve a system of linear equations

Use Gauss-Jordan elimination to solve the system of simultaneous equations - functions to convert a matrix to upper triangular form.

  Write a function called matrix summary

Write a function called matrixsummary that takes in one argument, a matrix or a vector, and returns four output values - the sum, mean, max and min of all the values in the matrix or vector.

  Write a driver script that runs the functions

Write a driver script that runs the functions above and using the least squares coefficients returned by the functions creates a single plot comparing the differences between the data and the two least squares fit.

  Determine the inputs, outputs, relevant formulas

determine the inputs, outputs, relevant formulas

  You need to prepare a matlab code

You need to prepare a MATLAB code for the following - A randomly generated, [5x5] matrix (A), filled with random [2x2] sub matrices (aa).... for a total of a [10x10] matrix. Also, a multiplication factor

  Write a script that simulates a casino machine

Write a script that simulates a casino machine. To play a single round on the machine user pays $ 5. Now when the user start the machine, the machine rolls a pair of dice (simulate both dice with help of random number generator) and user only wins..

  Write the commands that will create the matrix

Write the commands that will create the matrix.

  Determine the average heat transfer coefficients over l 2

water at an average temperature of 47 ordmc and with a flow rate of 0.02 kgs flows through a 2 cm diameter tube which

  Calculate the value of the sum

Using matlab-Write the function [M.] = suma(x) that calculates the sum for the left(M) and right

  Simulate an atm machine and provide the code

Simulate an ATM machine and provide the code. I have the answer already but i do not understand it; I need expert to guide through it step by step. thanks!

  Matlab has a built-in ability to perform mathematical

MATLAB has a built-in ability to perform mathematical operations on complex numbers. However, there are times when it is useful to treat complex numbers as a structure. Write a set of functions with the following capability and a script to verify ..

  Build a simple revolvate robot

Define the robot as Robot.  Use the appropriate functions (i.e. methods) in the Robotics Toolbox - Generate a second pose and re-plot it.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd