SlideShare a Scribd company logo
1 of 5
Download to read offline
Cálculo de la raíz de una ecuación no lineal mediante el Método Numérico del Punto_Fijo
Ing. Néstor Augusto Oyarce Linares
Utilizando macros VBA de Excel
naoyarcel@gmail.com
aPuntoFijoGrafica - 1
Option Explicit
Sub XY_10_Dic_2020_2()
Dim X As Double, Y As Double, i As Integer, X1 As Double, X0 As Double, XX As Double
Dim Err As Double, YD As Double, j As Integer, gx0 As Double, gx As Double
'Método Numérico de Punto Fijo
'10 de Diciembre de 2020, ejercicio 2
Cells.Clear
Cells(1, 1).Value = " ECUACION : "
Cells(3, 1).Value = " X^3+2*X^2+10*X-20"
Cells(1, 2).Value = " ENSAYOS : "
Cells(3, 2).Value = " X "
Cells(3, 3).Value = " Y "
For i = 1 To 10
X = 1 + i / 10
Y = (X) ^ (3) + 2 * (X) ^ (2) + 10 * X - 20
Cells(i + 3, 2).Value = X
Cells(i + 3, 3).Value = Y
If Y > 0 Then Exit For
Next i
End Sub
Sub Crea_grafico()
Dim grafico As ChartObject
Dim wks As Worksheet
Set wks = ActiveWorkbook.Sheets("Hoja1")
Set grafico = wks.ChartObjects.Add(Left:=400, Width:=450, Top:=50, Height:=200)
grafico.Name = "Grafico_1"
grafico.Chart.ChartType = xlXYScatterSmoothNoMarkers
grafico.Chart.SetSourceData Source:=wks.Range("B4:D15")
End Sub
' Ing. Néstor Augusto Oyarce Linares
ECUACION : ENSAYOS :
X^3+2*X^2+10*X-20 X Y
1.1 -5.249
1.2 -3.392
1.3 -1.423
1.4 0.664
-6
-5
-4
-3
-2
-1
0
1
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6
Series1
Series2
-6
-5
-4
-3
-2
-1
0
1
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6
Series1
Series2
bPuntoFijoCalculo - 1
Option Explicit
Sub PuntoFijoParte2()
Dim X1 As Double, X2 As Double, Y As Double, j As Integer
Dim X As Double, Error As Double, gx As Double
Cells.Clear
Cells(1, 2).Value = "Método Numérico de Punto Fijo"
Cells(1, 3).Value = "Valor de X"
Cells(1, 4).Value = "Valor de Y"
Cells(1, 5).Value = " Xf"
Cells(1, 6).Value = " Yf"
Cells(1, 7).Value = "Iteraciones"
X = 1.37
Cells(2, 3).Value = X
For j = 1 To 10
gx = 20 / (X ^ (2) + 2 * X + 10)
Error = Abs(gx - X)
X = gx
Cells(j + 2, 3).Value = X
Cells(j + 2, 4).Value = gx
If Error <= 0.0000001 Then Exit For
Next j
Y = X ^ (3) + 2 * X ^ (2) + 10 * X - 20
Cells(3, 5).Value = X
Cells(3, 6).Value = Y
Cells(3, 7).Value = j
Range("E1", "E4").Font.Bold = True
Range("E1", "E4").Font.Color = RGB(8, 44, 196)
Cells.EntireColumn.AutoFit
End Sub
' Ing. Néstor Augusto Oyarce Linares
Método Numérico de Punto Fijo Valor de X Valor de Y Xf Yf Iteraciones
1.37
1.368279184 1.368279184 1.368808461 7.45675E-06 11
1.369042873 1.369042873
1.368703915 1.368703915
1.368854352 1.368854352
1.368787583 1.368787583
1.368817217 1.368817217
1.368804065 1.368804065
1.368809902 1.368809902
1.368807311 1.368807311
1.368808461 1.368808461

More Related Content

Similar to 0.0. punto fijo

Seminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov Vyacheslav
Seminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov VyacheslavSeminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov Vyacheslav
Seminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov Vyacheslav
Vyacheslav Arbuzov
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
krishna_093
 
Dirty quant-shortcut-workshop-handout-inequalities-functions-graphs-coordinat...
Dirty quant-shortcut-workshop-handout-inequalities-functions-graphs-coordinat...Dirty quant-shortcut-workshop-handout-inequalities-functions-graphs-coordinat...
Dirty quant-shortcut-workshop-handout-inequalities-functions-graphs-coordinat...
Nish Kala Devi
 

