Math Is Fun Forum
  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#26 2016-06-16 16:02:44

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 108,547

Re: Polynomial Root Finding

Is that what you ran?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#27 2016-06-16 16:04:31

ElainaVW
Member
Registered: 2013-04-29
Posts: 580

Re: Polynomial Root Finding

You have your hands full m.

Offline

#28 2016-06-16 16:05:29

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,623
Website

Re: Polynomial Root Finding

Yes, it is better than copying and pasting the same code 10 times.


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#29 2016-06-16 16:06:14

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 108,547

Re: Polynomial Root Finding

Oy! You do not have to copy and paste. You can rerun a cell again and again.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#30 2016-06-16 16:07:47

ElainaVW
Member
Registered: 2013-04-29
Posts: 580

Re: Polynomial Root Finding

The front end in Mma is confusing. He needs to learn its capabilities.

Offline

#31 2016-06-16 16:08:04

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,623
Website

Re: Polynomial Root Finding

Hm, but then how do I show you what the history was?

Also, why is nestlist inferior?

Last edited by Agnishom (2016-06-16 16:08:29)


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#32 2016-06-16 16:09:23

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 108,547

Re: Polynomial Root Finding

Good point just as long as you know the other way.

Please get more digits.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#33 2016-06-16 16:11:14

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,623
Website

Re: Polynomial Root Finding

In[28]:= NestList[N[T[f, #], 16] &, 0, 20]

Out[28]= {0, 0.3333333333333333, 0.241105637657362, \
0.241073360838539, 0.241073360510646, 0.24107336051065, \
0.24107336051065, 0.24107336051065, 0.2410733605106, 0.2410733605106, \
0.241073360511, 0.241073360511, 0.241073360511, 0.24107336051, \
0.24107336051, 0.24107336051, 0.2410733605, 0.2410733605, \
0.241073361, 0.241073361, 0.241073361}

'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#34 2016-06-16 16:12:50

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 108,547

Re: Polynomial Root Finding

50 digits please.

Now where does x = 0. come from?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#35 2016-06-16 16:13:25

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,623
Website

Re: Polynomial Root Finding

I'll have my breakfast and watch 8 simple rules. That'll take 20 minutes.


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#36 2016-06-16 16:14:27

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 108,547

Re: Polynomial Root Finding

Okay, see you then.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#37 2016-06-16 16:15:17

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,623
Website

Re: Polynomial Root Finding

In[33]:= NestList[N[T[f, #], 50] &, 0, 30]

Out[33]= {0, 0.33333333333333333333333333333333333333333333333333, \
0.2411056376573617952928297755883962780514504652436, \
0.2410733608385386231804696452324331986595272643053, \
0.2410733605106461067319852181691434493418203890234, \
0.241073360510646106698135374905087164547723068985, \
0.241073360510646106698135374905087164547362318455, \
0.241073360510646106698135374905087164547362318455, \
0.24107336051064610669813537490508716454736231846, \
0.24107336051064610669813537490508716454736231846, \
0.2410733605106461066981353749050871645473623185, \
0.2410733605106461066981353749050871645473623185, \
0.2410733605106461066981353749050871645473623185, \
0.241073360510646106698135374905087164547362318, \
0.241073360510646106698135374905087164547362318, \
0.241073360510646106698135374905087164547362318, \
0.24107336051064610669813537490508716454736232, \
0.24107336051064610669813537490508716454736232, \
0.2410733605106461066981353749050871645473623, \
0.2410733605106461066981353749050871645473623, \
0.2410733605106461066981353749050871645473623, \
0.241073360510646106698135374905087164547362, \
0.241073360510646106698135374905087164547362, \
0.24107336051064610669813537490508716454736, \
0.24107336051064610669813537490508716454736, \
0.24107336051064610669813537490508716454736, \
0.2410733605106461066981353749050871645474, \
0.2410733605106461066981353749050871645474, \
0.2410733605106461066981353749050871645474, \
0.241073360510646106698135374905087164547, \
0.241073360510646106698135374905087164547}

I do not know where x = 0 comes from. You supplied that.


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#38 2016-06-16 16:21:01

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 108,547

Re: Polynomial Root Finding

Before doing any rootfinding we check the geometry of the equation.

Plot the function and eyeball the roots. What do you see?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#39 2016-06-16 16:42:33

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,623
Website

Re: Polynomial Root Finding

pMv65Ie.png


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#40 2016-06-16 16:47:51

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 108,547

Re: Polynomial Root Finding

That looks familiar.

What do you notice about the roots from looking?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#41 2016-06-16 16:53:26

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,623
Website

Re: Polynomial Root Finding

They are near -1.9, -1.6, -0.8, 0.2, 1.2, 1.8


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#42 2016-06-16 16:54:18

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 108,547

Re: Polynomial Root Finding

That is where the 0 comes from. Now get the remaining 5 roots.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#43 2016-06-16 17:01:12

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,623
Website

Re: Polynomial Root Finding

See post #14


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#44 2016-06-16 17:02:56

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 108,547

Re: Polynomial Root Finding

Can you clean that output up, there are duplicates?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#45 2016-06-16 17:07:38

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,623
Website

Re: Polynomial Root Finding

In[40]:= T[f_, x_] := x - f[x]/f'[x]
Newtons[f_, x0_, n_] := Nest[N[T[f, #]] &, x0, n]

In[39]:= Newtons[f, #, 100] & /@ {-1.9, -1.6, -0.8, 0.2, 1.2, 1.8}

Out[39]= {-1.94188, -1.49702, -0.70921, 0.241073, 1.13613, 1.77091}

'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#46 2016-06-16 17:13:47

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 108,547

Re: Polynomial Root Finding

100 in that argument seems excessive for 6 digits. Do you know why?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#47 2016-06-16 17:23:22

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,623
Website

Re: Polynomial Root Finding

about 10 will suffice.

Please explain why.


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#48 2016-06-16 17:24:59

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 108,547

Re: Polynomial Root Finding

Newton's has what they call quadratic convergence, that means it roughly gets twice as many correct digits with each iteration.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#49 2016-06-16 17:26:20

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,623
Website

Re: Polynomial Root Finding

That is a very high rate.


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#50 2016-06-16 17:29:40

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 108,547

Re: Polynomial Root Finding

There are some with cubic convergence or more.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

Board footer

Powered by FluxBB