0% found this document useful (0 votes)
45 views1 page

Try This Example : Complex Contour Integration Using Waypoints

This document provides information about numerical integration in MATLAB using the integral function. It gives examples of integrating complex functions over contours in the complex plane, vector-valued functions, and an improper integral of an oscillatory function.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views1 page

Try This Example : Complex Contour Integration Using Waypoints

This document provides information about numerical integration in MATLAB using the integral function. It gives examples of integrating complex functions over contours in the complex plane, vector-valued functions, and an improper integral of an oscillatory function.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Numerical integration - MATLAB integral https://www.mathworks.com/help/matlab/ref/integral.

html

q2 =
-1.000000000000010

 Complex Contour Integration Using Waypoints

Create the function f (z) = 1/(2z − 1) .


Try This Example

Copy Command  

fun = @(z) 1./(2*z-1);

Integrate in the complex plane over the triangular path from 0 to 1+1i to 1-1i to 0 by specifying waypoints.

q = integral(fun,0,0,'Waypoints',[1+1i,1-1i])

q = 0.0000 - 3.1416i

 Vector-Valued Function

Create the vector-valued function f (x) = [sinx, sin2x, sin3x, sin4x, sin5x] and integrate from x=0 to x=1. Specify
'ArrayValued',true to evaluate the integral of an array-valued or vector-valued function. Try This Example

Copy Command  

fun = @(x)sin((1:5)*x);
q = integral(fun,0,1,'ArrayValued',true)

q = 1×5

0.4597 0.7081 0.6633 0.4134 0.1433

 Improper Integral of Oscillatory Function

Create the function f (x) = x5e−xsinx .


Try This Example

Copy Command  

fun = @(x)x.^5.*exp(-x).*sin(x);

Evaluate the integral from x=0 to x=Inf , adjusting the absolute and relative tolerances.

format long
q = integral(fun,0,Inf,'RelTol',1e-8,'AbsTol',1e-13)

q =
-14.999999999998360

Input Arguments collapse all

fun — Integrand
 function handle

Integrand, speci�ed as a function handle, which de�nes the function to be integrated from xmin to xmax.

For scalar-valued problems, the function y = fun(x) must accept a vector argument, x, and return a vector result, y. This generally means that fun must use array
operators instead of matrix operators. For example, use .* (times) rather than * (mtimes). If you set the 'ArrayValued' option to true, then fun must accept a
scalar and return an array of �xed size.

xmin — Lower limit of x


 real number | complex number

Lower limit of x, speci�ed as a real (�nite or in�nite) scalar value or a complex (�nite) scalar value. If either xmin or xmax are complex, then integral approximates
the path integral from xmin to xmax over a straight line path.

2 of 4 12-Aug-22, 12:35 AM

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy