Output is coming out as a large expression
Show older comments
When I run the code below, the outputs appear as a large expression. Here, I have a upper limit in one of the sym summation min() condition. Pl somebody help me to get the output in simple numeric form.
clc;
syms n m p q s l up_lt
mu=1.0051;
nu=0.1015;
eta=0.0922;
k=2;
assume(p>=0);
assume(q>=0);
assume(l>=0);
assume(s>=0);
assume(m>=0);
assume(n>=0);
x1= 2.*q + l -m;
y1= 2.*p - n;
up_lt= min(x1,y1); %%%%%%%%% Upper limit of the sum in sGnmp3
Gnmp1= (((-1).^(k-l))-1).*nchoosek(k,l).*((eta.*(mu-nu)).^(k-l)).*((mu.*nu./2).^l);
sGnmp1= symsum(Gnmp1,l,0,k);
Gnmp2= (1./(factorial(p).*factorial(q))).*nchoosek(p,n-p).*nchoosek(q,m-q);
sGnmp2= symsum(symsum(Gnmp2,q,0,m),p,0,n);
Gnmp3= ((2.*mu./nu).^s).*factorial(s).*nchoosek(x1,s) .*nchoosek(y1,s).*hermiteH(x1-s,0).*hermiteH(y1-s, 0);
sGnmp3= symsum(Gnmp3,s,0,up_lt);
Gnmm1= (((-1).^(k-l))+1).*nchoosek(k,l).*((eta.*(mu-nu)).^(k-l)).*((mu.*nu./2).^l);
sGnmm1= symsum(Gnmm1,l,0,k);
Gnmp= symfun((sqrt(factorial(n).*factorial(m)).*((nu./(2.*mu)).^((n+m)./2)).*sGnmp1.*sGnmp2.*sGnmp3),[n,m]);
Gnmm= symfun((sqrt(factorial(n).*factorial(m)).*((nu./(2.*mu)).^((n+m)./2)).*sGnmm1.*sGnmp2.*sGnmp3),[n,m]);
outp= vpa(Gnmp(6,5)) %%% n and m can be taken as any positive integer.
outm= vpa(Gnmm(5,5))
Accepted Answer
More Answers (0)
Categories
Find more on MATLAB 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!