Вы находитесь на странице: 1из 7

ERROR ANALYSIS IN SQUARE ROOT FROM A NATION USING

MATLAB
Aceha Jazaul Aufa (ID 03411640000057)
Department of Geophysics Engineering, Faculty of Civil, Environmental, and Geoscience
Engineering, Sepuluh Nopember Institute of Technology. Surabaya
ABSTRACT
Mathematical calculations are very complex. in science experiments requires efficient
mathematical calculations. One example of a familiar calculation is looking for square roots of
various numbers.in this case, using unfamilliar numbers like 0, 2, 10, and -4. Using MATLAB to
find the square root of these numbers with an error limit 0,0001. Script used a repetition function
to find where the square root reaches the condition and if it has reached the condition it will be
stopped. Then the square root obtained is inf, 1.4142, 3.1623 and 0 + 2i.

Key words: repitition, square root,

1. INTRODUCTION The square root of an integer which is not a


perfect square is always an irrational number
Considering the importance of (also called a rational number: a number that
programming in mathematical calculations, cannot be expressed as a quotient of two
so needed deepening of material about integers. For example, it cannot be written
programming. And for this reason, it is correctly by m / n, where n and m However,
necessary to understand the processes needed it is a definite value of the diagonal length of
in this programming. For this reason, the a square whose sides are equal to 1. This
authors make this report which contains event has been known since ancient times,
about matrix and square root, graphs, with the discovery that it is irrational by
programming with MATLAB. Readers are Hippasus, a disciple of Pythagoras.
expected to understand what is presented in
this report. 3. METHODOLOGY
2. BASIC THEORI
2.1 Square Root
In mathematics, a square root of a
number a is a number y such that y2 = a. in
other words, a number y whose square (the
result of multiplying the number by itself,
or y ⋅ y) is a. Every positive number x has
two square roots. One of them is, which is
positive, while the other is, which is negative.
The two square roots are denoted by. The
square root of negative numbers is discussed
in the framework of the study of complex
numbers. More generally, square roots can be
viewed from the various contexts in which
"squaring" notations are defined.
4. RESULT AND ANALYSIS
After computing all data on
MATLAB, the result is gotten. Using
repititions as 100 times with the larghest
number of square root is 10. When the
number is 0, there was 101 repetition with the
discovery of square roots using an error under
0,0001 is non existent because the result is inf
(infinity). The square root of 0 is 0 When the
number is 2. Repetitions stoping at the 6th
repitition because the condition error below
0.0001, it’s 2,4345e-08. The square root of 2
is 1,14145. When the number is 10, repititios
also stoping at the 4th repititipon because the
condition error below 0.0001. it’s 5.6277e-
05. The square root of number 10 is 3.1623.
When the number is 4, Repetitions stoping at
the 4th repitition because the condition error
below 0.0001, it’s 6.0195e-06. The suare root
becomes an imaginary number, it’s (a + bi).
5. CONCLUSION
The result shows that number 0 has an infinite
error. number 2 has an error of 2.4345e-08.
Number 10 has an error of 5.6277e-05.
Number -4 has an error of 6.0195e-06. for the
number -4 the square root is an imaginary
number.
REFFERENCE

1. Smith, David (1958). History of


Mathematics. New York:
DoverPublications. ISBN 978048620
4307.

ATTACHMENTS
a=0

clear all
clc

%Parameter
a1 = 0
t1 = sqrt(a1)
n = 1
x1(1)=10

%Formula
while n <= 100
x1(n+1)= 0.5.*(x1(n)+(a1./x1(n)))
error = abs((x1(n+1)-t1)./t1)
if error <= 0.0001
break
else
n = n+1;
end
end
a=2

clear all
clc

%Parameter
a1 = 2
t1 = sqrt(a1)
n = 1
x1(1)=10

%Formula
while n <= 100
x1(n+1)= 0.5.*(x1(n)+(a1./x1(n)))
error = abs((x1(n+1)-t1)./t1)
if error <= 0.0001
break
else
n = n+1;
end
end

a = 10

clear all
clc

%Parameter
a1 = 10
t1 = sqrt(a1)
n = 1
x1(1)=10

%Formula
while n <= 100
x1(n+1)= 0.5.*(x1(n)+(a1./x1(n)))
error = abs((x1(n+1)-t1)./t1)
if error <= 0.0001
break
else
n = n+1;
end
end

a = -4

clear all
clc

%Parameter
a1 = -4
t1 = sqrt(a1)
n = 1
x1(1)=10

%Formula
while n <= 100
x1(n+1)= 0.5.*(x1(n)+(a1./x1(n)))
error = abs((x1(n+1)-t1)./t1)
if error <= 0.0001
break
else
n = n+1;
end
end

Вам также может понравиться