SlideShare ist ein Scribd-Unternehmen logo
1 von 2
Public Class Form1
Dim x(6) As Single
Dim y(6) As Single
Dim z(6) As Single
Dim s, s1, s2, s3, s4, s5, s6, s7 As Double
Dim l(3, 3) As Single
Private Sub btndatos_Click(sender As Object, e As EventArgs) Handles
btndatos.Click
a.Rows(0).Cells(0).Value = "i"
For i = 1 To 6
a.Rows(i).Cells(0).Value = i - 1
Next
a.Rows(0).Cells(1).Value = "x"
a.Rows(1).Cells(1).Value = 0
a.Rows(2).Cells(1).Value = 2
a.Rows(3).Cells(1).Value = 2.5
a.Rows(4).Cells(1).Value = 1
a.Rows(5).Cells(1).Value = 4
a.Rows(6).Cells(1).Value = 7
a.Rows(0).Cells(2).Value = "y"
a.Rows(1).Cells(2).Value = 0
a.Rows(2).Cells(2).Value = 1
a.Rows(3).Cells(2).Value = 2
a.Rows(4).Cells(2).Value = 3
a.Rows(5).Cells(2).Value = 6
a.Rows(6).Cells(2).Value = 2
a.Rows(0).Cells(3).Value = "z"
a.Rows(1).Cells(3).Value = 5
a.Rows(2).Cells(3).Value = 10
a.Rows(3).Cells(3).Value = 9
a.Rows(4).Cells(3).Value = 0
a.Rows(5).Cells(3).Value = 3
a.Rows(6).Cells(3).Value = 27
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
a.Rows.Add(6)
b.Rows.Add(6)
End Sub
Private Sub btngenerar_Click(sender As Object, e As EventArgs) Handles
btngenerar.Click
x(0) = a.Rows(1).Cells(1).Value
x(1) = a.Rows(2).Cells(1).Value
x(2) = a.Rows(3).Cells(1).Value
x(3) = a.Rows(4).Cells(1).Value
x(4) = a.Rows(5).Cells(1).Value
x(5) = a.Rows(6).Cells(1).Value
y(0) = a.Rows(1).Cells(2).Value
y(1) = a.Rows(2).Cells(2).Value
y(2) = a.Rows(3).Cells(2).Value
y(3) = a.Rows(4).Cells(2).Value
y(4) = a.Rows(5).Cells(2).Value
y(5) = a.Rows(6).Cells(2).Value
z(0) = a.Rows(1).Cells(3).Value
z(1) = a.Rows(2).Cells(3).Value
z(2) = a.Rows(3).Cells(3).Value
z(3) = a.Rows(4).Cells(3).Value
z(4) = a.Rows(5).Cells(3).Value
z(5) = a.Rows(6).Cells(3).Value
b.Rows(0).Cells(0).Value = 6
For i = 0 To 5
s = s + x(i)
s1 = s1 + y(i)
s2 = s2 + (x(i)) ^ 2
s3 = s3 + x(i) * y(i)
s4 = s4 + y((i)) ^ 2
s5 = s5 + z(i)
s6 = s6 + x(i) * z(i)
s7 = s7 + y(i) * z(i)
Next
b.Rows(1).Cells(0).Value = s
b.Rows(0).Cells(1).Value = s
b.Rows(2).Cells(0).Value = s1
b.Rows(0).Cells(2).Value = s1
b.Rows(1).Cells(1).Value = s2
b.Rows(2).Cells(1).Value = s3
b.Rows(1).Cells(2).Value = s3
b.Rows(2).Cells(2).Value = s4
b.Rows(0).Cells(3).Value = s5
b.Rows(1).Cells(3).Value = s6
b.Rows(2).Cells(3).Value = s7
End Sub
Private Sub btncalcular_Click(sender As Object, e As EventArgs) Handles
btncalcular.Click
Dim a0, a1, a2, c1, c2, c3 As Double
l(1, 1) = (b.Rows(0).Cells(0).Value) ^ 0.5
l(2, 1) = (b.Rows(1).Cells(0).Value) / l(1, 1)
l(3, 1) = (b.Rows(2).Cells(0).Value) / l(1, 1)
l(2, 2) = ((b.Rows(1).Cells(1).Value) - (l(2, 1)) ^ 2) ^ 0.5
l(3, 2) = ((b.Rows(2).Cells(1).Value) - l(2, 1) * l(3, 1)) / l(2, 2)
l(3, 3) = ((b.Rows(2).Cells(2).Value) - (l(3, 1)) ^ 2 - (l(3, 2)) ^ 2) ^ 0.5
c1 = (b.Rows(0).Cells(3).Value) / l(1, 1)
c2 = ((b.Rows(1).Cells(3).Value) - l(2, 1) * c1) / l(2, 2)
c3 = ((b.Rows(2).Cells(3).Value) - l(3, 1) * c1 - l(3, 2) * c2) / l(3, 3)
a2 = c3 / l(3, 3)
a1 = (c2 - l(3, 2) * a2) / l(2, 2)
a0 = (c1 - l(2, 1) * a1 - l(3, 1) * a2) / l(1, 1)
txtacero.Text = FormatNumber(a0,4)
txtauno.Text = FormatNumber(a1, 4)
txtados.Text = FormatNumber(a2, 4)
End Sub
End Class

