Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.3.2 - English

Change language to:
Français - 日本語 - Português

Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function

Scilab help >> Differential Equations, Integration > integrate

integrate

integration of an expression by quadrature

Calling Sequence

x=integrate(expr,v,x0,x1 [,atol [,rtol]])

Arguments

expr

Character string defining a Scilab expression.

v

Character string, the integration variable name)

x0

real number, the lower bound of integration

x1

vector of real numbers, upper bounds of integration

atol

real number (absolute error bound) Default value: 1.-8

rtol

real number, (relative error bound) Default value: 1e-14

x

vector of real numbers, the integral value for each x1(i).

Description

computes : for i=1:size(x1,'*')

Where is given by the expression expr.

The evaluation hopefully satisfies following claim for accuracy: abs(I-x)<= max(atol,rtol*abs(I)) where I stands for the exact value of the integral.

Restriction

the given expression should not use variable names with a leading %.

Examples

x0=0;x1=0:0.1:2*%pi;
X=integrate('sin(x)','x',x0,x1);
norm(cos(x1)-(1-X))

 x1=-10:0.1:10;
X=integrate(['if x==0 then 1,';
             'else sin(x)/x,end'],'x',0,x1)

See Also

  • intg — definite integral
  • inttrap — integration of experimental data by trapezoidal interpolation
  • intsplin — integration of experimental data by spline interpolation
  • ode — ordinary differential equation solver
<< intc Differential Equations, Integration intg >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Thu May 12 11:44:13 CEST 2011