Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
INTEGRATION
Lec. 3.4: Newton-Cotes Integration Formulae
Dr. Niket Kaisare
Department of Chemical Engineering
IITMadras
NPTEL Course: MATLAB Programming for Numerical Computations Week-3
Numerical Integration
Single application
Trapezoidal Rule
Simpsons 1/3rd Rule
Simpsons 3/8th Rule
Numerical Integration
Numerical Integration
! # m# = / ! k + ! k +
Simpsons 1/3rd
On/(
! # m# = R ! k + 4! k + + ! k + 2
Simpsons 3/8th
OnR(
Rule:
Rule:
! # m# =
R(
p
! k + 3! k + + 3! k + 2 + ! k + 3
Method
Trapezoid
Simp 1/3rd
Simp 3/8th
Formula
(
! k
/
(
! k
R
R(
! k
p
+ ! k +
LTE
3 R
+ 4! k + + ! k + 2
3 ;
+ 3! k + + 3! k + 2 + ! k + 3
3 ;
Example
Consider example from Computational Techniques (Module 6, Part 3)
http://nptel.ac.in/courses/103106074/22:
! # = 2 # + ln #
For this function,
#/
r ! # m# = # + # ln #
2
Use Trapezoidal and Simpsons 1/3rd Rules and compare with true value
NUMERICAL INTEGRATION
Lec. 3.5: Multi-Step Trapezoid/Simpsons Rules
Dr. Niket Kaisare
Department of Chemical Engineering
IITMadras
NPTEL Course: MATLAB Programming for Numerical Computations Week-3
s8 = / ! k
+ ! k +
For Interval-2:
s/ =
(
/
! k +
And so on
+ ! k + 2
s = s8 + s/ + sc
=
t6O
c
2 n
a+h
s8 = / !If we write: !
k + ! k + k
For Interval-2:
s/ =
(
/
! k +
And so on
= !8 , ! k + = !/, , ! v = !cn8
s+=
! + 2 !/ + + !c + !cn8
! 2k +82
s = s8 + s/ + sc
=
1
a
2 n
a+h
t6O
c
Example 1
Consider example from Computational Techniques (Module 6, Part 3)
http://nptel.ac.in/courses/103106074/22:
! # = 2 # + ln #
Compute integral using _
= 2, 5, 10, 20 intervals
Method
Trapezoid
Simp 1/3rd Rule
Simp 3/8th Rule
LTE
3 R
3 ;
3 ;
GTE
3 /
3 7
3 7
NUMERICAL INTEGRATION
Lec. 3.6: MATLAB Functions and Application
Dr. Niket Kaisare
Department of Chemical Engineering
IITMadras
NPTEL Course: MATLAB Programming for Numerical Computations Week-3
I = trapz(x,fval);
Function values fval are specified at corresponding x values
We solve again for !
# = 2 # + ln #
I = quad(@(x) myFun(x),x);
A function myFun is defined to return ! # for a given value of #
Reactor Problem
mz
1 z
*
for = 10, @ = 5 and _ = {0.5}.
w=r
x
y
8./;