Question: a) We wish to integrate the following function Find the exact solution when u = 5.0x10-'N s/m, h = 2 mm, 2 = 100 rpm,

 a) We wish to integrate the following function Find the exact

a) We wish to integrate the following function Find the exact solution when u = 5.0x10-'N s/m, h = 2 mm, 2 = 100 rpm, min = 0.0 m and x = 0.2 m. Write your answer with 5 significant digits. For part a), you can obtain your answer by hand. b) Numerically integrate the function above using a rectangle rule with 10, 100, and 1000 differential elements and show answers with 5 significant digits. In the integrand above, this means replacing dr with a difference, Ar, of finite length. In each strip. AM is evaluated using a value ofr pointing to the middle of the strip. Summing the strips gives the result of the integration. You will write both a function to perform the integration and a driver script that calls the function and prints the results. These will be stored in different files, one prefixed with "func_" and the other prefixed with "driver". A template for your function follows: func integrate viscdise.m function sum = func_integrate_viscdisc(n, mu, h, omega, rmin, max) sum = ; % Initialize result to zero rlen = rmax - rmin; % Range in radial direction from rmin to rmax dr = rlen; % Width of a differential strip for idx = 1:n r = rmin + dr*(idx - 0.5); % Radius at center of strip ig = % Calculate integrand for strip sum = sum + dr"ig: % Add sum of strip to total end 10 end Note that the name of your function must exactly match the name of the file used to store it. Le, the example above must be stored in func_integrate_viscdisc.m'. The arguments to the function are the number of differential elements, n, and the remaining parameters for the problem. The driver below can be used to call this function for n = 10, n = 100, and n = 1000: driver integrate_visedisc.m mu = 5.9E-3; h = 2.0E-3; omega199/662"pi: rmin = 0.0; max = 0.2: for n = [10 100 1000) moment func integrate_viscdiscan, mu, h, omega, mmin, max): fprintf("The moment..computed with Ad stepsis:x11.4eNm '. n, moment); 10 end Line 7 starts a loops that will evaluate the function for different values of n. On line 8, the function is called and the result is stored in a variable named moment. On line 9, the result is printed to the command window. Blanks in a string are denoted by the underscore symbol. . Hand in a printout of all your code and the results from executing it. a) We wish to integrate the following function Find the exact solution when u = 5.0x10-'N s/m, h = 2 mm, 2 = 100 rpm, min = 0.0 m and x = 0.2 m. Write your answer with 5 significant digits. For part a), you can obtain your answer by hand. b) Numerically integrate the function above using a rectangle rule with 10, 100, and 1000 differential elements and show answers with 5 significant digits. In the integrand above, this means replacing dr with a difference, Ar, of finite length. In each strip. AM is evaluated using a value ofr pointing to the middle of the strip. Summing the strips gives the result of the integration. You will write both a function to perform the integration and a driver script that calls the function and prints the results. These will be stored in different files, one prefixed with "func_" and the other prefixed with "driver". A template for your function follows: func integrate viscdise.m function sum = func_integrate_viscdisc(n, mu, h, omega, rmin, max) sum = ; % Initialize result to zero rlen = rmax - rmin; % Range in radial direction from rmin to rmax dr = rlen; % Width of a differential strip for idx = 1:n r = rmin + dr*(idx - 0.5); % Radius at center of strip ig = % Calculate integrand for strip sum = sum + dr"ig: % Add sum of strip to total end 10 end Note that the name of your function must exactly match the name of the file used to store it. Le, the example above must be stored in func_integrate_viscdisc.m'. The arguments to the function are the number of differential elements, n, and the remaining parameters for the problem. The driver below can be used to call this function for n = 10, n = 100, and n = 1000: driver integrate_visedisc.m mu = 5.9E-3; h = 2.0E-3; omega199/662"pi: rmin = 0.0; max = 0.2: for n = [10 100 1000) moment func integrate_viscdiscan, mu, h, omega, mmin, max): fprintf("The moment..computed with Ad stepsis:x11.4eNm '. n, moment); 10 end Line 7 starts a loops that will evaluate the function for different values of n. On line 8, the function is called and the result is stored in a variable named moment. On line 9, the result is printed to the command window. Blanks in a string are denoted by the underscore symbol. . Hand in a printout of all your code and the results from executing it

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!