現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
do we have relation between LommelS2 and MeijerG in matlab?
2 ビュー (過去 30 日間)
古いコメントを表示
Do we have matlab relation between two special function "LommelS2 and MeijerG"?
How to convert LommelS2 code into MeijerG?
Please help !!
回答 (2 件)
Walter Roberson
2021 年 1 月 25 日
編集済み: Walter Roberson
2021 年 1 月 26 日
and scroll down to near the bottom to see the conversions.
19 件のコメント
gourav pandey
2021 年 1 月 25 日
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??
Walter Roberson
2021 年 1 月 26 日
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
gourav pandey
2021 年 1 月 27 日
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!!
Walter Roberson
2021 年 1 月 28 日
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
2021 年 1 月 28 日
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
2021 年 1 月 28 日
"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)
Walter Roberson
2021 年 4 月 4 日
編集済み: Walter Roberson
2021 年 4 月 4 日
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
2021 年 4 月 4 日
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
2021 年 4 月 4 日
編集済み: Walter Roberson
2021 年 4 月 4 日
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
2021 年 4 月 4 日
編集済み: Walter Roberson
2021 年 4 月 5 日
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
2021 年 4 月 5 日
編集済み: Walter Roberson
2021 年 4 月 5 日
Walter Roberson thanx for detailed answer. It made my concept clear now
Walter Roberson
2021 年 4 月 5 日
it looks like I entered the wrong ABC; I will fix it when I get back to my computer.
Walter Roberson
2021 年 4 月 5 日
I have corrected the ABC and regenerated the result. I had accidentally put in 1 - 1- alpha instead of 1 - alpha
gourav pandey
2021 年 4 月 5 日
編集済み: gourav pandey
2021 年 4 月 5 日
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 件のコメント
Walter Roberson
2021 年 4 月 5 日
You are overwriting Lommels within the loop, so the final result will reflect only m == n
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
アジア太平洋地域
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)