Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello experts! Attached below you may find one problem with several items to be completed, please answer the question with its respective items as the

Hello experts! Attached below you may find one problem with several items to be completed, please answer the question with its respective items as the entire set will account just for 1 problem according to chegg's policies. I will prefer the answer to be short/concise with legible handwritten work/drawing/text (I have some dyslexia problems and I will be really glad if you could support me with the previous request). Please comment every section of it. Thank you so much for your time and effort experts!

PROBLEM TO BE SOLVED

image text in transcribed

Please use and modify the script below for the following assingment

clc; clear; close all;

syms x %symbolical value

f = @ (x) sin(x)/(x^3)+log(x)^2; %Function

g = int(f,x,1,pi); %integreated function

diff(f,x) %Differentiate

%%

N = 200; %number of panels

dx = (pi-1)/N; %Delta x or change in x.

h = linspace(1,pi,N+1); %%widht of each panel. need all except the last point. N+1 symbolizes all the points (partitions) involved which is 201

LRS = dx * (sum(f(1:end-1))); %Left Riemman summ. Start with the frist one and add all the the enties but the alst one

RRS = dx * (sum(f(2:end))); %Right Riemman Summ

MP = 2*dx * (sum(f(2:2:end-1))); %Mid point. put 2 panel next to each other a evaluate the mid point. with a spaceing of 2 and doubling dx so we have 2 panels counted as one

TRA = 0.5*dx * (f(1)+f(end) + 2*sum(f(2:end-1))); %trapezoidal

SYM = %Sympson's Rule

exact_soln = eval(g); %exact solution

error = abs((exact_soln - RRS)./exact_soln)*100 %error of aproximation trhough estimation method

y = [LRS;RRS;MP;TRA;exact_soln]; %Aproximate values

z = [LRS;RRS;MP;TRA;exact_soln]; %Error of aproximation

w = [y,z]

(x) Estimate 1 =?(sin32 + Int) dx using the left and right Riemann sums, midpoint rule, trapezoidal (+ In x2) dx using the left and right Riemann sums, midpoint rule, trapezoidal rule and Simpson's rule. Use 200 panels; evaluate f at 201 points and use f for all estimations. The "recipes" for the methods are provided below. Find the exact solution as was shown in class (ask me in class on Thursday and we will go over it once more) and calculate the error with each estimation method Once your .m file is executed, it should print out two column vectors (6x1). The first vector will contairn the approximate solutions and the second one the error of approximation. The entries in the two vectors should be in the following order: left Riemann sum, right Riemann sum, midpoint rule, trapezoidal rule, Simpson's rule, and the exact solution exact solution-estimated solution exact solution % error x 100 Note: I am referring to the first point with a subscript of 0. In MATLAB, the first point will be the first entry in the vector that contains the position of x-values corresponding to the panels in the window of integration Left Riemann ~ h x(?:0 f) Right Riemann l~ h x(?-15) l ~ h (0.5 fo + 0.5 fn +?: I~-(fo + fn +4??-1(odd) fj +2EFdeven) f) Trapezoidal Simpson f represents the function whose definite integral is being estimated. Subscripts refer to the partitions that create the panels. So if we have 32 panels (notice you will need 200 panels), we need 33 partition; the first one is denoted by 0 and the last one by n. h refers to the width of each panel (assumed to be uniform across all panels) (x) Estimate 1 =?(sin32 + Int) dx using the left and right Riemann sums, midpoint rule, trapezoidal (+ In x2) dx using the left and right Riemann sums, midpoint rule, trapezoidal rule and Simpson's rule. Use 200 panels; evaluate f at 201 points and use f for all estimations. The "recipes" for the methods are provided below. Find the exact solution as was shown in class (ask me in class on Thursday and we will go over it once more) and calculate the error with each estimation method Once your .m file is executed, it should print out two column vectors (6x1). The first vector will contairn the approximate solutions and the second one the error of approximation. The entries in the two vectors should be in the following order: left Riemann sum, right Riemann sum, midpoint rule, trapezoidal rule, Simpson's rule, and the exact solution exact solution-estimated solution exact solution % error x 100 Note: I am referring to the first point with a subscript of 0. In MATLAB, the first point will be the first entry in the vector that contains the position of x-values corresponding to the panels in the window of integration Left Riemann ~ h x(?:0 f) Right Riemann l~ h x(?-15) l ~ h (0.5 fo + 0.5 fn +?: I~-(fo + fn +4??-1(odd) fj +2EFdeven) f) Trapezoidal Simpson f represents the function whose definite integral is being estimated. Subscripts refer to the partitions that create the panels. So if we have 32 panels (notice you will need 200 panels), we need 33 partition; the first one is denoted by 0 and the last one by n. h refers to the width of each panel (assumed to be uniform across all panels)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spomenik Monument Database

Authors: Donald Niebyl, FUEL, Damon Murray, Stephen Sorrell

1st Edition

0995745536, 978-0995745537

More Books

Students also viewed these Databases questions

Question

6. Explain the strengths of a dialectical approach.

Answered: 1 week ago