Numerical Integration

  • Published on
    23-Feb-2016

  • View
    95

  • Download
    0

Embed Size (px)

DESCRIPTION

Numerical Integration. Four 2-variate Gaussians. Four 2-variate Gaussians. Gaussian pdf. Weight sum of Gaussian pdfs. myfx4.m. Plot 4G. plot_4G.m. Integration of 4G. demo_int_4G.m. Double integration. Numeric calculus for double integrals. demo_ex2_4G.m. Example. - PowerPoint PPT Presentation

Transcript

<p>2008, Applied Mathematics NDHU1Numerical Integration2008, Applied Mathematics NDHU2Four 2-variate Gaussians</p> <p>2008, Applied Mathematics NDHU3Four 2-variate Gaussians</p> <p>2008, Applied Mathematics NDHU4Gaussian pdf</p> <p>2008, Applied Mathematics NDHU5Weight sum of Gaussian pdfs</p> <p>2008, Applied Mathematics NDHU6</p> <p>myfx4.m2008, Applied Mathematics NDHU7Plot 4G</p> <p>plot_4G.m2008, Applied Mathematics NDHU8Integration of 4G</p> <p>demo_int_4G.mDouble integration2008, Applied Mathematics NDHU9Numeric calculus for double integrals</p> <p>2008, Applied Mathematics NDHU10</p> <p>ExampleApprox. integral2.230985141404140True Integral2.230985141404130demo_ex2_4G.m2.230985172585607 by dblquard.mexp(cos(x))2008, Applied Mathematics NDHU11</p> <p>plot_expcos.mDefinite Integration2008, Applied Mathematics NDHU12</p> <p>demo_quad.m</p> <p>Symbolic integration2008, Applied Mathematics NDHU13demo_int.mExample</p> <p>2008, Applied Mathematics NDHU14function of x:x.^2+2*x-5</p> <p>fx1 =</p> <p> Inline function: fx1(x) = 1./3.*x.^3+x.^2-5.*x2008, Applied Mathematics NDHU15Numerical integration - quadrature </p> <p>2008, Applied Mathematics NDHU16Counter example </p> <p>&gt;&gt; demo_intfunction of x:(1-sin(x.^2)).^(1/3)Warning: Explicit integral could not be found.2008, Applied Mathematics NDHU17</p> <p>2008, Applied Mathematics NDHU18</p> <p>plot_sin13.m</p> <p>2008, Applied Mathematics NDHU19Numerical integration</p> <p>demo_quad2.m</p> <p>2008, Applied Mathematics NDHU20Mesh</p> <p>2008, Applied Mathematics NDHU21Lower and upper sum</p> <p>2008, Applied Mathematics NDHU22Lower sum : lower bound</p> <p>2008, Applied Mathematics NDHU23Upper sum : upper bound</p> <p>2008, Applied Mathematics NDHU24Composite Trapezoid rule</p> <p>2008, Applied Mathematics NDHU25Uniform mesh</p> <p>2008, Applied Mathematics NDHU26Error Analysis</p> <p>2008, Applied Mathematics NDHU27Partition size</p> <p>Composite Trapezoid ruleinput s, a and bf = inline(s); Set nh = (b-a)/n; ans = 1/2*(f(a)+f(b))for i=1:n-1 add f(a+i*h) to ansans= ans*h 2008, Applied Mathematics NDHU28f = inline(s); Set nh = (b-a)/n; ans = 1/2*(f(a)+f(b))</p> <p>Input s,a,bFlow Chart2008, Applied Mathematics NDHU29for i=1:n-1add f(a+i*h) to ansans= ans*hEXITSimpson rule for numerical integration</p> <p>2008, Applied Mathematics NDHU30Exercise </p> <p>Draw a flow chart to illustrate integration by the composite Trapezoid ruleImplement the composite Trapezoid rule for numerical integration, including flow chart and Matlab codesTest your matlab function with the following integration</p> <p>* Test your matlab function with definite integration of the weight sum of four Gaussian pdfs* Compare your results with those obtained by using quad.m</p> <p>2008, Applied Mathematics NDHU31f(x)=exp(cos(x))</p>