Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Perform the Trapezoidal Method to compute the definite intergral of a function

조회 수: 1 (최근 30일)
Jared Martin
Jared Martin 2015년 4월 21일
마감: John D'Errico 2015년 4월 21일
This program will perform the Trapezoidal Method to compute the definite integral of a given function f(x) over the given interval of a to b. This technique is explained in the course textbook in section 13.5 (Numerical Integration). T0 = (1/2)(f(a)+f(b))(b-a) Tk = (1/2)(Tk-1)+delta xk summation from i=1 to n-1 of f(a+i*delta xk): for all odd numbers from 1 to n-1.
where: delta xk = (b-a)/2^k n= 2^k f(x)= 1/(x^2) is the function to be evaluated
This Program should perform at least the following functions: 1. The program should display a title banner which has the title of Trapezoidal Method of Integration and some brief text that explains the functionality of the program. 2. The program should accept the number of iterations (k) to be ran. For this problem one test case is sufficient if it is greater than 6. 3. Write a function that computes the value of f(x) for any given x. Look at Chapter 6 of the course textbook for examples. 4. Use the Trapezoidal Method to compute the integral over the range 1 to 2 (a=1, b=2). 5. Output to the screen the formatted result of the integration Method for each step k in Equation 4. Remembering that there will be at least 6 iterations based on other program requirements given.
  댓글 수: 1
John D'Errico
John D'Errico 2015년 4월 21일
So the only effort you have made on your homework is to type in each assignment as given. Start making an effort.

답변 (0개)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by