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:

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

Limit[ψ[R], M -> Infinity]

Simplify[%, {r > 0 && κ > 0 && a > 0 && Psi0 ∈ 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
6
$\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 agree to our terms of service, privacy policy and cookie policy

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