Triple integral found sym ?

4 views (last 30 days)
DM
DM on 19 Nov 2014
Commented: DM on 19 Nov 2014
I am trying to perform a numerical triple integral over s, gamma1, gamma2. The limits are (-inf +int) (0,+inf) and (gamma1,+inf) respectively.
The following is my code
syms s
syms gamma1
syms gamma2
fun=-(exp(-(28035689158432973*pi*gamma2^(2/3))/2305843009213693952)*exp(-(pi*s*7120816246010697*i)/112589990684262400)*(1/((pi*s*(4194304/gamma1^2 + 4194304/gamma2^2)*i)/(50*(6144/gamma1 + 6144/gamma2)) + 1)^((3*(2048/gamma1 + 2048/gamma2)^2)/(4194304/gamma1^2 + 4194304/gamma2^2)) - 1)*(exp(-(pi^2*s*(log((-(gamma2*25*i)/(1024*pi*s))^(1/3) + 1)/3;
y=@(s,gamma1,gamma2)fun;
gamma2min=@(s,gamma1) gamma1;
prob=integral3(y,-inf,+inf,0,+inf,gamma2min,+inf)
I get the following error
Error using integralCalc/finalInputChecks (line 511) Input function must return 'double' or 'single' values. Found 'sym'.
Any advice?
Thank you very much!

Answers (2)

Roger Stafford
Roger Stafford on 19 Nov 2014
Matlab's error message has told you what one difficulty is. Your input function is returning 'sym' values because you declared s, gamma1, and gamma2 as of type 'sym', and 'integral' expects a numeric type, 'double' or 'single'. You should eliminate the 'syms' declarations.
Also I notice that there are fractional powers of quantities such as
(-(gamma2*25*i)/(1024*pi*s))^(1/3)
where the 1/3 power can yield any one of three possible results. You need to resolve any such ambiguities, or you may get results other than what you expect.
  1 Comment
DM
DM on 19 Nov 2014
Thanks, what are the three possible results, you mentioned?

Sign in to comment.


MA
MA on 19 Nov 2014
fist of all your function hasn't written correct syntactically, then you can use this code:
syms s gamma1 gamma2
y=f(s,gamma1,gamma2);
prob=double(int(int(int(y,gamma2,gamma1,+inf),gamma1,0,+inf),s,-inf,+inf))
  1 Comment
DM
DM on 19 Nov 2014
The function is not integrable symbollically, this is why I chose to do it numerically. I dont think I can use the int function as you provided.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!