Wrong solution of differential equation using symbolic lambda
6 views (last 30 days)
Show older comments
Kevin Oyen
on 23 Nov 2021
Edited: Srijith Kasaragod
on 2 Dec 2021
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 Comments
Paul
on 23 Nov 2021
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)
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)
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)
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)
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)
Accepted Answer
Srijith Kasaragod
on 30 Nov 2021
Edited: Srijith Kasaragod
on 2 Dec 2021
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 Comment
Paul
on 30 Nov 2021
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?
More Answers (0)
See Also
Categories
Find more on Symbolic Math Toolbox 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!