Hi,
Since this is a large expression, matlab is unable to compute the entire expression from 1 to infinity, and displays the answer in the form mentioned underneath: (includes complex numbers)
MATLAB:
syms m n
>> t = symsum(symsum((0.193 + m^2 + n^2)/((m*n)^2*((0.193 + m^2 + n^2)*(0.193 + m^2 + n^2) + 0.12)), m, 1, Inf ), n, 1, Inf)
t
(500*sum((30349057*pi^2  12379500*psi(( n^2 + (3^(1/2)*i)/5  193/1000)^(1/2) + 1)*( n^2 + (3^(1/2)*i)/5  193/1000)^(1/2) + 579000000*psi(( n^2  (3^(1/2)*i)/5  193/1000)^(1/2) + 1)*( n^2  (3^(1/2)*i)/5  193/1000)^(3/2) + 579000000*psi(( n^2 + (3^(1/2)*i)/5  193/1000)^(1/2) + 1)*( n^2 + (3^(1/2)*i)/5  193/1000)^(3/2)  12379500*psi(( n^2  (3^(1/2)*i)/5  193/1000)^(1/2) + 1)*( n^2  (3^(1/2)*i)/5  193/1000)^(1/2) + 231747000*pi^2*n^2 + 579000000*pi^2*n^4 + 1000000000*pi^2*n^6 + 12379500*psi(1  ( n^2  (3^(1/2)*i)/5  193/1000)^(1/2))*( n^2  (3^(1/2)*i)/5  193/1000)^(1/2) + 12379500*psi(1  ( n^2 + (3^(1/2)*i)/5  193/1000)^(1/2))*( n^2 + (3^(1/2)*i)/5  193/1000)^(1/2)  579000000*psi(1  ( n^2  (3^(1/2)*i)/5  193/1000)^(1/2))*( n^2  (3^(1/2)*i)/5  193/1000)^(3/2)  579000000*psi(1  ( n^2 + (3^(1/2)*i)/5  193/1000)^(1/2))*( n^2 + (3^(1/2)*i)/5 
193/1000)^(3/2) + 1737000000*n^2*psi(( n^2  (3^(1/2)*i)/5  193/1000)^(1/2) + 1)*( n^2  (3^(1/2)*i)/5  193/1000)^(1/2) + 1737000000*n^2*psi(( n^2 + (3^(1/2)*i)/5  193/1000)^(1/2) + 1)*( n^2 + (3^(1/2)*i)/5  193/1000)^(1/2) + 3000000000*n^2*psi(( n^2  (3^(1/2)*i)/5  193/1000)^(1/2) + 1)*( n^2  (3^(1/2)*i)/5  193/1000)^(3/2) + 3000000000*n^2*psi(( n^2 + (3^(1/2)*i)/5  193/1000)^(1/2) + 1)*( n^2 + (3^(1/2)*i)/5  193/1000)^(3/2) + 4500000000*n^4*psi(( n^2  (3^(1/2)*i)/5  193/1000)^(1/2) + 1)*( n^2  (3^(1/2)*i)/5  193/1000)^(1/2) + 4500000000*n^4*psi(( n^2 + (3^(1/2)*i)/5  193/1000)^(1/2) + 1)*( n^2 + (3^(1/2)*i)/5  193/1000)^(1/2)  1737000000*n^2*psi(1  ( n^2  (3^(1/2)*i)/5  193/1000)^(1/2))*( n^2  (3^(1/2)*i)/5  193/1000)^(1/2)  1737000000*n^2*psi(1  ( n^2 + (3^(1/2)*i)/5  193/1000)^(1/2))*( n^2 + (3^(1/2)*i)/5  193/1000)^(1/2) 
3000000000*n^2*psi(1  ( n^2  (3^(1/2)*i)/5  193/1000)^(1/2))*( n^2  (3^(1/2)*i)/5  193/1000)^(3/2)  3000000000*n^2*psi(1  ( n^2 + (3^(1/2)*i)/5  193/1000)^(1/2))*( n^2 + (3^(1/2)*i)/5  193/1000)^(3/2)  4500000000*n^4*psi(1  ( n^2  (3^(1/2)*i)/5  193/1000)^(1/2))*( n^2  (3^(1/2)*i)/5  193/1000)^(1/2)  4500000000*n^4*psi(1  ( n^2 + (3^(1/2)*i)/5  193/1000)^(1/2))*( n^2 + (3^(1/2)*i)/5  193/1000)^(1/2))/(n^2*(1000000*n^4 + 386000*n^2 + 157249)^2), n = 1..Inf))/3
which does not give me the exact value while when I evaluate the same expression in mupad:
t = sum(sum(((0.193 + m^2 + n^2))/((m*n)^2*((0.193 + m^2 + n^2)*(0.193 + m^2 + n^2) + 0.12)), m = 1 .. infinity), n = 1 .. infinity)
t =0.5942218128
Any help would be appreciated.
Thanks,
SB
"Steven Lord" <Steven_Lord@mathworks.com> wrote in message <lpoun7$4pc$1@newscl01ah.mathworks.com>...
>
> "SAONI " <bsaoni@gmail.com> wrote in message
> news:lpordn$ok1$1@newscl01ah.mathworks.com...
> > Hi,
> >
> > I have evaluated a function in mupad and wish to call it in my matlab
> > script. I use evalin in the script for evaluation of the expression. It
> > goes like:
> >
> > t =
> > evalin(symengine,'[(16*sigma*Pa*chi*(L^2)/(pi^6)*w*h)*sum(sum(((((tou^2)/(pi^2))
> > + m^2 + n^2))/((m*n)^2*((((tou^2)/(pi^2)) + m^2 + n^2)*(((tou^2)/(pi^2)) +
> > m^2 + n^2) + ((sigma^2)/(pi^4)))), m = 1 .. infinity), n = 1 ..
> > infinity)]')
> >
> >
> > Now since, '[(16*sigma*Pa*chi*(L^2)/(pi^6)*w*h)*sum(sum(((((tou^2)/(pi^2))
> > + m^2 + n^2))/((m*n)^2*((((tou^2)/(pi^2)) + m^2 + n^2)*(((tou^2)/(pi^2)) +
> > m^2 + n^2) + ((sigma^2)/(pi^4)))), m = 1 .. infinity), n = 1 ..
> > infinity)]' is a string and is evaluated from mupad, it does not take in
> > the values declared to the variables : tou, sigma, chi, Pa,w,h and L from
> > the matlab function file. I could declare the values to these variables in
> > mupad and evaluate the given expression in the function file but it is not
> > convenient since I have to go to mupad to change the values of the
> > variable every time and cannot directly change it from the command line.
> >
> > My question is ..Could I concatenate the strings individually in the
> > function file for the given expression
> > '[(16*sigma*Pa*chi*(L^2)/(pi^6)*w*h)*sum(sum(((((tou^2)/(pi^2)) + m^2 +
> > n^2))/((m*n)^2*((((tou^2)/(pi^2)) + m^2 + n^2)*(((tou^2)/(pi^2)) + m^2 +
> > n^2) + ((sigma^2)/(pi^4)))), m = 1 .. infinity), n = 1 .. infinity)]' and
> > the above mentioned values could take the values declared in the function
> > file or directly from the command line ?
>
> I don't see anything in that expression that requires you to execute it in
> MuPAD. I'd probably use SYMSUM instead:
>
> http://www.mathworks.com/help/symbolic/symsum.html
>
> If there's a specific piece that you need to evaluate in MuPAD, the
> expression you pass into SYMSUM can use evalin(symengine, ...) as far as I
> am aware.
>
> 
> Steve Lord
> slord@mathworks.com
> To contact Technical Support use the Contact Us link on
> http://www.mathworks.com
