Message Boards Message Boards

0
|
2140 Views
|
5 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Plotting Bessel and Hankel functions on an interval?

Posted 3 years ago

enter image description here

Hello, I try to prepare this function for plotting, but it appeared more difficult than expected. I have written the following code for the three respective functions on the image:

u3[r_, \[Phi]_] := BesselJ[r, n]*Exp[I n phi], {r, 0, 0.5}, {\[Phi], 0, 2 \[Pi]}, {n, 0, 5}; 
u4[r_, \[Phi]_] := (BesselJ[3*r, n] + BesselY[3*r, n])*Exp[I n phi], {r, 0.5, 1}, {\[Phi], 0, 2 \[Pi]}, {n, 0, 5};
u5[r_, \[Phi]_] := HankelH1[r, n]*Exp[I n phi], {r, 0.5, 10}, {\[Phi], 0, 2 \[Pi]}, {n, 0, 5};

Then I was going to make a function W which sums the three together, and then plot W.

But I get an error over and over again for the Bessel and Hankel formulation. Based on the image given, where zeta 1 and 2 are constants, what is wrong here?

Any help appreciated!

POSTED BY: Ser Man
5 Replies
Posted 3 years ago

Ok, thank you very much.

POSTED BY: Ser Man
Posted 3 years ago

Hi, you used 5,1 to plot the first five states, correct?

POSTED BY: Ser Man
   Table[n, {n, 0, 5, 1}]
   (*{0, 1, 2, 3, 4, 5}*)
   Length[%]
   (* 6 *)

Six states.

POSTED BY: Mariusz Iwaniuk
Posted 3 years ago

It worked great! Thanks a lot for this!

POSTED BY: Ser Man

Maybe like this:

  u[r_, phi_, n_] := Piecewise[{{BesselJ[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}}]

 Table[Plot3D[u[r, phi, n] // Re, {r, 0, 10}, {phi, 0, 2 Pi}], {n, 0, 
   5, 1}](*Real Part*)
 Table[Plot3D[u[r, phi, n] // Im, {r, 0, 10}, {phi, 0, 2 Pi}], {n, 0, 
   5, 1}](*Imaginary Part*)
POSTED BY: Mariusz Iwaniuk
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