I am trying to compute a 3d integral by first computing a 2d integral using integral2 and then integral for the outer integral. I get an error :
Matrix diemnsions must agree
when I run the code below. The 2d integral is computed correctly by vzf.
Thanks !
---------------
rp=0.5;
h = 0.19;
zp = h;
huc =0.0;
vzj = vzf(0.7,0.5,0.5,0.0)
dv = integral(@(r) vzf(r,h,h,huc)*r,0,1.0)
function velzz =vzf(rp,zp,h,huc)
%function vzf is the 2d integral
velzz = integral2(@(rho,theta) velzi(rho,theta,rp,zp,h,huc),huc,1.0,0,2*pi);
end
function fz = velzi(rho,theta,rp,zp,h,huc)
% integrand of the 2d integral
fz = pload(rho,huc).*rho.*(zp+h)./(rp.^2 + rho.^2 + (zp+h).^2 + 2*rho.*rp.*cos(theta)).^(3/2) ;
end
function p = pload(r,huc)
p = 1.0*(r-huc).*(2 - r - huc);
end

댓글 수: 1

darova
darova 2019년 5월 11일
Do you have a source formulas? Image or something?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기

제품

릴리스

R2018b

태그

질문:

2019년 5월 11일

댓글:

2019년 5월 11일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by