Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
1. INTRODUCCIÓN:
Letra griega pi. Símbolo adoptado inicialmente en 1706 por William Jones y
popularizado por Euler.
Error
Año Matemático o documento Aproximación
(en partes por millón)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
UNSCH – FIMGC - DAIMC CCP
UNIVERSIDAD NACIONAL DE SAN CRISTÓBAL DE HUAMANGA
FACULTAD : INGENIERÍA DE MINAS, GEOLOGÍA Y CIVIL
ESCUELA : INGENIERÍA CIVIL -3-
ASIGNATURA : MÉTODOS NUMÉRICOS (IC-343)
PROFESOR : ING. CRISTIAN CASTRO P. FECHA: Setiembre - 2010
Téngase en cuenta que tan (4*arc tan (1/5)) = (5/6) / (119/144) = 120/119,
utilizando dos veces la fórmula de la tangente del ángulo doble.
Por tanto, tan (4*arc tan (1/5) - arc tan (1/239) = [tan (4*arc tan (1/5)) -
1/239] / [1 + tan (4*arc tan (1/5))*1/239]; y sustituyendo el primer valor
obtenido nos queda (120/119 - 1/239) / (1 - 120/119 * 1/239) = (28680 -
119) / (28441+120) = 1.
• Años más tarde, Euler encontró algunas fórmulas más de las que destacamos
dos por su sencillez y belleza. En 1734 consigue calcular la suma de los
inversos de los cuadrados, problema que se había resistido durante años a los
intentos de muchos matemáticos. La convergencia de esta serie es, sin
embargo, lenta,
∑1/n2 = 2
/6
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
UNSCH – FIMGC - DAIMC CCP
UNIVERSIDAD NACIONAL DE SAN CRISTÓBAL DE HUAMANGA
FACULTAD : INGENIERÍA DE MINAS, GEOLOGÍA Y CIVIL
ESCUELA : INGENIERÍA CIVIL -4-
ASIGNATURA : MÉTODOS NUMÉRICOS (IC-343)
PROFESOR : ING. CRISTIAN CASTRO P. FECHA: Setiembre - 2010
• Análisis matemático:
(Fórmula de Leibniz)
(Producto Wallis)
(Fórmula Euler)
(Identidad de Euler)
(Fórmula de Stirling)
(Euler)
(Euler)
Una de las referencias documentadas más antiguas al número pi se puede encontrar en un versículo poco
conocido de la Biblia:'Hizo una fuente de metal fundido que medía 10 codos de diámetro: era completamente
redonda, y su altura era de 5 codos y una línea de 30 codos lo rodeaba'. — (I Reyes 7, 23)
Se puede ver como una idea similar se puede encontrar en II Crónicas 4, 2. En él aparece en una lista de
requerimientos para la construcción del Gran Templo de Salomón, construido sobre el 950 adC y su interés aquí
radica en que da un valor de π = 3.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
UNSCH – FIMGC - DAIMC CCP
UNIVERSIDAD NACIONAL DE SAN CRISTÓBAL DE HUAMANGA
FACULTAD : INGENIERÍA DE MINAS, GEOLOGÍA Y CIVIL
ESCUELA : INGENIERÍA CIVIL -5-
ASIGNATURA : MÉTODOS NUMÉRICOS (IC-343)
PROFESOR : ING. CRISTIAN CASTRO P. FECHA: Setiembre - 2010
3. SOBRE EL NÚMERO PI
• Modernamente para evaluar Pi se utiliza una serie infinita convergente. Este método fue utilizado por
primera vez en Kerala (India) en el Siglo XV
• En 1706, el inglés William Jones fue el primero en utilizar el símbolo griego para denotar la
relación entre la circunferencia y su diámetro. Euler en su obra "Introducción al cálculo infinitesimal",
publicada en 1748, le dio el espaldarazo definitivo.
• Muchos intentos para determinar Pi con exactitud están relacionados con el clásico problema de la
cuadratura del círculo : "construir, utilizando únicamente regla y compás, un cuadrado de área igual
a un círculo dado".
• El matemático alemán Ludolph van Ceulen(1540-1610) pidió que, como epitafio, escribiesen en su
lápida las 35 cifras del número Pi que había calculado. Los alemanes llaman a Pi el número ludofiano.
• William Shanks, matemático inglés, dedico 20 años de su vida a la obtención de 707 decimales de
Pi.(En 1945 se descubrió que había cometido un error en el decimal 528 y a partir de este todos los
demás eran incorrectos)
• En 1949 uno de los primeros ordenadores el ENIAC, trabajando durante 70 horas, determino Pi con
2037 decimales.
• En 1961 Daniell Shanks(sin relación con William Shanks) y Wrench, obtuvieron en 8 h 23 min,
100.265 cifras en un IBM 7090.
• Desde la primera computadora ya se empezó a desarrollar programas para el cálculo del número pi
con el mayor número de cifras posibles, de esta forma un ENIAC en 1949 fue capaz de romper todos
los records actuales con 2037 lugares decimales (en 70 horas), poco a poco se fueron sucediendo los
ordenadores que batían records y de esta forma pocos años después (1954) un NORAC llega a 3092
cifras, durante casi una década de los años 1960 los IBM fueron batiendo records hasta que un IBM
7030 pudo llegar en 1966 a 250000 cifras decimales (8 h 23 min). Durante esta época se probaban
los nuevos ordenadores con algoritmos para la generación de series de números procedentes de π
• Ya en la década de 2000 los ordenadores son capaces de sacar cifras record inmensamente grandes
como en 2004 en el que fueron capaces de sacar 1,3511 billones de lugares decimales mediante el
uso de un supercomputador Hitachi que llegó a trabajar sólo 500 horas para realizar el cálculo.
• En la época computacional del cálculo de pi las cifras se dispararon no sólo debido a la potencia de
cálculo que estas máquinas eran capaces de generar, sino que también era un prestigio y un reto
para el constructor de la máquina que apareciera su marca en la lista de los records.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
UNSCH – FIMGC - DAIMC CCP
UNIVERSIDAD NACIONAL DE SAN CRISTÓBAL DE HUAMANGA
FACULTAD : INGENIERÍA DE MINAS, GEOLOGÍA Y CIVIL
ESCUELA : INGENIERÍA CIVIL -6-
ASIGNATURA : MÉTODOS NUMÉRICOS (IC-343)
PROFESOR : ING. CRISTIAN CASTRO P. FECHA: Setiembre - 2010
PI=3’...
ALGORITMO DE BORWEIN:
Es un algoritmo desarrollado por Jonathan y Peter Borwein que permite el cálculo de 1/π.
Se procede de la siguiente forma:
1 − (1 − y k )1 / 4
4
y k +1 =
1 + (1 − y k )1 / 4
4
ak +1 = ak (1 + yk +1 ) 4 − 2 2 k +3 yk +1 (1 + yk +1 + y 2 k +1 )
Se tiene que ak posee una convergencia cuártica 1/π; es decir, en cada iteración se
multiplica por cuatro, aproximadamente, el número de dígitos correcto.
π
ALGORITMO DE BAILEY-BORWEIN-PLOUFFE
Y que se conocen con el nombre genérico de fórmulas BBP, estando sus límites
relacionados con constantes matemáticas fundamentales.
EVALUACIÓN DE ALGORITMOS
BAILEY-BORWEIN-
N° WALLIS BORWEIN
PLOUFFE
1 3.1 2,66666667 4
2 3.14 2,84444444 2,66666667
3 3.142 2,92571429 3,46666667
4 3.1416 2,9721542 2,8952381
5 3.14159 3,00217595 3,33968254
6 3.141593 3,02317019 2,97604618
7 3.1415927 3,03867363 3,28373848
8 3.14159265 3,05059 3,01707182
9 3.141592654 3,06003455 3,25236593
10 3.1415926543 3,06770381 3,04183962
700 3.1415926534 3,14047166 3,14016408
1398 3.1415926534 3,1410311 3,14087735
1399 3.1415926534 3,1410315 3,14230745
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
UNSCH – FIMGC - DAIMC CCP
UNIVERSIDAD NACIONAL DE SAN CRISTÓBAL DE HUAMANGA
FACULTAD : INGENIERÍA DE MINAS, GEOLOGÍA Y CIVIL
ESCUELA : INGENIERÍA CIVIL -8-
ASIGNATURA : MÉTODOS NUMÉRICOS (IC-343)
PROFESOR : ING. CRISTIAN CASTRO P. FECHA: Setiembre - 2010
Ejercicio de Aplicación
MATLAB: ONE.fig
MATLAB: ONE.m
% ONE M-file for ONE.fig
function varargout = ONE(varargin)
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @ONE_OpeningFcn, ...
'gui_OutputFcn', @ONE_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% --- Outputs from this function are returned to the command line.
function varargout = ONE_OutputFcn(hObject, eventdata, handles)
varargout{1} = handles.output;
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
TWO
close(ONE)
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
quit
MATLAB: TWO.fig
MATLAB: TWO.m
% TWO M-file for TWO.fig % See also: GUIDE, GUIDATA, GUIHANDLES
function varargout = TWO(varargin) % Copyright 2002-2003 The MathWorks, Inc.
% TWO M-file for TWO.fig % Edit the above text to modify the response help TWO
% TWO, by itself, creates a new TWO or raises the existing % Last Modified by GUIDE v2.5 18-Aug-2006 11:48:40
% singleton*. % Begin initialization code - DO NOT EDIT
% H = TWO returns the handle to a new TWO or the handle to gui_Singleton = 1;
% the existing singleton*. gui_State = struct('gui_Name', mfilename, ...
% TWO('CALLBACK',hObject,eventData,handles,...) calls the 'gui_Singleton', gui_Singleton,
local ...
% function named CALLBACK in TWO.M with the given input 'gui_OpeningFcn', @TWO_OpeningFcn,
arguments. ...
% TWO('Property','Value',...) creates a new TWO or raises 'gui_OutputFcn', @TWO_OutputFcn,
the ...
% existing singleton*. Starting from the left, property 'gui_LayoutFcn', [] , ...
value pairs are 'gui_Callback', []);
% applied to the GUI before TWO_OpeningFunction gets if nargin && ischar(varargin{1})
called. An gui_State.gui_Callback = str2func(varargin{1});
% unrecognized property name or invalid value makes end
property application if nargout
% stop. All inputs are passed to TWO_OpeningFcn [varargout{1:nargout}] = gui_mainfcn(gui_State,
% --- Executes just before TWO is made visible. varargin{:});
via varargin. else
% *See GUI Options on GUIDE's Tools menu. Choose gui_mainfcn(gui_State, varargin{:});
"GUI allows only one end
% instance to run (singleton)". % End initialization code - DO NOT EDIT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
UNSCH – FIMGC - DAIMC CCP
UNIVERSIDAD NACIONAL DE SAN CRISTÓBAL DE HUAMANGA
FACULTAD : INGENIERÍA DE MINAS, GEOLOGÍA Y CIVIL
ESCUELA : INGENIERÍA CIVIL - 10 -
ASIGNATURA : MÉTODOS NUMÉRICOS (IC-343)
PROFESOR : ING. CRISTIAN CASTRO P. FECHA: Setiembre - 2010
% --- Outputs from this function are returned to the % --- Executes during object creation, after setting
command line. all properties.
function varargout = TWO_OutputFcn(hObject, eventdata, function edit3_CreateFcn(hObject, eventdata, handles)
handles) % hObject handle to edit3 (see GCBO)
% varargout cell array for returning output args (see % eventdata reserved - to be defined in a future
VARARGOUT); version of MATLAB
% hObject handle to figure % handles empty - handles not created until after
% eventdata reserved - to be defined in a future version all CreateFcns called
of MATLAB
% handles structure with handles and user data (see % Hint: edit controls usually have a white background
GUIDATA) on Windows.
% See ISPC and COMPUTER.
% Get default command line output from handles structure if ispc
varargout{1} = handles.output; set(hObject,'BackgroundColor','white');
else
function edit1_Callback(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO) set(hObject,'BackgroundColor',get(0,'defaultUicontrolB
% eventdata reserved - to be defined in a future version ackgroundColor'));
of MATLAB end
% handles structure with handles and user data (see
GUIDATA) function edit4_Callback(hObject, eventdata, handles)
% hObject handle to edit4 (see GCBO)
% Hints: get(hObject,'String') returns contents of edit1 % eventdata reserved - to be defined in a future
as text version of MATLAB
% str2double(get(hObject,'String')) returns % handles structure with handles and user data (see
contents of edit1 as a double GUIDATA)
% --- Executes during object creation, after setting all % Hints: get(hObject,'String') returns contents of
properties. edit4 as text
function edit1_CreateFcn(hObject, eventdata, handles) % str2double(get(hObject,'String')) returns
% hObject handle to edit1 (see GCBO) contents of edit4 as a double
% eventdata reserved - to be defined in a future version
of MATLAB % --- Executes during object creation, after setting
% handles empty - handles not created until after all all properties.
CreateFcns called function edit4_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit4 (see GCBO)
% Hint: edit controls usually have a white background on % eventdata reserved - to be defined in a future
Windows. version of MATLAB
% See ISPC and COMPUTER. % handles empty - handles not created until after
if ispc all CreateFcns called
set(hObject,'BackgroundColor','white');
else % Hint: edit controls usually have a white background
on Windows.
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackg % See ISPC and COMPUTER.
roundColor')); if ispc
end set(hObject,'BackgroundColor','white');
else
function edit2_Callback(hObject, eventdata, handles)
% hObject handle to edit2 (see GCBO) set(hObject,'BackgroundColor',get(0,'defaultUicontrolB
% eventdata reserved - to be defined in a future version ackgroundColor'));
of MATLAB end
% handles structure with handles and user data (see
GUIDATA) function edit5_Callback(hObject, eventdata, handles)
% hObject handle to edit5 (see GCBO)
% Hints: get(hObject,'String') returns contents of edit2 % eventdata reserved - to be defined in a future
as text version of MATLAB
% str2double(get(hObject,'String')) returns % handles structure with handles and user data (see
contents of edit2 as a double GUIDATA)
% --- Executes during object creation, after setting all % Hints: get(hObject,'String') returns contents of
properties. edit5 as text
function edit2_CreateFcn(hObject, eventdata, handles) % str2double(get(hObject,'String')) returns
% hObject handle to edit2 (see GCBO) contents of edit5 as a double
% eventdata reserved - to be defined in a future version
of MATLAB % --- Executes during object creation, after setting
% handles empty - handles not created until after all all properties.
CreateFcns called function edit5_CreateFcn(hObject, eventdata, handles)
% Hint: edit controls usually have a white background on % hObject handle to edit5 (see GCBO)
Windows. % eventdata reserved - to be defined in a future
% See ISPC and COMPUTER. version of MATLAB
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
UNSCH – FIMGC - DAIMC CCP
UNIVERSIDAD NACIONAL DE SAN CRISTÓBAL DE HUAMANGA
FACULTAD : INGENIERÍA DE MINAS, GEOLOGÍA Y CIVIL
ESCUELA : INGENIERÍA CIVIL - 11 -
ASIGNATURA : MÉTODOS NUMÉRICOS (IC-343)
PROFESOR : ING. CRISTIAN CASTRO P. FECHA: Setiembre - 2010
set(hObject,'BackgroundColor',get(0,'defaultUicontrolB
% handles structure with handles and user data (see ackgroundColor'));
GUIDATA) end
% Hints: get(hObject,'String') returns contents of edit12 % --- Executes on button press in pushbutton1.
as text function pushbutton1_Callback(hObject, eventdata,
% str2double(get(hObject,'String')) returns handles)
contents of edit12 as a double % hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future
% --- Executes during object creation, after setting all version of MATLAB
properties. % handles structure with handles and user data (see
function edit12_CreateFcn(hObject, eventdata, handles) GUIDATA)
% hObject handle to edit12 (see GCBO) % --- Executes on button press in pushbutton2.
% eventdata reserved - to be defined in a future version function pushbutton2_Callback(hObject, eventdata,
of MATLAB handles)
% handles empty - handles not created until after all % hObject handle to pushbutton2 (see GCBO)
CreateFcns called % eventdata reserved - to be defined in a future
version of MATLAB
% Hint: edit controls usually have a white background on % handles structure with handles and user data (see
Windows. GUIDATA)
% See ISPC and COMPUTER. % --- Executes on button press in pushbutton3.
if ispc function pushbutton3_Callback(hObject, eventdata,
set(hObject,'BackgroundColor','white'); handles)
else % hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackg version of MATLAB
roundColor')); % handles structure with handles and user data (see
end GUIDATA)
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackg
roundColor'));
end
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackg
roundColor'));
end