Similar to 0.0. punto fijo (20)

4th Semeste Electronics and Communication Engineering (June-2016) Question Pa...
4th Semeste Electronics and Communication Engineering (June-2016) Question Pa...4th Semeste Electronics and Communication Engineering (June-2016) Question Pa...
4th Semeste Electronics and Communication Engineering (June-2016) Question Pa...
 
4th Semester (June; July-2015) Computer Science and Information Science Engin...
4th Semester (June; July-2015) Computer Science and Information Science Engin...4th Semester (June; July-2015) Computer Science and Information Science Engin...
4th Semester (June; July-2015) Computer Science and Information Science Engin...
 
4th semester Computer Science and Information Science Engg (2013 December) Qu...
4th semester Computer Science and Information Science Engg (2013 December) Qu...4th semester Computer Science and Information Science Engg (2013 December) Qu...
4th semester Computer Science and Information Science Engg (2013 December) Qu...
 
Idea for ineractive programming language
Idea for ineractive programming languageIdea for ineractive programming language
Idea for ineractive programming language
 
R Probability and Statistics
R Probability and StatisticsR Probability and Statistics
R Probability and Statistics
 
Seminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov Vyacheslav
Seminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov VyacheslavSeminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov Vyacheslav
Seminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov Vyacheslav
 
Arrays
ArraysArrays
Arrays
 
4th Semester Electronic and Communication Engineering (June/July-2015) Questi...
4th Semester Electronic and Communication Engineering (June/July-2015) Questi...4th Semester Electronic and Communication Engineering (June/July-2015) Questi...
4th Semester Electronic and Communication Engineering (June/July-2015) Questi...
 
C++ ammar .s.q
C++  ammar .s.qC++  ammar .s.q
C++ ammar .s.q
 
4th Semester CS / IS (2013-June) Question Papers
4th Semester CS / IS (2013-June) Question Papers 4th Semester CS / IS (2013-June) Question Papers
4th Semester CS / IS (2013-June) Question Papers
 
4th Semester (July-2016) Civil Engineering Question Paper
4th Semester (July-2016) Civil Engineering Question Paper4th Semester (July-2016) Civil Engineering Question Paper
4th Semester (July-2016) Civil Engineering Question Paper
 
Lenses for the masses - introducing Goggles
Lenses for the masses - introducing GogglesLenses for the masses - introducing Goggles
Lenses for the masses - introducing Goggles
 
Module II Partition and Generating Function (2).ppt
Module II Partition and Generating Function (2).pptModule II Partition and Generating Function (2).ppt
Module II Partition and Generating Function (2).ppt
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 
4th Semester (Dec-2015; Jan-2016) Computer Science and Information Science En...
4th Semester (Dec-2015; Jan-2016) Computer Science and Information Science En...4th Semester (Dec-2015; Jan-2016) Computer Science and Information Science En...
4th Semester (Dec-2015; Jan-2016) Computer Science and Information Science En...
 
138191 rvsp lecture notes
138191 rvsp lecture notes138191 rvsp lecture notes
138191 rvsp lecture notes
 
Dirty quant-shortcut-workshop-handout-inequalities-functions-graphs-coordinat...
Dirty quant-shortcut-workshop-handout-inequalities-functions-graphs-coordinat...Dirty quant-shortcut-workshop-handout-inequalities-functions-graphs-coordinat...
Dirty quant-shortcut-workshop-handout-inequalities-functions-graphs-coordinat...
 
Final exam mariluz 1
Final exam mariluz 1Final exam mariluz 1
Final exam mariluz 1
 
The Perceptron (D1L2 Deep Learning for Speech and Language)
The Perceptron (D1L2 Deep Learning for Speech and Language)The Perceptron (D1L2 Deep Learning for Speech and Language)
The Perceptron (D1L2 Deep Learning for Speech and Language)
 
Module 2 polynomial functions
Module 2   polynomial functionsModule 2   polynomial functions
Module 2 polynomial functions
 

More from Agua SAC (6)

0.0. newton raphson
0.0. newton raphson0.0. newton raphson
0.0. newton raphson
 
Publi 05.03.2015
Publi 05.03.2015Publi 05.03.2015
Publi 05.03.2015
 
Trapecio tarea 1
Trapecio tarea 1Trapecio tarea 1
Trapecio tarea 1
 
