Message Boards Message Boards

0
|
2782 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Error while plotting a composite function

Posted 3 years ago

Hi, I try to plot the following composite Sum of Bessel functions, with the given coefficients An-D_n prepared and inserted for, and with N defined as 5 (and not infinity):

Function

and use:

un[r_, phi_] := 
 Piecewise[{Sum[
     0.018778093057411193`*BesselJ[1.5 r, n]*Exp[I n phi], {k, -5, 
      5}, {0 < r < 
       1/2}]} {Sum[(0.00042221117650360055`*BesselJ[3 r, n] + 
        3.0261301163279267`*^-10*BesselY[3 r, n])*
      Exp[I n phi], {k, -5, 5}, {1/2 < r < 1}]},
  {Sum[5.062485836886407`*^-9*HankelH1[r, n]*Exp[I n phi], {k, -5, 
     5}, {r > 1}]}]

But although it seems fine, I get tons of errors

What is wrong here?

Thanks!

POSTED BY: Ser Man
Posted 3 years ago

Misplaced [ ] and { } in the Piecewise definition. Try a simpler Piecewise with a simpler Sum and the problem should be clear. Also, check the documentation for Piecewise.

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract