Matlab Triple Integration Error. Thank You
1 view (last 30 days)
Show older comments
Dear guys, I am trying to do a triple integration. But I am not very understand the meaning of error message. could you take a look for it? Thank you so much
The code is
clear all;
%%%== just some parameters here ========
a=4;
la1=1/(pi*500^2); la2= la1*5;
p1=25; p2=p1/25;
sgma2=10^(-11);
index=1;
g=2./a;
syms r u1 u2 u3
powe= -2
seta= 10^powe;
q=pi.*(la1.*p1.^(2./a)+la2.*p2.^(2./a));
%%%=== parameters end ================
yi = @(u3,u2,u1) exp(-u3.*(1+2.*...
(pi./4 - atan(10.*(u3.^2./u1.^2 + u3.^2./u2.^2 + 1).^(1./2))./2 )./...
((( (u3./u1).^(a./2) + (u3./u2).^(a./2) + 1 ).^(2./a)).*seta.^(-2./a)))).*...
exp(-sgma2.*q.^(-a./2).* seta.*u3.^(a./2)./...
((( (u3./u1).^(a./2) + (u3./u2).^(a./2) + 1 ).^(2./a)).^(a./2)) );
maxF2 =@(u2) u2;
maxF3 =@(u3) u3;
out2 = integral3(yi, 0, Inf , 0, maxF3 , 0, maxF2)
As you see, u3 is [0, Inf], u2 is [0, u3], u1 is [0, u2]. Error is showing me as
Error using @(u2)u2
Too many input arguments.
Error in integral3>@(y)ZMAXXY(x(1)*ones(size(y)),y) (line 142)
@(y)ZMAXXY(x(1)*ones(size(y)),y), ...
Error in integral2Calc>integral2t/tensor (line 191)
top = YMAX(x);
Error in integral2Calc>integral2t (line 56)
[Qsub,esub] = tensor(thetaL,thetaR,phiB,phiT);
Error in integral2Calc (line 10)
[q,errbnd] = integral2t(fun,xmin,xmax,ymin,ymax,optionstruct);
Error in integral3/innerintegral (line 138)
Q1 = integral2Calc( ...
Error in integralCalc/iterateScalarValued (line 314)
fx = FUN(t);
Error in integralCalc/vadapt (line 133)
[q,errbnd] = iterateScalarValued(u,tinterval,pathlen);
Error in integralCalc (line 84)
[q,errbnd] = vadapt(@AToInfInvTransform,interval);
Error in integral3 (line 122)
Q = integralCalc(@innerintegral,xmin,xmax,integralOptions);
Error in ref7_equ11n3 (line 33)
out2 = integral3(yi, 0, Inf , 0, maxF3 , 0, maxF2)
What's meaning of 'Error using @(u2)u2 Too many input arguments.' ?? If I change u2,u3's range to real number (e.g. out2 = integral3(yi, 0, Inf , 0, 1000 , 0, 1000). ), then it's working. out2 will be a real number. Thanks for your time!
0 Comments
Accepted Answer
Shoaibur Rahman
on 28 Dec 2014
Replace out2 by
out2 = integral3(yi, 0, Inf , 0, @(u3) u3 , 0, @(u3,u2) u2)
If you want to use function handles as the integration limit, then
ymax should be function x, in your case u3
zmax should be a function x and y, in your case u3 and u2, although u3 has no effect
3 Comments
Shoaibur Rahman
on 28 Dec 2014
It's my pleasure, and thanks a lot for accepting!
Go down to the Input Arguments, and click on ymin, ymax, zmin, and zmax to see their acceptable types.
More Answers (0)
See Also
Categories
Find more on Matrix Computations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!