Message Boards Message Boards


[✓] Solve equation a+b*x=cot(x) in Mathematica numerically?

Posted 11 months ago
3 Replies
3 Total Likes

Hi all, I am Bin, a PhD student on graphene antenna. I am doing a calculation of dispersion relation of SPP wave propagation on Graphene.

There is a equation like I mentioned in title. Obviously there is no close form expression for x in this equation. So it should be done numerically.

I use function 'SOLVE/Nsolve' to deal with this problem but it turns out a error said 'This system cannot be solved with the methods available to NSolve/solve".

Could you please help me on this ?

Any comments or suggestions would be great.

Thanks in advance.



3 Replies

With numeric coefficients and bounds on x it works:

With[{a = 1, b = 2},
 Solve[a + b*x == Cot[x] && 0 < x < Pi/2, x]]
Posted 11 months ago

Thank you Gianluca !!! Does it work for complex number ? like if b=1+5i or any complex else.

Or this equation is just not doable if there is a complex in it ?

I set b as a complex and it shows the error again.....

Regards, Bin

You will have to give a complex bound on x:

With[{a = 1, b = 1 + 5 I}, 
 Solve[a + b*x == Cot[x] && Abs[x] < Pi/2, x]]
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract