0
$\begingroup$

I set the following to N=5, and want to do a convergence test on u:

    n = 5; u[r_, phi_, n_] := 
 Piecewise[{{BesselJ[1.5 r, n]*Exp[I n phi], 
    0 < r < 1/2}, {(BesselJ[3 r, n] + BesselY[3 r, n])*Exp[I n phi], 
    1/2 < r < 1}, {HankelH1[r, n]*Exp[I n phi], r > 1}}]

and the convergence test:

SumConvergence[u[r, phi, 5], n]

But the i get:

"SumConvergence::ivar: 5 is not a valid variable."

I try to set a number for it, but that is not accepted either.

How is this done correctly?

$\endgroup$
8
  • $\begingroup$ In an infinite series $\sum_{k=1}^\infty a_k$, there is an index $k$ that ranges over (say, positive) integers. What is the index variable of your series? It's not 5 (therefore not n), since that is constant. The index should be the second argument of SumConvergence[]. $\endgroup$
    – Michael E2
    Commented Apr 21, 2021 at 12:29
  • $\begingroup$ That is a 0. I show here a successful use of this command: u0[r_, phi_] := Sum[I^(-n) BesselJ[n, r] Exp[I n phi], {n, 0, 3}]; u[r_, phi_] := u0[r, phi] SumConvergence[u0[r, phi], n] . Which is different from the one above. $\endgroup$ Commented Apr 21, 2021 at 12:31
  • $\begingroup$ I get the ivar error with the code in your comment: i.sstatic.net/7ccuO.png -- Is that a successful use? (You didn't give an answer to "what is the index variable?". The constant 0 cannot be an index variable, but I'm not sure whether "That is a 0" was meant to be an answer.) $\endgroup$
    – Michael E2
    Commented Apr 21, 2021 at 12:43
  • $\begingroup$ This gives True: i.sstatic.net/ai4lk.png $\endgroup$
    – Michael E2
    Commented Apr 21, 2021 at 12:47
  • $\begingroup$ So, if you mean the first level of N, then it is 0. $\endgroup$ Commented Apr 21, 2021 at 12:50

1 Answer 1

1
$\begingroup$

In the general case SumConvergece fails as

Clear[n]; 
u[r_, phi_, n_] := Piecewise[{{BesselJ[3/2 r, n]*Exp[I n phi], 
0 < r < 1/2}, {(BesselJ[3 r, n] + BesselY[3 r, n])*Exp[I n phi], 
1/2 < r < 1}, {HankelH1[r, n]*Exp[I n phi], r > 1}}]
SumConvergence[u[r, phi, n], n,Assumptions -> r > 1/2 && phi \[Element] Reals]

demonstrates. It works if the parameters are specified, e.g

SumConvergence[u[2, Pi/4, n], n]

True

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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