do we have relation between LommelS2 and MeijerG in matlab?
Ältere Kommentare anzeigen
Do we have matlab relation between two special function "LommelS2 and MeijerG"?
How to convert LommelS2 code into MeijerG?
Please help !!
Antworten (2)
Walter Roberson
am 25 Jan. 2021
Bearbeitet: Walter Roberson
am 26 Jan. 2021
1 Stimme
and scroll down to near the bottom to see the conversions.
19 Kommentare
gourav pandey
am 25 Jan. 2021
format long g
n=2;
m=5;
omega=10;
a=-(1./4).*n-(1./4).*m+5./4
k2=(1./4).*n+(1./4).*m+1./4
k3=-(1./4).*n-(1./4).*m-1./4
k4=-(1./4).*n-(1./4).*m+5./4
z=-(1./4).*omega.^2
fun=meijerG([a], [], [k2,k3,k4], [], z);
LommelS2 = -fun./(2.*sqrt(pi).*gamma((1./2).*n+(1./2).*m).*2.^((1./2).*n+(1./2).*m-1./2));
LommelS2
gourav pandey
am 26 Jan. 2021
Walter Roberson
am 27 Jan. 2021
Is the question resolved?
gourav pandey
am 27 Jan. 2021
Walter Roberson
am 28 Jan. 2021
Your output of a specific numeric number for fun1 implies that you were using specific numeric n and specific numeric omega (even though you have an assumption as-if omega were a variable instead of constant.) . However, I was not able to figure out what specific numeric n and omega you were using.
Is it correct that your j in the Maple code refers to sqrt(-1) ?
Walter Roberson
am 28 Jan. 2021
Maple does indeed produce inconsistent results for the conversion depending upon whether the z is positive imaginary or negative imaginary. I have filed a bug report for Maple and will see what the response is.
gourav pandey
am 28 Jan. 2021
Mubashara Wali
am 4 Apr. 2021
I need the Matlab code for LommelS2 function. Can you help me?
Walter Roberson
am 4 Apr. 2021
Bearbeitet: Walter Roberson
am 4 Apr. 2021
syms mu nu z
numer = meijerG([mu/2 + 1/2], [], [mu/2 + 1/2, nu/2, -nu/2], [], z.^2/4) .* 2.^mu;
denom = 2 .* gamma(-mu/2 + nu/2 + 1/2) .* gamma(-mu/2 - nu/2 + 1/2);
S2 = numer./denom;
LommelS2(nu, nu, z) = S2;
Caution: this might not operate properly if mu or nu are not scalars. Also, there could be problems if nu = mu+1
Mubashara Wali
am 4 Apr. 2021
Thanx Walter Roberson
Mubashara Wali
am 4 Apr. 2021
Walter Roberson its not working, giving a error "Attempt to execute SCRIPT Lommel as a function:"
Actually I need to find the value of the following

where 0 <alpha <1
ABC(alpha)=1- alpha + (alpha / gamma(alpha))
and t belongs to [0, 1]
Your kind help will be appreciated.
Walter Roberson
am 4 Apr. 2021
Bearbeitet: Walter Roberson
am 4 Apr. 2021
Could you post a link to where I suggested creating or calling a function or script named Lommel ? The code I posted at https://www.mathworks.com/matlabcentral/answers/726363-do-we-have-relation-between-lommels2-and-meijerg-in-matlab#comment_1437812 shows creating a symbolic function named LommelS2
Your "actually I need" uses LommelS1 not LommelS2 so I am confused.
Walter Roberson
am 4 Apr. 2021
Bearbeitet: Walter Roberson
am 5 Apr. 2021
syms mu nu z
S1part1 = meijerG([mu/2 + 1/2], [], [mu/2 + 1/2], [nu/2, -nu/2], z^2/4);
S1part2 = 2.^(mu - 1);
S1part3 = 2 .* gamma(mu/2 + 1/2 + nu/2) .* gamma(mu/2 + 1/2 - nu/2);
LommelS1(mu, nu, z) = simplify(S1part1 .* S1part2 .* S1part3)
S2part1 = meijerG([mu/2 + 1/2], [], [mu/2 + 1/2, nu/2, -nu/2], [], z.^2/4);
S2part2 = 2.^mu;
S2part3 = 2 .* gamma(-mu/2 + nu/2 + 1/2) .* gamma(-mu/2 - nu/2 + 1/2);
LommelS2(mu, nu, z) = simplify(S2part1 .* S2part2 ./ S2part3)
syms alpha t real
assume(0 < alpha & alpha < 1)
assume(0 <= t & t <= 1)
ABC(alpha) = 1 - alpha + (alpha / gamma(alpha)) %CORRECTED
ypart1 = (1-alpha)/ABC(alpha);
ypart2 = gamma(alpha+1) * ABC(alpha);
ypart3 = t.^(1+alpha) - sqrt(t) * LommelS1(3/2+alpha, 1/2, t)
y(t) = simplify(ypart1 + ypart3 ./ ypart2)
Mubashara Wali
am 5 Apr. 2021
Bearbeitet: Walter Roberson
am 5 Apr. 2021
Walter Roberson thanx for detailed answer. It made my concept clear now
Walter Roberson
am 5 Apr. 2021
it looks like I entered the wrong ABC; I will fix it when I get back to my computer.
Mubashara Wali
am 5 Apr. 2021
Ok
Walter Roberson
am 5 Apr. 2021
I have corrected the ABC and regenerated the result. I had accidentally put in 1 - 1- alpha instead of 1 - alpha
Mubashara Wali
am 5 Apr. 2021
Thankyou
gourav pandey
am 5 Apr. 2021
Bearbeitet: gourav pandey
am 5 Apr. 2021
1 Kommentar
Walter Roberson
am 5 Apr. 2021
You are overwriting Lommels within the loop, so the final result will reflect only m == n
Kategorien
Mehr zu Array Geometries and Analysis finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