Weitere ähnliche Inhalte

Ähnlich wie Practica 5 simu cholesky

5 1 Linear Functions
5 1 Linear Functions5 1 Linear Functions
5 1 Linear Functions
taco40
 

Ähnlich wie Practica 5 simu cholesky (20)

Add math may june 2016 p1
Add math may june 2016 p1Add math may june 2016 p1
Add math may june 2016 p1
 
GATE Mathematics Paper-2000
GATE Mathematics Paper-2000GATE Mathematics Paper-2000
GATE Mathematics Paper-2000
 
Ml lesson 4 1
Ml lesson 4 1Ml lesson 4 1
Ml lesson 4 1
 
Introduction to Python Programming.pptx
Introduction to Python Programming.pptxIntroduction to Python Programming.pptx
Introduction to Python Programming.pptx
 
R lecture oga
R lecture ogaR lecture oga
R lecture oga
 
ISI MSQE Entrance Question Paper (2010)
ISI MSQE Entrance Question Paper (2010)ISI MSQE Entrance Question Paper (2010)
ISI MSQE Entrance Question Paper (2010)
 
Super Advanced Python –act1
Super Advanced Python –act1Super Advanced Python –act1
Super Advanced Python –act1
 
Core 1 revision booklet edexcel
Core 1 revision booklet edexcelCore 1 revision booklet edexcel
Core 1 revision booklet edexcel
 
Slides Vba Mamb
Slides Vba MambSlides Vba Mamb
Slides Vba Mamb
 
lecture11.ppt
lecture11.pptlecture11.ppt
lecture11.ppt
 
Data import-cheatsheet
Data import-cheatsheetData import-cheatsheet
Data import-cheatsheet
 
5 1 Linear Functions
5 1 Linear Functions5 1 Linear Functions
5 1 Linear Functions
 
2ds
2ds2ds
2ds
 
Data integration and provenance-Chapter-14
Data integration and provenance-Chapter-14Data integration and provenance-Chapter-14
Data integration and provenance-Chapter-14
 
R for Statistical Computing
R for Statistical ComputingR for Statistical Computing
R for Statistical Computing
 
Matlab ploting
Matlab plotingMatlab ploting
Matlab ploting
 
Statistics Homework Help
Statistics Homework HelpStatistics Homework Help
Statistics Homework Help
 
lect.no.3.pptx
lect.no.3.pptxlect.no.3.pptx
lect.no.3.pptx
 
Leet Code May Coding Challenge - DataStructure and Algorithm Problems
Leet Code May Coding Challenge - DataStructure and Algorithm ProblemsLeet Code May Coding Challenge - DataStructure and Algorithm Problems
Leet Code May Coding Challenge - DataStructure and Algorithm Problems
 
Power of functions in a typed world
Power of functions in a typed worldPower of functions in a typed world
Power of functions in a typed world
 

Kürzlich hochgeladen

1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
AldoGarca30
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
jaanualu31
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
MayuraD1
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptx
chumtiyababu
 

Kürzlich hochgeladen (20)

Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and properties
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planes
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptx
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 

