You are a guest. Restricted access. Read more

Numerical Integration

Two routines are supplied for numerical integration, which are both not very sophisticated. quad('expression',ll,ul) is modelled after the Octave/Matlab integration function, but much simpler. Simpson's method is applied with a fixed number of nodes. This function uses the “eval”-method rather than symbolic variables. The function has to be supplied as quoted string, and must be compatible with vector arguments. Finally, the variable name must be x. romberg uses symbolic function definitions, and a symbolic variable has to be supplied. The maximum number of iterations is set by the variable rombergit (default $11$) and accuracy by rombergtol (default: $10^{-4}$).


syms x
y=quad('exp(-x.^2)',0,5)
printf('%f',y)


syms x
y=romberg(exp(-x^2),x,0,5)
printf('%f',y)

jmathlab/calculus/integrals_num.txt · Last modified: 2013/04/14 16:52 (external edit)
Back to top
CC Attribution-Share Alike 3.0 Unported
chimeric.de = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0