do we have relation between LommelS2 and MeijerG in matlab?

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
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

thank you for you reply
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));
## can you tell me what is wrong in this code??
format long g
n=2;
m=5;
omega=10;
a=-(1./4).*n-(1./4).*m+5./4
a =
-0.5
k2=(1./4).*n+(1./4).*m+1./4
k2 =
2
k3=-(1./4).*n-(1./4).*m-1./4
k3 =
-2
k4=-(1./4).*n-(1./4).*m+5./4
k4 =
-0.5
z=-(1./4).*omega.^2
z =
-25
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
LommelS2 =
2.52409581072613e-06 + 0.000920671745445133i
Thank you Walter.
Is the question resolved?
actually not completely.
fun1:=evalf(convert(LommelS2(-(1/2)*n-(1/2)*j+3/2, (1/2)*n+(1/2)*j+1/2, I*omega),MeijerG))assuming omega::real,0<omega;
fun1 := 0.00004212956333 + 0.00001923699304 I
fun2:=evalf(convert(LommelS2(-(1/2)*n-(1/2)*j+3/2, (1/2)*n+(1/2)*j+1/2, -I*omega),MeijerG))assuming omega::real,0<omega;
fun2 := 0.00004212956333 + 0.00001923699304 I
fun3:=evalf(LommelS2(-(1/2)*n-(1/2)*j+3/2, (1/2)*n+(1/2)*j+1/2, -I*omega));
fun3 := 0.00004212956330 - 0.00001923699311 I
fun4:=evalf(LommelS2(-(1/2)*n-(1/2)*j+3/2, (1/2)*n+(1/2)*j+1/2, I*omega));
fun4 := 0.4212956330e-4+0.1923699311e-4*I
as you suggested to get relation from MAPLE. so the above code is coded in maple. fun1 and fun2 are conjugate of eact other similarly fun3 and fun4. but we can see the difference in the answer of fun2 and fun3. you can see in BOLD letters.
fun1 and fun2 are converting the lommelS2 into MeijerG where fun3 and fun4 are directing calculating the lommelS2.
there is an issue with conjugate no. in MeijerG. do you know how to resolve this issue??
thank you!!
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) ?
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.
"n" and "j" are the constant where omega is variable between -infinity to +infinty. actually bymistakenly i forget the write the value of n,j,omega. but here my point is "why we are getting different answer for same values of n,j and omega"
even you can check the above code for any random values of n,j,omega.
'j' is not an sqrt(-1)
I need the Matlab code for LommelS2 function. Can you help me?
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
Thanx Walter Roberson
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
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.
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)
LommelS1(mu, nu, z) = 
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)
LommelS2(mu, nu, z) = 
syms alpha t real
assume(0 < alpha & alpha < 1)
assume(0 <= t & t <= 1)
ABC(alpha) = 1 - alpha + (alpha / gamma(alpha)) %CORRECTED
ABC(alpha) = 
ypart1 = (1-alpha)/ABC(alpha);
ypart2 = gamma(alpha+1) * ABC(alpha);
ypart3 = t.^(1+alpha) - sqrt(t) * LommelS1(3/2+alpha, 1/2, t)
ypart3 = 
y(t) = simplify(ypart1 + ypart3 ./ ypart2)
y(t) = 
Mubashara Wali
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
it looks like I entered the wrong ABC; I will fix it when I get back to my computer.
I have corrected the ABC and regenerated the result. I had accidentally put in 1 - 1- alpha instead of 1 - alpha

Melden Sie sich an, um zu kommentieren.

gourav pandey
gourav pandey am 5 Apr. 2021
Bearbeitet: gourav pandey am 5 Apr. 2021
Walter Roberson, thanks for your reply..can you help me here also
clc;
close;
clear all;
n=5;
h=@(omega1) 0;
for m= 0:1:n
mu1c = -(1./2).*n-(1./2).*m+3./2 ;
nu1c = (1./2).*n+(1./2).*m+1./2 ;
Lommels =@(omega1) meijerG([(1./2).*mu1c+1./2], [], [(1./2).*mu1c+1./2, (1./2).*nu1c, -(1./2).*nu1c], [], -(1./4).*omega1.^2).*2^mu1c./(2.*gamma(-(1./2).*mu1c+(1./2).*nu1c+1./2).*gamma(-(1./2).*mu1c-(1./2).*nu1c+1./2))
end
Lommels(1)
Lommels(10)
Lommels(99)
Lommels(100)
Lommels(500)
Lommels(1000)
%% Why m i getting sudden blow in value of 'Lommels' when omega1 veluse more than 120 or 150... it should decay as omega1 increase.
Thank you in advance!!

1 Kommentar

You are overwriting Lommels within the loop, so the final result will reflect only m == n

Melden Sie sich an, um zu kommentieren.

Produkte

Version

R2020b

Gefragt:

am 25 Jan. 2021

Kommentiert:

am 5 Apr. 2021

Community Treasure Hunt

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

Start Hunting!

Translated by