Professional Documents
Culture Documents
Visual
Visual
Sub Botn1_Haga_clic_en()
Es = 0.0005
pt = 3.5
k = 0.04
x1 = 0
x2 = 0.999
fx1 = ((x1 / (1 - x1)) * ((2 * pt) / (2 + x1))
^ (1 / 2)) - k
fx2 = ((x2 / (1 - x2)) * ((2 * pt) / (2 + x2))
^ (1 / 2)) - k
If (fx1 * fx2) < 0 Then
xp = (x1 + x2) / 2
fxp = ((xp / (1 - xp)) * ((2 * pt) / (2 + xp))
^ (1 / 2)) - k
If (fx1 * fxp) > 0 Then
x1 = xp
Else
x2 = xp
End If
Else
MsgBox ("No hay una raiz en este
intervalo")
End If
xa = (x1 + x2) / 2
Er = (((xa - xp) / xa) ^ (2)) ^ (1 / 2)
While Er > Es
xp = xa
fxa = ((xp / (1 - xp)) * ((2 * pt) / (2 + xp))
^ (1 / 2)) - k
Problema 1
0.5
0.4
0.3
0.2
0.1
-0.5
-0.4
-0.3
-0.2
-0.1
0
-0.1
-0.2
-0.3
-0.4
-0.5
0.1
0.2
0.3
0.4
0.5
Problema 2
2
1
-1.3
-1.1
-0.9
-0.7
-0.5
-0.3
0
-0.1
-1
-2
-3
-4
-5
-6
-7
-8
0.1
0.3
0.5
0.7