Quadrature of the absolute value of a function

버전 1.1 (26 KB) 작성자: Jan Valdman
Quadrature of the absolute value of a function
다운로드 수: 516
업데이트 날짜: 2016/3/19

라이선스 보기

Given a set x of discrete points in 1D and a set of values y=f(x) at these points, a Matlab function trapz(x,abs(y)) provides a quadrature based on a piece-wise linear interpolation of a function f (known as the trapezoidal rule).
Our new function trapzAbs(x,y) detects intervals (x_i, x_{i+1}), where y(x_i)*y(x_{i+1))>0 and applies the regula falsi method and integrates the absolute value of the linear interpolant exactly. Consequently, the approximation of the solution f(x)=0 is provided.
In 2D, this idea it generalized for a P1 approximation (a piecewise affine and globally continuous function know the the finite element method), defined of given triangulation. Then, triangles with vertices v1=(x1,y1), v2=(x2,y2), v3=(x3,y3) satisfying f(v1)*f(v2)*f(v3) >0 are detected and the integral of the absolute value of the function is computed exactly. Similarly, the approximation of the solution f(x,y)=0 is provided.

Our focus is to integrate the absolute value (or its branches) of a given P1 approximation in 1D and 2D exactly.

To test the code, run

example_1D or comparison_1D or example_2D or comparison_2D.

The ideas will be explained in the forthcoming Bc. thesis of Jiri Kadlec written under the supervision of Jan Valdman at the University of South Bohemia in Ceske Budejovice.

인용 양식

Jan Valdman (2024). Quadrature of the absolute value of a function (https://www.mathworks.com/matlabcentral/fileexchange/54183-quadrature-of-the-absolute-value-of-a-function), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2014b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Numerical Integration and Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.1

Now, trapzAbs(x,y) does not depend on trapzMinus and trapzPlus function and it is therefore faster.

1.0.0.0