Composite trapezoidal method


Questions:

You can choose to solve the assignment with the tool you wish (can be Matlab, but if you prefer to use another tool you can as well)

For each question you have chosen to answer submit a one to two pages’ report which

a) explains to method you used to solve (example: I used the in-built function ode45 of Matlab which implements the Runge-Kutta-Fellberg 4-5 method)

b) gives the actual solution (use graphs where ever appropriate)

c) gives a discussion about the error control (here it is an open ended problem. You should play with the code or software you have and vary the algorithm parameters and based on this estimate the error of your answer, use error estimation techniques we have learned in class, etc... Use graphs whenever possible)

Question 1: A cross-sectional area has the geometry of half an ellipse, as shown in the figure. The coordinate x‾ of the centroid of the area can be calculated by:

x‾ = My/A

where A is the area given by A = (1/2) πab and My is the moment of the area about the y-axis, given by:

708_Moment of the area.jpg

 

(a) Write a MATLAB program in a script file that calculates x‾ when a = 40mm and b = 15 mm. For the integration must use the user-defined function Compzoidal that was created

(b) Replace the integration function in the program from part (a) with one of MATLAB's built-in integration finictions. Repeat the calculation, and compare the results.

Question 2: A cylindrical vertical tank of diameter D = 2 ft has a hole of diameter d = 2 in. near its bottom. Water enters the tank through a pipe at the top at a rate of Q = 0.15 ft3/s. The time t, that is required for the height of the water level in the tank to change from its initial (t = o) level of ho = 9 ft to level of b is given by: 

1541_Time for change in level.jpg

where g in 32.2 ft/S2.

(a) Use the composite trapezoidal method (user-defined function) to determine how long it would take for the height of the water level to change to h = 5 ft.

(b) Determine the times that correspond to water levels from h = 9 ft to h = 1 ft in increments of 0.2 ft, and plot has a function of t. To carry out the calculations and make the plot, write a MATLAB program in a script file. For integration use one of MATLAB's built-in functions.

Request for Solution File

Ask an Expert for Answer!!
MATLAB Programming: Composite trapezoidal method
Reference No:- TGS01239605

Expected delivery within 24 Hours