Sistema información geografica y dengue
Sistema información geografica y dengueSistema información geografica y dengue
Sistema información geografica y dengue
 
Ejercicio amp2 naol
Ejercicio amp2 naolEjercicio amp2 naol
Ejercicio amp2 naol
 
Ejercicio amp2 naol
Ejercicio amp2 naolEjercicio amp2 naol
Ejercicio amp2 naol
 

Recently uploaded

ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdf
ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdfONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdf
ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdf
Kamal Acharya
 
Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...
Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...
Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...
Lovely Professional University
 
Teachers record management system project report..pdf
Teachers record management system project report..pdfTeachers record management system project report..pdf
Teachers record management system project report..pdf
Kamal Acharya
 
DR PROF ING GURUDUTT SAHNI WIKIPEDIA.pdf
DR PROF ING GURUDUTT SAHNI WIKIPEDIA.pdfDR PROF ING GURUDUTT SAHNI WIKIPEDIA.pdf
DR PROF ING GURUDUTT SAHNI WIKIPEDIA.pdf
DrGurudutt
 

Recently uploaded (20)

ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdf
ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdfONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdf
ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdf
 
Research Methodolgy & Intellectual Property Rights Series 2
Research Methodolgy & Intellectual Property Rights Series 2Research Methodolgy & Intellectual Property Rights Series 2
Research Methodolgy & Intellectual Property Rights Series 2
 
Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...
Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...
Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...
 
Theory for How to calculation capacitor bank
Theory for How to calculation capacitor bankTheory for How to calculation capacitor bank
Theory for How to calculation capacitor bank
 
Fabrication Of Automatic Star Delta Starter Using Relay And GSM Module By Utk...
Fabrication Of Automatic Star Delta Starter Using Relay And GSM Module By Utk...Fabrication Of Automatic Star Delta Starter Using Relay And GSM Module By Utk...
Fabrication Of Automatic Star Delta Starter Using Relay And GSM Module By Utk...
 
Software Engineering - Modelling Concepts + Class Modelling + Building the An...
Software Engineering - Modelling Concepts + Class Modelling + Building the An...Software Engineering - Modelling Concepts + Class Modelling + Building the An...
Software Engineering - Modelling Concepts + Class Modelling + Building the An...
 
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical EngineeringIntroduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
 
Teachers record management system project report..pdf
Teachers record management system project report..pdfTeachers record management system project report..pdf
Teachers record management system project report..pdf
 
Electrical shop management system project report.pdf
Electrical shop management system project report.pdfElectrical shop management system project report.pdf
Electrical shop management system project report.pdf
 
Circuit Breaker arc phenomenon.pdf engineering
Circuit Breaker arc phenomenon.pdf engineeringCircuit Breaker arc phenomenon.pdf engineering
Circuit Breaker arc phenomenon.pdf engineering
 
Multivibrator and its types defination and usges.pptx
Multivibrator and its types defination and usges.pptxMultivibrator and its types defination and usges.pptx
Multivibrator and its types defination and usges.pptx
 
Interfacing Analog to Digital Data Converters ee3404.pdf
Interfacing Analog to Digital Data Converters ee3404.pdfInterfacing Analog to Digital Data Converters ee3404.pdf
Interfacing Analog to Digital Data Converters ee3404.pdf
 
"United Nations Park" Site Visit Report.
"United Nations Park" Site  Visit Report."United Nations Park" Site  Visit Report.
"United Nations Park" Site Visit Report.
 
Operating System chapter 9 (Virtual Memory)
Operating System chapter 9 (Virtual Memory)Operating System chapter 9 (Virtual Memory)
Operating System chapter 9 (Virtual Memory)
 
DR PROF ING GURUDUTT SAHNI WIKIPEDIA.pdf
DR PROF ING GURUDUTT SAHNI WIKIPEDIA.pdfDR PROF ING GURUDUTT SAHNI WIKIPEDIA.pdf
DR PROF ING GURUDUTT SAHNI WIKIPEDIA.pdf
 
BURGER ORDERING SYSYTEM PROJECT REPORT..pdf
BURGER ORDERING SYSYTEM PROJECT REPORT..pdfBURGER ORDERING SYSYTEM PROJECT REPORT..pdf
BURGER ORDERING SYSYTEM PROJECT REPORT..pdf
 
Lesson no16 application of Induction Generator in Wind.ppsx
Lesson no16 application of Induction Generator in Wind.ppsxLesson no16 application of Induction Generator in Wind.ppsx
Lesson no16 application of Induction Generator in Wind.ppsx
 
