View Single Post
  #3  
Old November 6th, 2009, 02:40 AM
CaptainBlack's Avatar
CaptainBlack CaptainBlack is offline
Grand Panjandrum
 
Join Date: Nov 2005
Location: South of England
Posts: 12,285
Country:
Thanks: 779
Thanked 4,005 Times in 3,230 Posts
CaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond repute
Default

Quote:
Originally Posted by jfortiv View Post
Hi,

I'm trying to solve a simple equation in MATLAB, numerically:

tan(x) = tanh(x)

I'm not very skilled in MATLAB and I've poked around in the docs for 15 minutes or so now. I looked at solve() in the symbolic toolbox. I can't get that to give me anything other than zero. I basically want the first 20 or so non-zero solutions for x (there is an infinity of solutions to this equation).

Any guidance (even just pointing me to the right docs) would be greatly appreciated.

Thanks!
Rewrite the equation in the form: \tan(x)-\tanh(x)=0, then there is one root of this in each of the intervals (\pi(n-1),\pi(n+1)),\ \ \ n=0,\pm 1,\pm 2, ....

Now start your solver at the points 2n\pi for a suitable selection of n 's to get your 20 solutions.

CB
__________________
Truth does not change because it is, or is not, believed by a majority of the people.

Giordano Bruno

Last edited by CaptainBlack; November 6th, 2009 at 11:02 PM.
Reply With Quote