0% found this document useful (0 votes)
47 views4 pages

Metodos Numericos - Resolucion de Integrales en Visual Basic

The document describes a Visual Basic program that uses four different numerical methods - rectangles inscribed, rectangles circumscribed, midpoint, and trapezoidal - to calculate the value of integrals. The program displays a menu allowing the user to choose which method to use. For each method selected, it prompts the user to input the lower limit, upper limit, and number of divisions, then calculates the integral value and displays it.

Uploaded by

Tayra Lucero
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views4 pages

Metodos Numericos - Resolucion de Integrales en Visual Basic

The document describes a Visual Basic program that uses four different numerical methods - rectangles inscribed, rectangles circumscribed, midpoint, and trapezoidal - to calculate the value of integrals. The program displays a menu allowing the user to choose which method to use. For each method selected, it prompts the user to input the lower limit, upper limit, and number of divisions, then calculates the integral value and displays it.

Uploaded by

Tayra Lucero
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

UNIVERSIDAD NACIONAL DE SAN AGUSTIN LABORATORIO DE PROGRAMACION Y

FIPS – E.P. DE ING. INDUSTRIAL METODOS NUMERICOS

METODOS NUMERICOS – RESOLUCION DE INTEGRALES


EN VISUAL BASIC

Module Module1

Sub Main()
Dim I, a, b, n, an, Fx, Ar, Opc As Single
Console.ForegroundColor = ConsoleColor.White
Console.BackgroundColor = ConsoleColor.DarkRed

Do
Console.Clear()
Console.SetCursorPosition(20, 1)
Console.Write("INTEGRALES")
Console.SetCursorPosition(2, 5)
Console.Write("1) Método de Rectángulos Inscritos")
Console.SetCursorPosition(2, 6)
Console.Write("2) Método de Rectángulos Circunscritos")
Console.SetCursorPosition(2, 7)
Console.Write("3) Método del Punto Medio")
Console.SetCursorPosition(2, 8)
Console.Write("4) Método Trapecial")
Console.SetCursorPosition(2, 9)
Console.Write("5) FIN")
Console.SetCursorPosition(2, 11)
Console.Write("Escoge una opción: ")
Opc = Console.ReadLine()
Select Case Opc

Case 1

Console.Clear()
I = 0
Console.SetCursorPosition(10, 5)
Console.Write("Escribe el límite inferior.(a): ")
a = Console.ReadLine
Console.SetCursorPosition(10, 7)
Console.Write("Escribe el límite superior.(b): ")
b = Console.ReadLine
Console.SetCursorPosition(10, 9)
Console.Write("Escribe el número de divisiones.(n): ")
n = Console.ReadLine
an = (b - a) / n
For x = a To (b - an) Step an
Fx = x * x
Ar = Fx * an
I = I + Ar
Next
Console.SetCursorPosition(10, 11)
Console.Write("El valor de la integral es: {0}", I)
Console.ReadLine()

Case 2

Console.Clear()
I = 0
Console.SetCursorPosition(10, 5)
Console.Write("Escribe el límite inferior.(a): ")
a = Console.ReadLine
Console.SetCursorPosition(10, 7)
Console.Write("Escribe el límite superior.(b): ")
b = Console.ReadLine

~ 1 de 4 ~ Ing° Edwin Estremadoyro Escobar


UNIVERSIDAD NACIONAL DE SAN AGUSTIN LABORATORIO DE PROGRAMACION Y
FIPS – E.P. DE ING. INDUSTRIAL METODOS NUMERICOS

Console.SetCursorPosition(10, 9)
Console.Write("Escribe el número de divisiones.(n): ")
n = Console.ReadLine
an = (b - a) / n
For x = (a + an) To b Step an
Fx = x * x
Ar = Fx * an
I = I + Ar
Next
Console.SetCursorPosition(10, 11)
Console.Write("El valor de la integral es: {0}", I)
Console.ReadLine()

Case 3

Console.Clear()
I = 0
Console.SetCursorPosition(10, 5)
Console.Write("Escribe el límite inferior.(a): ")
a = Console.ReadLine
Console.SetCursorPosition(10, 7)
Console.Write("Escribe el límite superior.(b): ")
b = Console.ReadLine
Console.SetCursorPosition(10, 9)
Console.Write("Escribe el número de divisiones.(n): ")
n = Console.ReadLine
an = (b - a) / n
For x = a + (an) / 2 To b - (an) / 2 Step an
Fx = x * x
Ar = Fx * an
I = I + Ar
Next
Console.SetCursorPosition(10, 11)
Console.Write("El valor de la integral es: {0}", I)
Console.ReadLine()

Case 4

Console.Clear()
I = 0
Console.SetCursorPosition(10, 5)
Console.Write("Escribe el límite inferior.(a): ")
a = Console.ReadLine
Console.SetCursorPosition(10, 7)
Console.Write("Escribe el límite superior.(b): ")
b = Console.ReadLine
Console.SetCursorPosition(10, 9)
Console.Write("Escribe el número de divisiones.(n): ")
n = Console.ReadLine
an = (b - a) / n
For x = a To (b - an) Step an
Fx = x * x + (x + an) * (x + an)
Ar = Fx * an / 2
I = I + Ar
Next
Console.SetCursorPosition(10, 11)
Console.Write("El valor de la integral es: {0}", I)
Console.ReadLine()
End Select
Loop While (Opc <= 5)
End Sub
End Module

~ 2 de 4 ~ Ing° Edwin Estremadoyro Escobar


UNIVERSIDAD NACIONAL DE SAN AGUSTIN LABORATORIO DE PROGRAMACION Y
FIPS – E.P. DE ING. INDUSTRIAL METODOS NUMERICOS

Menú Principal

Método de rectángulos inscritos

Método de rectángulos circunscritos

~ 3 de 4 ~ Ing° Edwin Estremadoyro Escobar


UNIVERSIDAD NACIONAL DE SAN AGUSTIN LABORATORIO DE PROGRAMACION Y
FIPS – E.P. DE ING. INDUSTRIAL METODOS NUMERICOS

Método del punto medio

Método trapecial

~ 4 de 4 ~ Ing° Edwin Estremadoyro Escobar

You might also like