Practica 5 simu cholesky

  • 1. Public Class Form1 Dim x(6) As Single Dim y(6) As Single Dim z(6) As Single Dim s, s1, s2, s3, s4, s5, s6, s7 As Double Dim l(3, 3) As Single Private Sub btndatos_Click(sender As Object, e As EventArgs) Handles btndatos.Click a.Rows(0).Cells(0).Value = "i" For i = 1 To 6 a.Rows(i).Cells(0).Value = i - 1 Next a.Rows(0).Cells(1).Value = "x" a.Rows(1).Cells(1).Value = 0 a.Rows(2).Cells(1).Value = 2 a.Rows(3).Cells(1).Value = 2.5 a.Rows(4).Cells(1).Value = 1 a.Rows(5).Cells(1).Value = 4 a.Rows(6).Cells(1).Value = 7 a.Rows(0).Cells(2).Value = "y" a.Rows(1).Cells(2).Value = 0 a.Rows(2).Cells(2).Value = 1 a.Rows(3).Cells(2).Value = 2 a.Rows(4).Cells(2).Value = 3 a.Rows(5).Cells(2).Value = 6 a.Rows(6).Cells(2).Value = 2 a.Rows(0).Cells(3).Value = "z" a.Rows(1).Cells(3).Value = 5 a.Rows(2).Cells(3).Value = 10 a.Rows(3).Cells(3).Value = 9 a.Rows(4).Cells(3).Value = 0 a.Rows(5).Cells(3).Value = 3 a.Rows(6).Cells(3).Value = 27 End Sub Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load a.Rows.Add(6) b.Rows.Add(6) End Sub Private Sub btngenerar_Click(sender As Object, e As EventArgs) Handles btngenerar.Click x(0) = a.Rows(1).Cells(1).Value x(1) = a.Rows(2).Cells(1).Value x(2) = a.Rows(3).Cells(1).Value x(3) = a.Rows(4).Cells(1).Value x(4) = a.Rows(5).Cells(1).Value x(5) = a.Rows(6).Cells(1).Value y(0) = a.Rows(1).Cells(2).Value y(1) = a.Rows(2).Cells(2).Value y(2) = a.Rows(3).Cells(2).Value y(3) = a.Rows(4).Cells(2).Value y(4) = a.Rows(5).Cells(2).Value y(5) = a.Rows(6).Cells(2).Value z(0) = a.Rows(1).Cells(3).Value
  • 2. z(1) = a.Rows(2).Cells(3).Value z(2) = a.Rows(3).Cells(3).Value z(3) = a.Rows(4).Cells(3).Value z(4) = a.Rows(5).Cells(3).Value z(5) = a.Rows(6).Cells(3).Value b.Rows(0).Cells(0).Value = 6 For i = 0 To 5 s = s + x(i) s1 = s1 + y(i) s2 = s2 + (x(i)) ^ 2 s3 = s3 + x(i) * y(i) s4 = s4 + y((i)) ^ 2 s5 = s5 + z(i) s6 = s6 + x(i) * z(i) s7 = s7 + y(i) * z(i) Next b.Rows(1).Cells(0).Value = s b.Rows(0).Cells(1).Value = s b.Rows(2).Cells(0).Value = s1 b.Rows(0).Cells(2).Value = s1 b.Rows(1).Cells(1).Value = s2 b.Rows(2).Cells(1).Value = s3 b.Rows(1).Cells(2).Value = s3 b.Rows(2).Cells(2).Value = s4 b.Rows(0).Cells(3).Value = s5 b.Rows(1).Cells(3).Value = s6 b.Rows(2).Cells(3).Value = s7 End Sub Private Sub btncalcular_Click(sender As Object, e As EventArgs) Handles btncalcular.Click Dim a0, a1, a2, c1, c2, c3 As Double l(1, 1) = (b.Rows(0).Cells(0).Value) ^ 0.5 l(2, 1) = (b.Rows(1).Cells(0).Value) / l(1, 1) l(3, 1) = (b.Rows(2).Cells(0).Value) / l(1, 1) l(2, 2) = ((b.Rows(1).Cells(1).Value) - (l(2, 1)) ^ 2) ^ 0.5 l(3, 2) = ((b.Rows(2).Cells(1).Value) - l(2, 1) * l(3, 1)) / l(2, 2) l(3, 3) = ((b.Rows(2).Cells(2).Value) - (l(3, 1)) ^ 2 - (l(3, 2)) ^ 2) ^ 0.5 c1 = (b.Rows(0).Cells(3).Value) / l(1, 1) c2 = ((b.Rows(1).Cells(3).Value) - l(2, 1) * c1) / l(2, 2) c3 = ((b.Rows(2).Cells(3).Value) - l(3, 1) * c1 - l(3, 2) * c2) / l(3, 3) a2 = c3 / l(3, 3) a1 = (c2 - l(3, 2) * a2) / l(2, 2) a0 = (c1 - l(2, 1) * a1 - l(3, 1) * a2) / l(1, 1) txtacero.Text = FormatNumber(a0,4) txtauno.Text = FormatNumber(a1, 4) txtados.Text = FormatNumber(a2, 4) End Sub End Class