Top Banner
Trapezoidal Method
21
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Presentation on Numerical Method (Trapezoidal Method)

Trapezoidal Method

Page 2: Presentation on Numerical Method (Trapezoidal Method)

Acknowledgement

Md. Jashim Uddin

Assistant Professor

Dept. Of Natural Sciences

Dept. Of Computer Science and

Engineering

Daffodil International University

Page 3: Presentation on Numerical Method (Trapezoidal Method)

Content What is Trapezoidal Method

General Formula of Integration

How it works

History of Trapezoidal Method

Advantages

Application of Trapezoidal Rule

Example

Problem & Algorithm

C code for Trapezoidal Rule

Live Preview

Conclusion

References

Page 4: Presentation on Numerical Method (Trapezoidal Method)

Team : Root FinderGroup Member :

• Syed Ahmed Zaki ID:131-15-2169

• Fatema Khatun ID:131-15-2372

• Sumi Basak ID:131-15-2364

• Priangka Kirtania ID:131-15-2385

• Afruza Zinnurain ID:131-15-2345

Page 5: Presentation on Numerical Method (Trapezoidal Method)

What is Trapezoidal Method ?

In numerical analysis, the trapezoidal rule or method is a

technique for approximating the definite integral.

𝑥0𝑥𝑛

f(x) dx

It also known as Trapezium rule.

1

Page 6: Presentation on Numerical Method (Trapezoidal Method)

General Formula of Integration

In general Integration formula when n=1 its

Trapezoidal rule.

I=h[n𝑦0+ 𝑛2

2∆𝑦0+

2𝑛3−3𝑛2

12∆2𝑦0+

𝑛4−4𝑛3+4𝑛2

24∆3𝑦0 +⋯ ]

After putting n=1,

Trapezoidal Rule = ℎ

2[𝑦0 + 𝑦𝑛 + 2(𝑦1 + 𝑦2 + 𝑦3 +⋯ . 𝑦𝑛−1)]

2

Page 7: Presentation on Numerical Method (Trapezoidal Method)

How it works ?

Area A=𝑏1+𝑏2

2ℎ

Trapezoid is an one kind of rectangle which has 4 sides and minimum two sides are parallel

3

Page 8: Presentation on Numerical Method (Trapezoidal Method)

The trapezoidal rule works

by approximating the region

under the graph of the

function as a trapezoid and

calculating its area in limit.

It follows that,

𝑎𝑏

f(x) dx ≈ (b−a)2

[f(a) +f(b)]

4

Page 9: Presentation on Numerical Method (Trapezoidal Method)

The trapezoidal rule

approximation improves

With More strips , from

This figure we can clearly

See it

5

Page 10: Presentation on Numerical Method (Trapezoidal Method)

History Of Trapezoidal Method

• Trapezoidal Rule,” by Nick Trefethen and André Weideman. It deals with a fundamental and classical issue in numerical analysis—approximating an integral.

• By focusing on up-to-date covergence of recent results

Trefethen

6

Page 11: Presentation on Numerical Method (Trapezoidal Method)

There are many alternatives to the trapezoidal rule,

but this method deserves attention because of

• Its ease of use

• Powerful convergence properties

• Straightforward analysis

Advantages

7

Page 12: Presentation on Numerical Method (Trapezoidal Method)

Application of Trapezoidal Rule

• The trapezoidal rule is one of the family members of

numerical-integration formula.

• The trapezoidal rule has faster convergence.

• Moreover, the trapezoidal rule tends to become

extremely accurate than periodic functions

8

Page 13: Presentation on Numerical Method (Trapezoidal Method)

Example:

𝑥1 𝑥2 𝑥3=1 =5

1

5

1 + 𝑥2 𝑑𝑥

h = 5−1

4=1

Trapezoidal Rule = 1

2[ 𝑓(1) + 𝑓(5) + 2(𝑓(2) + 𝑓(3) + 𝑓(4)]

=2 =3 =4

= 1

2[ (1 + 12) + (1 + 52) + 2((1 + 22) + (1 + 32) + (1 + 42)]

= 1

2× 92

= 469

Page 14: Presentation on Numerical Method (Trapezoidal Method)

Problem & Algorithm

Problem: Here we have to find integration for the (1+𝑥2)dx with lower limit =1 to upper limit = 5

Algorithm:

Step 1: input a,b,number of interval n

Step 2: h=(b-a)/n

Step 3: sum=f(a)+f(b)

Step 4: If n=1,2,3,……i

Then , sum=sum+2*y(a+i*h)

Step 5: Display output=sum *h/2

10

Page 15: Presentation on Numerical Method (Trapezoidal Method)

C Code for Trapezoidal Method

#include<stdio.h>

float y(float x)

{

return (1+x*x);

}

int main()

{

float a,b,h,sum;

int i,n;

printf("Enter a=x0(lower limit), b=xn(upper limit), number of

subintervals: ");

11

Page 16: Presentation on Numerical Method (Trapezoidal Method)

scanf("%f %f %d",&a,&b,&n);

h=(b-a)/n;

sum=y(a)+y(b);

for(i=1;i<n;i++)

{

sum=sum+2*y(a+i*h);

}

printf("\n Value of integral is %f \n",(h/2)*sum);

return 0;

}

12

Page 17: Presentation on Numerical Method (Trapezoidal Method)

Live Preview

Live Preview of Trapezoidal Method

1

5

1 + 𝑥2 𝑑𝑥

Lower limit =1

Upper limit =5

Interval h=4

13

Page 18: Presentation on Numerical Method (Trapezoidal Method)

Conclusion

Trapezoidal Method can be applied accurately for

non periodic function, also in terms of periodic

integrals.

when periodic functions are integrated over their

periods, trapezoidal looks for extremely accurate.

14

Periodic Integral Function

Page 19: Presentation on Numerical Method (Trapezoidal Method)

http://en.wikipedia.org/wiki/Trapezoidal_rule

http://blogs.siam.org/the-mathematics-and-

history-of-the-trapezoidal-rule/

And various relevant websites

References

15

Page 20: Presentation on Numerical Method (Trapezoidal Method)
Page 21: Presentation on Numerical Method (Trapezoidal Method)

Thank You