310 likes | 759 Views
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.
E N D
Numerical Integration 數值方法2008, Applied Mathematics NDHU
Four 2-variate Gaussians 數值方法2008, Applied Mathematics NDHU
Four 2-variate Gaussians 數值方法2008, Applied Mathematics NDHU
Gaussian pdf 數值方法2008, Applied Mathematics NDHU
Weight sum of Gaussian pdfs 數值方法2008, Applied Mathematics NDHU
myfx4.m 數值方法2008, Applied Mathematics NDHU
Plot 4G plot_4G.m 數值方法2008, Applied Mathematics NDHU
Integration of 4G demo_int_4G.m Double integration 數值方法2008, Applied Mathematics NDHU
Numeric calculus for double integrals 數值方法2008, Applied Mathematics NDHU
demo_ex2_4G.m Example 2.230985172585607 by dblquard.m 數值方法2008, Applied Mathematics NDHU
exp(cos(x)) plot_expcos.m 數值方法2008, Applied Mathematics NDHU
Definite Integration demo_quad.m 數值方法2008, Applied Mathematics NDHU
Symbolic integration demo_int.m 數值方法2008, Applied Mathematics NDHU
Example function of x:x.^2+2*x-5 fx1 = Inline function: fx1(x) = 1./3.*x.^3+x.^2-5.*x 數值方法2008, Applied Mathematics NDHU
Numerical integration - quadrature 數值方法2008, Applied Mathematics NDHU
Counter example >> demo_int function of x:(1-sin(x.^2)).^(1/3) Warning: Explicit integral could not be found. 數值方法2008, Applied Mathematics NDHU
plot_sin13.m 數值方法2008, Applied Mathematics NDHU
Numerical integration demo_quad2.m 數值方法2008, Applied Mathematics NDHU
Mesh 數值方法2008, Applied Mathematics NDHU
Lower and upper sum 數值方法2008, Applied Mathematics NDHU
Lower sum : lower bound 數值方法2008, Applied Mathematics NDHU
Upper sum : upper bound 數值方法2008, Applied Mathematics NDHU
Composite Trapezoid rule 數值方法2008, Applied Mathematics NDHU
Uniform mesh 數值方法2008, Applied Mathematics NDHU
Error Analysis 數值方法2008, Applied Mathematics NDHU
Partition size 數值方法2008, Applied Mathematics NDHU
Composite Trapezoid rule • input s, a and b • f = inline(s); Set n • h = (b-a)/n; ans= 1/2*(f(a)+f(b)) • for i=1:n-1 add f(a+i*h) to ans • ans= ans*h 數值方法2008, Applied Mathematics NDHU
Flow Chart Input s,a,b f = inline(s); Set n h = (b-a)/n; ans = 1/2*(f(a)+f(b)) for i=1:n-1 add f(a+i*h) to ans ans= ans*h EXIT 數值方法2008, Applied Mathematics NDHU
Simpson rule for numerical integration 數值方法2008, Applied Mathematics NDHU
Exercise • Draw a flow chart to illustrate integration by the composite Trapezoid rule • Implement the composite Trapezoid rule for numerical integration, including flow chart and Matlabcodes • Test your matlab function with the following integration • * 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 f(x)=exp(cos(x)) 數值方法2008, Applied Mathematics NDHU