2
$\begingroup$

I'm trying to solve a differential equation which solution is in the form of Bessel functions. One of the boundary conditions is at infinity. I use:

\[Psi][R_] = \[Psi][R] /. DSolve[{\[Psi]''[R] + (Derivative[1][\[Psi]][R])/
    R - \[Kappa]^2 \[Psi][R] == 0, \[Psi][a/2] == 
  Psi0, \[Psi][M] == 0}, \[Psi][R], R][[1]]Limit[\[Psi][R], M -> Infinity]Simplify[%, {r > 0 && \[Kappa] > 0 && a > 0 && Psi0 \[Element] Reals}]

And obtain: Problem

How can I obtain the solution of my problem overpassing the time limit?

$\endgroup$
  • $\begingroup$ With Maple I have a simple answer: \[Psi][R] =(Psi0 BesselK[0, k R])/BesselK[0, (a k)/2] $\endgroup$ – Mariusz Iwaniuk Jan 9 at 20:16
  • $\begingroup$ Could you print here your system info. I am getting a Recursion Limit error and not reproducing your resulted time limit error. $\endgroup$ – Jose Enrique Calderon Jan 10 at 9:09
5
$\begingroup$

Change the order of execution.

ψ[R_] = ψ[R] /. 
  DSolve[{ψ''[R] + (Derivative[1][ψ][R])/ R - κ^2 ψ[R] == 0, ψ[a/2] == Psi0, ψ[M] == 0}, ψ[R], R][[1]]

$Assumptions = 
 r > 0 && κ > 0 && a > 0 && Psi0 ∈ Reals && M > 0 && R > 0

ψ[R_] = FullSimplify[ψ[R]]  

(*(Psi0 (BesselI[0, M κ] BesselK[0, R κ] - BesselK[0, M κ] BesselI[0, R κ]))/( BesselK[0, (a κ)/2] BesselI[0, M κ] - 
 BesselI[0, (a κ)/2] BesselK[0, M κ])*)

Limit[ψ[R], M -> ∞]
(*(Psi0 BesselK[0, R κ])/BesselK[0, (a κ)/2]*)
$\endgroup$
2
$\begingroup$

TimeConstraint helps to increase the time limit spent on Simplify operation. In case this is just a computation time issue and not an algorithmic one, this would help.

https://reference.wolfram.com/language/ref/TimeConstraint.html

$\endgroup$

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.