matlab - Weird (I guess) behavior of integral3 -


i trying calculate simple triple integral in matlab using integral3. namely, integral

it easy calculate i=1. however, implement as

f =@(rho, x, y) 8/pi .* rho ; xmin =  0; xmax = 1; rhomin = 0; rhomax = @(x) 2.*(1-x); ymin = 0; ymax = @(x,rho) sqrt(1-(x + rho/2).^2);  integral3(f, xmin, xmax, rhomin, rhomax, ymin, ymax,'method', 'auto'); 

and result 0.499999999999976.

what doing wrong?! in advance.

the order of limits have same order of variable inputs of function, change function definition to

f =@(x, rho, y) 8/pi .* rho ; 

Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -