[Scilab-users] Int3D / Triple integration

arctica1963 arctica1963 at gmail.com
Thu Mar 25 17:45:02 CET 2021


Hello,

Following on from a previous query I had on this matter, I am not having
much success with int3d for triple integration, largely due to the need to
build tetrahedrons. CGLab does have this option (delauney3d) but is not
available for 6.1.0, and it is not entirely clear how it would interface
with int3d.

Monte-Carlo integration is one route - located this online (added xmin xmax
etc):

function mcInt3d = intg3d(f,xmin,xmax,ymin,ymax,zmin,zmax,N) 
vol = (xmax-xmin)*(ymax-ymin)*(zmax-zmin)         
xr = (xmax-xmin)*rand(1,N)+xmin         
yr = (ymax-ymin)*rand(1,N)+ymin         
zr = (zmax-zmin)*rand(1,N)+zmin         
sumf= sum(f(xr,yr,zr))  
mcInt3d = vol*sumf/N 
endfunction

It does work but in order to get close to a good approximation, N needs to
be quite large. I am sure if we could get int3d to be more user friendly
that would be great.

More of a shout out to anyone who has used int3d using limits defined for
x,y,z and how to vectorise the tetrahedrons. Would love to be able to crack
this problem.

Thanks

Lester



--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html



More information about the users mailing list