Question: I need a help in this question in matlab plz, ASAP QUESTION 2 5 MARKS The volume of a spherical tank used for liquid storage
QUESTION 2 5 MARKS The volume of a spherical tank used for liquid storage is given by the following integral: 16 dx Here r is the radius of the sphere and x is the variable being integrated 02a in the a2o,m file, write an m-file that evaluates this integral using the following numerical integration methods with r0.5 m: . Composite Trapezoidal method, and . Composite Simpson's 1/3 rule Start with the minimum number of points required to perform the integration in each method. Continue to increase the number of points until the approximated volume achieves an accuracy of 8 decimal places matching the volume value obtained using MATLAB's integral() function. Use fprintf to print the iteration number, number of points, current volumetric approximation and the absolute error, but only when the accuracy of the estimation has improved by at least a decimal place. An example of this is shown below, with the decimal places bolded and underlined for clarity (you do not need to bold and underline the values in your MATLAB answers): Composite Trapezoidal Rule iter pts vol approx DP 2 e.5e .92359878 3 0.51666667 e.ee693211 7 0.52282718 .00077160 ? ??????22? Composite Simpson's 1/3 Rule: iter pts vol_approx DP error 3 8.52222222 .90137655 8.52359477 e-eeeeeee 5 Note: The widths used in the above columns were 6,6, 12, 12, and 6(left to right). Note: The error is the absolute difference between the approximated volume and actual volume. Hint: The accuracy of the decimal places can be calculated using a combination of log100 and other inbuilt MATLAB functions. You should still have three figure windows by the end of this task
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