2024 DevOps Pro Europe - Growing at the edge
2024 DevOps Pro Europe - Growing at the edge2024 DevOps Pro Europe - Growing at the edge
2024 DevOps Pro Europe - Growing at the edge
 
Electrostatic field in a coaxial transmission line
Electrostatic field in a coaxial transmission lineElectrostatic field in a coaxial transmission line
Electrostatic field in a coaxial transmission line
 
ANSI(ST)-III_Manufacturing-I_05052020.pdf
ANSI(ST)-III_Manufacturing-I_05052020.pdfANSI(ST)-III_Manufacturing-I_05052020.pdf
ANSI(ST)-III_Manufacturing-I_05052020.pdf
 

0.0. punto fijo

  • 1. Cálculo de la raíz de una ecuación no lineal mediante el Método Numérico del Punto_Fijo Ing. Néstor Augusto Oyarce Linares Utilizando macros VBA de Excel naoyarcel@gmail.com
  • 2. aPuntoFijoGrafica - 1 Option Explicit Sub XY_10_Dic_2020_2() Dim X As Double, Y As Double, i As Integer, X1 As Double, X0 As Double, XX As Double Dim Err As Double, YD As Double, j As Integer, gx0 As Double, gx As Double 'Método Numérico de Punto Fijo '10 de Diciembre de 2020, ejercicio 2 Cells.Clear Cells(1, 1).Value = " ECUACION : " Cells(3, 1).Value = " X^3+2*X^2+10*X-20" Cells(1, 2).Value = " ENSAYOS : " Cells(3, 2).Value = " X " Cells(3, 3).Value = " Y " For i = 1 To 10 X = 1 + i / 10 Y = (X) ^ (3) + 2 * (X) ^ (2) + 10 * X - 20 Cells(i + 3, 2).Value = X Cells(i + 3, 3).Value = Y If Y > 0 Then Exit For Next i End Sub Sub Crea_grafico() Dim grafico As ChartObject Dim wks As Worksheet Set wks = ActiveWorkbook.Sheets("Hoja1") Set grafico = wks.ChartObjects.Add(Left:=400, Width:=450, Top:=50, Height:=200) grafico.Name = "Grafico_1" grafico.Chart.ChartType = xlXYScatterSmoothNoMarkers grafico.Chart.SetSourceData Source:=wks.Range("B4:D15") End Sub ' Ing. Néstor Augusto Oyarce Linares
  • 3. ECUACION : ENSAYOS : X^3+2*X^2+10*X-20 X Y 1.1 -5.249 1.2 -3.392 1.3 -1.423 1.4 0.664 -6 -5 -4 -3 -2 -1 0 1 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 Series1 Series2 -6 -5 -4 -3 -2 -1 0 1 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 Series1 Series2
  • 4. bPuntoFijoCalculo - 1 Option Explicit Sub PuntoFijoParte2() Dim X1 As Double, X2 As Double, Y As Double, j As Integer Dim X As Double, Error As Double, gx As Double Cells.Clear Cells(1, 2).Value = "Método Numérico de Punto Fijo" Cells(1, 3).Value = "Valor de X" Cells(1, 4).Value = "Valor de Y" Cells(1, 5).Value = " Xf" Cells(1, 6).Value = " Yf" Cells(1, 7).Value = "Iteraciones" X = 1.37 Cells(2, 3).Value = X For j = 1 To 10 gx = 20 / (X ^ (2) + 2 * X + 10) Error = Abs(gx - X) X = gx Cells(j + 2, 3).Value = X Cells(j + 2, 4).Value = gx If Error <= 0.0000001 Then Exit For Next j Y = X ^ (3) + 2 * X ^ (2) + 10 * X - 20 Cells(3, 5).Value = X Cells(3, 6).Value = Y Cells(3, 7).Value = j Range("E1", "E4").Font.Bold = True Range("E1", "E4").Font.Color = RGB(8, 44, 196) Cells.EntireColumn.AutoFit End Sub ' Ing. Néstor Augusto Oyarce Linares
  • 5. Método Numérico de Punto Fijo Valor de X Valor de Y Xf Yf Iteraciones 1.37 1.368279184 1.368279184 1.368808461 7.45675E-06 11 1.369042873 1.369042873 1.368703915 1.368703915 1.368854352 1.368854352 1.368787583 1.368787583 1.368817217 1.368817217 1.368804065 1.368804065 1.368809902 1.368809902 1.368807311 1.368807311 1.368808461 1.368808461