## 143 Reputation

17 years, 61 days

## Code...

if mode=TM
then Q:=QTM1
elif n=0
then Q:=QTM2
end if:

if mode=TE
then Q:=QTE1
elif m=0
then Q:=QTE2
elif n=0
then Q:=QTE3
end if:

This is the basic idea of what I'm looking for.

However, for mode=TE, and m=0, n>0, I receive Q=QTE1, when I should have Q=QTE2.

## Unfortunately it's by quite...

Unfortunately it's by quite a few significant figures in some cases.

Also, after further investigation, the setup doesn't give correct values for each root.  Occasionally, the root corresponds to a value of n+1.

I also read that Maple has some trouble with interpreting the differential of the first kind of bessel function.

## Thanks for the...

Unfortunately, that gives a different value than what I'm expecting for m=3, n=1.  I'd expect to get 4.2012 - http://mathworld.wolfram.com/BesselFunctionZeros.html towards the bottom of the page.

Edit: After looking at it, that value appears to be the root for m=3, n=2.  So, I changed the script to read:

```f:=(m,n)->fsolve(BesselJ(m+1,x)*x-m*BesselJ(m,x),
x=BesselJZeros(m,n-1)..BesselJZeros(m,n+1)):
f(3,1);
4.2012

However, for some other roots, it gives values which are not quite accurate.
```

## Hi, thanks for all the...

Hi, thanks for all the responses.

I've found that Robert Israel's solution works out quite nicely, as I wanted to remain with the polar co-ords.

Thanks again.

## Sorry for the expression - I...

Sorry for the expression - I had re-arranged it when I was using the fsolve command.

I have a circular geometry, examined in 2-D polar co-ordinates, r and phi.  The expression determines the magnitude of the electric field, at any given value of r and phi - i.e. at any point within the geometry.  What I want to do is try and create a contour plot of that field.

I had thought about using the solve command to solve for the radius, -radius..+radius, which would then leave the expression only in terms of phi.  Then, solve for phi, which would leave me with the magnitude of the field.

Is that a better explanation?

## Many Thanks...

Doug, thanks for the reply. Isolate did the job perfectly. Thank you very much!

## Thank You Everyone...

Very grateful for the replies. I ended up going with the first method published by Tim, as I found it the easiest one to follow through in my head and understand exactly what was going on. Thanks again!
 Page 1 of 1
﻿