Wrong solution of differential equation using symbolic lambda

As can be seen in the screenshot I have a problem with the symbol lambda in matlab R2021B. If lambda is used instead of the variable L, a wrong solution for the differential equation is obtained. What can be the cause for this problem? Many thanks in advance!
clear all
syms R(r) L
assume(L, "real")
assume(L > 0)
vgl = r*diff(R(r),2,r) + diff(R(r),1,r) == L*r*R(r)
dsolve(vgl)
clear all
syms R(r) lambda
assume(lambda, "real")
assume(lambda > 0)
vgl = r*diff(R(r),2,r) + diff(R(r),1,r) == lambda*r*R(r)
dsolve(vgl)

댓글 수: 3

John D'Errico
John D'Errico 2021년 11월 23일
편집: John D'Errico 2021년 11월 23일
It is so much easier for someone to help you, if you just pasted in text showing the problem. Now someone needs to rewrite your code to show what is happening, or even to test out your assertions of what happened. As well, to be able to test out your assertions, you need to tell people which release of MATLAB you see this happen in, as otherwise we cannot help you. Could this be some strange bug in an old release, that got fixed since? Maybe. (It cannot be too old a release, since you used " quotes on "real".)
Another possibility is, these are the same solution, merely using different Bessel functions. One would need to verify they are not both valid solutions.
Is there a good reason why you would want to make it more difficult to get help?
Thanks for your answer. I'm sorry, it's the first time I post something here... The code is in there and it is in Matlab R2021B, cause I needed to fill it in to submit the question I thought you could see it also.
I don't have an answer, but the result seems (strangely) to depend on the case (upper or lower) of the first character of the variable. Is there way you can check if the solutions are equivalent? I wasn't sure how to choose the Ci.
syms R(r) L
assume(L, "real")
assume(L > 0)
vgl = r*diff(R(r),2,r) + diff(R(r),1,r) == L*r*R(r);
dsolve(vgl)
ans = 
syms R(r) lambda
assume(lambda, "real")
assume(lambda > 0)
vgl = r*diff(R(r),2,r) + diff(R(r),1,r) == lambda*r*R(r);
dsolve(vgl)
ans = 
syms R(r) Lambda
assume(Lambda, "real")
assume(Lambda > 0)
vgl = r*diff(R(r),2,r) + diff(R(r),1,r) == Lambda*r*R(r);
dsolve(vgl)
ans = 
syms R(r) AAA
assume(AAA, "real")
assume(AAA > 0)
vgl = r*diff(R(r),2,r) + diff(R(r),1,r) == AAA*r*R(r);
dsolve(vgl)
ans = 
syms R(r) aAA
assume(aAA, "real")
assume(aAA > 0)
vgl = r*diff(R(r),2,r) + diff(R(r),1,r) == aAA*r*R(r);
dsolve(vgl)
ans = 

댓글을 달려면 로그인하십시오.

 채택된 답변

Srijith Kasaragod
Srijith Kasaragod 2021년 11월 30일
편집: Srijith Kasaragod 2021년 12월 2일

0 개 추천

Hi Kevin,
This is a bug and has been brought to the notice of our developers. It may be fixed in future releases. One possibility to resolve this problem would be to avoid solutions using the imaginary unit in representation, which in this case would prefer the representation using besseli and besselk functions.
Regards,
Srijith.

댓글 수: 1

Can you better describe what the bug actually is? What is the title and description of the bug? Is there a link to a bug report?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

제품

릴리스

R2021b

질문:

2021년 11월 23일

편집:

2021년 12월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by