Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Finding roots of functions.docx
Скачиваний:
4
Добавлен:
13.09.2019
Размер:
172.72 Кб
Скачать

Finding roots of two kind of functions

Introduction

This project is carried out to find the fastest way to determine the roots of the polynomial function (cubic function) and non-polynomial function (trigonometric function). Will be used two iterative methods, which are iteration formula ( ) and Newton-Raphson method. Given a cubic function, which is with initial value , trigonometric function which is with initial value . All values in this project was chosen until 7 decimal places, to clearly show answer.

Iterative method works in the way that the whole function is equal to zero, then find the value of . Newton-Raphson method works by using formula . The following part will describe how each method has occurred.

Theory

Newton-Raphson Method.

Newton-Raphson method could be derivate from Taylor series, using general function .

Hence that , Taylor series is:

However Newton-Raphson method is approximation, taking only the first two terms of the right side,

Consider that point where , if assume, that will be

Hence,

Which is means that:

which gives

(can be approximately)

Q.E.D.

Iterative Method

To show how works Iterative method, will be used graphs.

Graph 1.

The graph above, was made by using the WZGrapher. In this graph shows three functions. The first function, which shows by red color, is original function. The second function, which shows by blue color, is a . The third function, which shows by green color, is a transformed function for and called as . From graphic above can be adopted that, the points of intersection line and are compose the roots of given function .

For detail description of roots, will be made another graph. Where show the points of intercept.

Graph 2

The graph above was made by using program WZGrapher. Graph 2 shows that, when line and function are intercepts at one point, at the time value of of given function equal 0. Hence can be adopted that Q.E.D.

Finding roots for cubic function

Recall that function which was given is:

Using WZGrapher was made the graph of the function.

Graph 3

Graph 1 shows visual information about the roots of the curve. First root should be valued between and , second root between and and the third root is between and .

Using iterative method:

First of all, equal to zero, will get

Then, using some transformation with equation:

After that, find the value of :

Assume that function of above is true, will get that:

, lets be .

Using Microsoft Excel and functions above, was made the Table 1.

Table 1.

Step

Iterative method

x

g(x)

1

-2.0000000

-2.3846154

2

-2.3846154

-2.7109345

3

-2.7109345

-2.6937396

4

-2.6937396

-2.7028012

5

-2.7028012

-2.6981479

6

-2.6981479

-2.7005714

7

-2.7005714

-2.6993182

8

-2.6993182

-2.6999686

9

-2.6999686

-2.6996317

10

-2.6996317

-2.6998064

11

-2.6998064

-2.6997158

12

-2.6997158

-2.6997628

13

-2.6997628

-2.6997385

14

-2.6997385

-2.6997511

15

-2.6997511

-2.6997445

16

-2.6997445

-2.6997479

17

-2.6997479

-2.6997462

18

-2.6997462

-2.6997471

19

-2.6997471

-2.6997466

20

-2.6997466

-2.6997468

21

-2.6997468

-2.6997467

22

-2.6997467

-2.6997468

23

-2.6997468

-2.6997468

Table 1 visually shows the way of finding roots by using Iterative method. Also shows the steps of finding roots. As it was stated above, that one of the root should be between and . Table shows that root is approximately equal to . Also, table describes that root was found in 23rd step.

Newton-Raphson method:

The function is , in the beginning need to find first derivative of function, which is:

After that writing complete formula of finding roots by using Newton-Raphson method:

Using sources above and using Microsoft Excel was made the table below.

Table 2

Step

Newton-Raphson method

Roots

x

f(x)

f'(x)

1

-2.0000000

-5.0000000

3.0000000

-0.3333333

2

-0.3333333

7.4074074

-2.0000000

3.3703704

3

3.3703704

-446.0702129

-311.4650206

1.9382024

4

1.9382024

-127.9781120

-143.0011235

1.0432576

5

1.0432576

-34.9190307

-68.9695880

0.5369616

6

0.5369616

-8.2328322

-37.7294562

0.3187546

7

0.3187546

-1.2362287

-26.6367404

0.2723439

8

0.2723439

-0.0507239

-24.4616363

0.2702703

9

0.2702703

-0.0000992

-24.3659615

0.2702662

10

0.2702662

0.0000000

-24.3657738

0.2702662

Table 2 shows the way of finding root to polynomial function by steps. Final answerer of value is equal to and root was found in 10th step. But this value is different from that value, which was get by using Iterative method. The reason for this is that polynomial function is cubic. Therefore, have 3 real different roots. As it was stated above, that one of the root should be between and .

Comparing two methods for solving cubic function using Table 1 and Table 2 above, can be adopted that Newton-Raphson method faster. Somehow, there is a possibility that the roots will not consider. Because polynomial function is cubic and curve crosses x-axis in 3 different points

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]