0% found this document useful (0 votes)
265 views6 pages

Trapezoidal Rule - Equal Sements

This document discusses numerical integration techniques including the trapezoidal rule for equal and unequal segments, built-in functions such as Simpson's rule and Lobatto quadrature, and Romberg integration. It also provides examples calculating the volume of a sphere using Romberg integration for different exponents in the equation for the sphere's radial velocity distribution.

Uploaded by

Krishnan Mohan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
265 views6 pages

Trapezoidal Rule - Equal Sements

This document discusses numerical integration techniques including the trapezoidal rule for equal and unequal segments, built-in functions such as Simpson's rule and Lobatto quadrature, and Romberg integration. It also provides examples calculating the volume of a sphere using Romberg integration for different exponents in the equation for the sphere's radial velocity distribution.

Uploaded by

Krishnan Mohan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Trapezoidal Rule equal sements

Trapezoidal Rule unequal segments

Built in functions to evaluate multiple interals

Simpson (quad)/ Lobatto Rule (quadl, more accurate)


quad: uses adaptive Simpson quadrature; possibly more efficient for low accuracies or nonsmooth
functions
quadl: uses Lobatto quadrature; possibly more efficient for high accuracies and smooth functions

Romberg

4 + 1.5 MARKS
1A
>> r=0:0.1:0.9
r=
Columns 1 through 7
0 0.1000 0.2000 0.3000 0.4000 0.5000 0.6000
Columns 8 through 10
0.7000 0.8000 0.9000

>> vmax=12;
>> ro=0.9

ro =
0.9000
>> v=vmax*(1-(r/ro).^2);
>> plot (r,v)

1B
>> v=vmax*(1-(r/ro).^2);
>> v=@(r) (vmax*(1-(r/ro)^2))*2*pi*r;
>> romberg(v,0,0.9,0.001)
ans =
15.2681

1C
v= vmax * (1-(r/r0)).^(1/n);

12

plot (r,v)
10

0.1

0.2

1D
f=@(r) 12* (1-(r/0.9))^(1/7) *2 *pi*r;
>> romberg (f,0,0.9,0.1)
ans =
23.7522

0.3

0.4

0.5

0.6

0.7

0.8

0.9

You might also like