Triple integral found sym ?

2 visualizzazioni (ultimi 30 giorni)
DM
DM il 19 Nov 2014
Commentato: DM il 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!

Risposte (2)

Roger Stafford
Roger Stafford il 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 Commento
DM
DM il 19 Nov 2014
Thanks, what are the three possible results, you mentioned?

Accedi per commentare.


MA
MA il 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 Commento
DM
DM il 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.

Accedi per commentare.

Categorie

Scopri di più su Particle & Nuclear Physics in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by