SlideShare a Scribd company logo
Cálculo de la raíz de una ecuación no lineal mediante el Método Numérico de la Secante
Modificado
Utilizando macros de VBA de Excel
Ing. Néstor Augusto Oyarce Linares
naoyarcel@gmail.com
aSecanteModificadoGrafica - 1
Option Explicit
Sub XY_14_Dic_2020_6()
Dim X As Double, Y As Double, i As Integer
'Método Numérico de LA SECANTE MODIFICADA
'14 de Diciembre de 2020, ejercicio 6
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
Range("A1", "A3").Font.Bold = True
Cells.EntireColumn.AutoFit
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
bSecanteModificadaCalculo - 1
Option Explicit
Sub Parte2_SECANTEmodificada()
Dim X1 As Double, Y1 As Double, i As Integer, X2 As Double, kX1 As Double, Yb As Double
Dim Err As Double, Ym As Double, X As Double, j As Integer, Y As Double, Y2 As Double
'Función de Recurrencia :
'Metodo de la Secante Modificada
Cells.Clear
Cells(1, 1).Value = "Método Numérico de la Secante Modificada"
Cells(2, 2).Value = "Valor de X"
Cells(2, 3).Value = "Valor de Y"
Cells(2, 5).Value = " Xf "
Cells(2, 6).Value = " Yf "
Cells(2, 7).Value = "Iteraciones"
X1 = 1.3
For j = 1 To 20
kX1 = 0.1 * X1
Y1 = (X1) ^ (3) + 2 * (X1) ^ (2) + 10 * X1 - 20
Y2 = (X1 + kX1) ^ (3) + 2 * (X1 + kX1) ^ (2) + 10 * (X1 + kX1) - 20
X2 = X1 - Y1 * kX1 / (Y2 - Y1)
Y = (X2) ^ (3) + 2 * (X2) ^ (2) + 10 * X2 - 20
Err = Abs(X2 - X1)
Cells(j + 3, 2).Value = X2
Cells(j + 3, 3).Value = Y2
If Err <= 0.000001 Then Exit For
X1 = X2
Next j
X = X2
Y = (X) ^ (3) + 2 * (X) ^ (2) + 10 * X - 20
Cells(4, 5).Value = X
Cells(4, 6).Value = Y
Cells(4, 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 la Secante Modificada
Valor de X Valor de Y Xf Yf Iteraciones
1.367588428 1.314007 1.368808105 -5.85303E-08 5
1.368761073 2.97402333
1.368806277 3.00345259
1.368808037 3.00458749
1.368808105 3.004631658

More Related Content

What's hot

Product rule
Product ruleProduct rule
20160616技術會議
20160616技術會議20160616技術會議
20160616技術會議
Jason Kuan
 
Pre-Cal 40S Slides April 9, 2008
Pre-Cal 40S Slides April 9, 2008Pre-Cal 40S Slides April 9, 2008
Pre-Cal 40S Slides April 9, 2008
Darren Kuropatwa
 
Worksheet sine and cosine rule
Worksheet  sine and cosine ruleWorksheet  sine and cosine rule
Worksheet sine and cosine ruleMdm ika Sartika
 

What's hot (6)

Product rule
Product ruleProduct rule
Product rule
 
20160616技術會議
20160616技術會議20160616技術會議
20160616技術會議
 
Pre-Cal 40S Slides April 9, 2008
Pre-Cal 40S Slides April 9, 2008Pre-Cal 40S Slides April 9, 2008
Pre-Cal 40S Slides April 9, 2008
 
Worksheet sine and cosine rule
Worksheet  sine and cosine ruleWorksheet  sine and cosine rule
Worksheet sine and cosine rule
 
Pc12 sol c03_cp
Pc12 sol c03_cpPc12 sol c03_cp
Pc12 sol c03_cp
 
Exercise #11 notes
Exercise #11 notesExercise #11 notes
Exercise #11 notes
 

Similar to 0.0. secante modificada

0.0. secante naol
0.0. secante naol0.0. secante naol
0.0. secante naol
Agua SAC
 
0.0. steffensen.naol
0.0. steffensen.naol0.0. steffensen.naol
0.0. steffensen.naol
Agua SAC
 
ISI MSQE Entrance Question Paper (2008)
ISI MSQE Entrance Question Paper (2008)ISI MSQE Entrance Question Paper (2008)
ISI MSQE Entrance Question Paper (2008)
CrackDSE
 
ISI MSQE Entrance Question Paper (2010)
ISI MSQE Entrance Question Paper (2010)ISI MSQE Entrance Question Paper (2010)
ISI MSQE Entrance Question Paper (2010)
CrackDSE
 
Idea for ineractive programming language
Idea for ineractive programming languageIdea for ineractive programming language
Idea for ineractive programming language
Lincoln Hannah
 
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...
BGS Institute of Technology, Adichunchanagiri University (ACU)
 
Calculo integral - Larson
Calculo integral - LarsonCalculo integral - Larson
Calculo integral - Larson
Juan Alejandro Alvarez Agudelo
 
Math cbse samplepaper
Math cbse samplepaperMath cbse samplepaper
Assignment For Matlab Report Subject Calculus 2
Assignment For Matlab Report Subject  Calculus 2Assignment For Matlab Report Subject  Calculus 2
Assignment For Matlab Report Subject Calculus 2
Laurie Smith
 
Exercises in Linear Algebra - Matrices and determinants
Exercises in Linear Algebra - Matrices and determinantsExercises in Linear Algebra - Matrices and determinants
Exercises in Linear Algebra - Matrices and determinants
Maths Tutoring
 
138191 rvsp lecture notes
138191 rvsp lecture notes138191 rvsp lecture notes
138191 rvsp lecture notes
Ahmed Tayeh
 
3rd Semester Electronics and Communication Engineering (June-2016) Question P...
3rd Semester Electronics and Communication Engineering (June-2016) Question P...3rd Semester Electronics and Communication Engineering (June-2016) Question P...
3rd Semester Electronics and Communication Engineering (June-2016) Question P...
BGS Institute of Technology, Adichunchanagiri University (ACU)
 
Cbse Class 12 Maths Sample Paper 2012
Cbse Class 12 Maths Sample Paper 2012Cbse Class 12 Maths Sample Paper 2012
Cbse Class 12 Maths Sample Paper 2012
Sunaina Rawat
 
Additional mathematics
Additional mathematicsAdditional mathematics
Additional mathematics
geraldsiew
 
Proyecto parcial 2
Proyecto parcial 2Proyecto parcial 2
Proyecto parcial 2
KevinGuerra26
 
ゲーム理論BASIC 第36回 -続・交渉集合-
ゲーム理論BASIC 第36回 -続・交渉集合-ゲーム理論BASIC 第36回 -続・交渉集合-
ゲーム理論BASIC 第36回 -続・交渉集合-
ssusere0a682
 

Similar to 0.0. secante modificada (20)

0.0. secante naol
0.0. secante naol0.0. secante naol
0.0. secante naol
 
0.0. steffensen.naol
0.0. steffensen.naol0.0. steffensen.naol
0.0. steffensen.naol
 
ISI MSQE Entrance Question Paper (2008)
ISI MSQE Entrance Question Paper (2008)ISI MSQE Entrance Question Paper (2008)
ISI MSQE Entrance Question Paper (2008)
 
ISI MSQE Entrance Question Paper (2010)
ISI MSQE Entrance Question Paper (2010)ISI MSQE Entrance Question Paper (2010)
ISI MSQE Entrance Question Paper (2010)
 
bobok
bobokbobok
bobok
 
Idea for ineractive programming language
Idea for ineractive programming languageIdea for ineractive programming language
Idea for ineractive programming language
 
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...
 
Calculo integral - Larson
Calculo integral - LarsonCalculo integral - Larson
Calculo integral - Larson
 
Math cbse samplepaper
Math cbse samplepaperMath cbse samplepaper
Math cbse samplepaper
 
Assignment For Matlab Report Subject Calculus 2
Assignment For Matlab Report Subject  Calculus 2Assignment For Matlab Report Subject  Calculus 2
Assignment For Matlab Report Subject Calculus 2
 
Exercises in Linear Algebra - Matrices and determinants
Exercises in Linear Algebra - Matrices and determinantsExercises in Linear Algebra - Matrices and determinants
Exercises in Linear Algebra - Matrices and determinants
 
Arrays
ArraysArrays
Arrays
 
138191 rvsp lecture notes
138191 rvsp lecture notes138191 rvsp lecture notes
138191 rvsp lecture notes
 
3rd Semester Electronics and Communication Engineering (June-2016) Question P...
3rd Semester Electronics and Communication Engineering (June-2016) Question P...3rd Semester Electronics and Communication Engineering (June-2016) Question P...
3rd Semester Electronics and Communication Engineering (June-2016) Question P...
 
Cbse Class 12 Maths Sample Paper 2012
Cbse Class 12 Maths Sample Paper 2012Cbse Class 12 Maths Sample Paper 2012
Cbse Class 12 Maths Sample Paper 2012
 
Additional mathematics
Additional mathematicsAdditional mathematics
Additional mathematics
 
Proyecto parcial 2
Proyecto parcial 2Proyecto parcial 2
Proyecto parcial 2
 
3rd semester Computer Science and Information Science Engg (2013 December) Q...
3rd  semester Computer Science and Information Science Engg (2013 December) Q...3rd  semester Computer Science and Information Science Engg (2013 December) Q...
3rd semester Computer Science and Information Science Engg (2013 December) Q...
 
ゲーム理論BASIC 第36回 -続・交渉集合-
ゲーム理論BASIC 第36回 -続・交渉集合-ゲーム理論BASIC 第36回 -続・交渉集合-
ゲーム理論BASIC 第36回 -続・交渉集合-
 
Chapter 2
Chapter  2Chapter  2
Chapter 2
 

More from Agua SAC

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

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

English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
BrazilAccount1
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
SyedAbiiAzazi1
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
symbo111
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
Basic Industrial Engineering terms for apparel
Basic Industrial Engineering terms for apparelBasic Industrial Engineering terms for apparel
Basic Industrial Engineering terms for apparel
top1002
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
Vijay Dialani, PhD
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
FluxPrime1
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 

Recently uploaded (20)

English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
Basic Industrial Engineering terms for apparel
Basic Industrial Engineering terms for apparelBasic Industrial Engineering terms for apparel
Basic Industrial Engineering terms for apparel
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 

0.0. secante modificada

  • 1. Cálculo de la raíz de una ecuación no lineal mediante el Método Numérico de la Secante Modificado Utilizando macros de VBA de Excel Ing. Néstor Augusto Oyarce Linares naoyarcel@gmail.com
  • 2. aSecanteModificadoGrafica - 1 Option Explicit Sub XY_14_Dic_2020_6() Dim X As Double, Y As Double, i As Integer 'Método Numérico de LA SECANTE MODIFICADA '14 de Diciembre de 2020, ejercicio 6 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 Range("A1", "A3").Font.Bold = True Cells.EntireColumn.AutoFit 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
  • 4. bSecanteModificadaCalculo - 1 Option Explicit Sub Parte2_SECANTEmodificada() Dim X1 As Double, Y1 As Double, i As Integer, X2 As Double, kX1 As Double, Yb As Double Dim Err As Double, Ym As Double, X As Double, j As Integer, Y As Double, Y2 As Double 'Función de Recurrencia : 'Metodo de la Secante Modificada Cells.Clear Cells(1, 1).Value = "Método Numérico de la Secante Modificada" Cells(2, 2).Value = "Valor de X" Cells(2, 3).Value = "Valor de Y" Cells(2, 5).Value = " Xf " Cells(2, 6).Value = " Yf " Cells(2, 7).Value = "Iteraciones" X1 = 1.3 For j = 1 To 20 kX1 = 0.1 * X1 Y1 = (X1) ^ (3) + 2 * (X1) ^ (2) + 10 * X1 - 20 Y2 = (X1 + kX1) ^ (3) + 2 * (X1 + kX1) ^ (2) + 10 * (X1 + kX1) - 20 X2 = X1 - Y1 * kX1 / (Y2 - Y1) Y = (X2) ^ (3) + 2 * (X2) ^ (2) + 10 * X2 - 20 Err = Abs(X2 - X1) Cells(j + 3, 2).Value = X2 Cells(j + 3, 3).Value = Y2 If Err <= 0.000001 Then Exit For X1 = X2 Next j X = X2 Y = (X) ^ (3) + 2 * (X) ^ (2) + 10 * X - 20 Cells(4, 5).Value = X Cells(4, 6).Value = Y Cells(4, 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 la Secante Modificada Valor de X Valor de Y Xf Yf Iteraciones 1.367588428 1.314007 1.368808105 -5.85303E-08 5 1.368761073 2.97402333 1.368806277 3.00345259 1.368808037 3.00458749 1.368808105 3.004631658