| Group: | Mathematical Functions |
| Topic: | Integration |
| Function: | simpsonint | |
| Description: | simpsonint computes the integral of a given realvalued function about a d-dimensional cube [a_1,b_1] x ... x [a_d,b_d]. The method of simpson is used. |
| Usage: | y = simpsonint (func, a, b, m) | |
| Input: | ||
| func | text, name of the procedure where the function is defined | |
| a | d vector, containing the begining points of the intervals. | |
| b | d vector, containing the end points of the intervals. | |
| m | d vector, 2 * m(i) is the number of subintervals in the i-th dimension. | |
| Output: | ||
| y | scalar, value of the integral | |
proc(y) = fun(x)
y=sum(x^3)
endp
a = #(0,0)
b = #(1,2)
m = #(3,6)
simpsonint("fun",a,b,m)
Contents of simpson [1,] 4.5
| Group: | Mathematical Functions |
| Topic: | Integration |