Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Trouble finding the roots of an equation

Subject: Trouble finding the roots of an equation

From: Marcio Barbalho

Date: 30 Nov, 2012 16:47:08

Message: 1 of 4

Dear friends
salve salve!

I'm trying to find n roots for this equation y = x*tan(x)-10.

It seems I'll have to include symbolic calculation, which I was trying to avoid in order to speed up the processing!
So I wonder how I could transform y into a series and get n of its infinite roots.

Any help will be very much appreciated!

Subject: Trouble finding the roots of an equation

From: Nasser M. Abbasi

Date: 30 Nov, 2012 17:04:52

Message: 2 of 4

On 11/30/2012 10:47 AM, Marcio Barbalho wrote:
> Dear friends
> salve salve!
>
> I'm trying to find n roots for this equation y = x*tan(x)-10.

around where? here are some roots

EDU>> x=-2*pi:.1:2*pi; %have a quick look first to get an idea
EDU>> plot(x,x.*tan(x)-10)
EDU>> sol=fsolve(@(x) x.*tan(x)-10,0.01:1:10);
EDU>> sol'

ans =

    1.428870011214077
    1.428870011214077
    7.228109771675751
    4.305801413119223
    4.305801413119223
    7.228109771627249
    7.228109771627249
    7.228109771627249
   10.200262588295905
   10.200262588295905

>
> It seems I'll have to include symbolic calculation, which I
>was trying to avoid in order to speed up the processing!
> So I wonder how I could transform y into a series and get n of its infinite roots.
>
> Any help will be very much appreciated!
>

--Nasser

Subject: Trouble finding the roots of an equation

From: Marcio Barbalho

Date: 30 Nov, 2012 17:16:07

Message: 3 of 4

"Nasser M. Abbasi" <nma@12000.org> wrote in message <k9aovn$loc$1@speranza.aioe.org>...
> On 11/30/2012 10:47 AM, Marcio Barbalho wrote:
> > Dear friends
> > salve salve!
> >
> > I'm trying to find n roots for this equation y = x*tan(x)-10.
>
> around where? here are some roots
>
> EDU>> x=-2*pi:.1:2*pi; %have a quick look first to get an idea
> EDU>> plot(x,x.*tan(x)-10)
> EDU>> sol=fsolve(@(x) x.*tan(x)-10,0.01:1:10);
> EDU>> sol'
>
> ans =
>
> 1.428870011214077
> 1.428870011214077
> 7.228109771675751
> 4.305801413119223
> 4.305801413119223
> 7.228109771627249
> 7.228109771627249
> 7.228109771627249
> 10.200262588295905
> 10.200262588295905
>
> >
> > It seems I'll have to include symbolic calculation, which I
> >was trying to avoid in order to speed up the processing!
> > So I wonder how I could transform y into a series and get n of its infinite roots.
> >
> > Any help will be very much appreciated!
> >
>
> --Nasser

Thank you very much, if you lived here I would buy you a beer. :)

Subject: Trouble finding the roots of an equation

From: Roger Stafford

Date: 30 Nov, 2012 17:24:09

Message: 4 of 4

"Marcio Barbalho" <marciobarbalho@live.com> wrote in message <k9anuc$a22$1@newscl01ah.mathworks.com>...
> I'm trying to find n roots for this equation y = x*tan(x)-10.
- - - - - - - - - - -
  If I were doing that problem I would try using the Newton-Raphson method starting with an initial estimate that would converge for an x somewhere in 0 < x < pi/2. For each subsequent estimate add pi to the previous root. After the first few roots I would predict that convergence would become successively more rapid as the n-th roots approach (n-1)*pi for large n.

Roger Stafford

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us