Está en la página 1de 79

Universidad Nacional San Cristóbal de Huamanga

Facultad de Ingenierı́a de Minas, Geologı́a y Civil

Escuela de Formación Profesional de Ingenierı́a Civil

Trabajo No 01

Análisis de la Infiltración por el Método de Volúmenes


Finitos de la Presa Tintay-Sucre, Ayacucho

Curso:
Mecánica de Suelos II

Alumnos:
Cruz Heredia Julio César
Bellido Santa Cruz Natali
Ochoa Huarhuachi Edı́n

Docente:
Ing. Cristian Castro Pérez

Ayacucho - Diciembre 2009


Capı́tulo 1

Resumen

Dentro de los problemas geotécnicos, el tratamiento de los procesos de infiltra-


ción constituye un aspecto de especial interés. Estos procesos, involucran fenómenos
gobernados por formulaciones sencillas desde el punto de vista de la mecánica de
suelos saturados. Sin embargo, el análisis del fenómeno en forma exhaustiva de-
termina la necesidad de su interpretación desde la óptica de los suelos saturados
y no saturados. Las aplicaciones derivadas de estos tratamientos redundan en un
mejor conocimiento de los complejos fenómenos involucrados, permiten una mejor
compresión de las consecuencias observadas y una mayor certeza en la fijación de
recomendaciones constructivas.
El trabajo comprende: la formulación matemática, El modelamiento numérico del
fenómeno de filtración en medios porosos, en particular en problemas de filtración
en presas de tierra, gobernada por la ecuación diferencial de flujo potencial (Ec.
Laplace), programación computacional en MATLAB del modelo con el método de
volúmenes finitos MVF, para la discretizacion del domino se utiliza el pdetool de
MATLAB. La aplicacion del modelo de hace a la Presa Tintay-Morccolla de la
provincia de sucre, Ayacucho-Perú.

1
Índice general

Portada 1

1. Resumen 1

Índice general 2

Índice de figuras 4

Índice de cuadros 6

2. INTRODUCCIÓN 7

3. PLANTEAMIENTO DEL PROBLEMA 8

4. MODELACIÓN MATEMÁTICA 9
4.1. Ecuación gobernante del flujo estacionario . . . . . . . . . . . . . . . 9
4.2. Formulación del Método de Volúmenes Finitos . . . . . . . . . . . . . 11
4.2.1. Discretización en Volúmenes Finitos . . . . . . . . . . . . . . . 11
4.2.2. Generación de Malla (Gid o Mesh) . . . . . . . . . . . . . . . 12
4.2.3. Solución para Flujo Estacionario . . . . . . . . . . . . . . . . 14
4.2.3.1. Método de integración del término estacionario . . . 14
4.2.3.2. Interpolación del potencial h . . . . . . . . . . . . . 14
4.2.3.3. Derivada del potencial h . . . . . . . . . . . . . . . . 18
4.2.3.4. Integración del término estacionario . . . . . . . . . 19
4.2.3.5. Solucion . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.2.4. Calculo de variables secundarios . . . . . . . . . . . . . . . . . 25

2
4.2.4.1. Presión del agua . . . . . . . . . . . . . . . . . . . . 25
4.2.4.2. Gradiente hidráulico . . . . . . . . . . . . . . . . . . 26
4.2.4.3. Velocidad de filtración . . . . . . . . . . . . . . . . . 26
4.2.4.4. Caudal de filtración . . . . . . . . . . . . . . . . . . 26
4.2.4.5. Volumen filtrado . . . . . . . . . . . . . . . . . . . . 26

5. PROGRAMACIÓN EN MATLAB 27
5.1. Manual del Programa . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

6. MODELACIÓN DE LA PRESA TINTAY CON EL SOFTWARE


SLIDE 34
6.1. Análisis de Redes de Flujos . . . . . . . . . . . . . . . . . . . . . . . 34

7. CONCLUSIONES 41

Bibliografı́a 42

A. CODIGO DEL PROGRAMA EN MATLAB 43


A.1. Código del interfaz principal . . . . . . . . . . . . . . . . . . . . . . . 43
A.2. Código del interfaz Propiedades . . . . . . . . . . . . . . . . . . . . . 71
A.3. Código del interfaz Agua . . . . . . . . . . . . . . . . . . . . . . . . . 73
A.4. Código del interfaz Contorno . . . . . . . . . . . . . . . . . . . . . . . 74
A.5. Código del interfaz Resultados . . . . . . . . . . . . . . . . . . . . . . 75

B. PLANOS 78

3
Índice de figuras

4.1. Componentes de la velocidad de descarga en un elemento diferencial


de suelo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.2. Discretización en volúmenes finitos de un dominio bidimensional . . . 11
4.3. Generacion de malla de la presa Tintay-Sucre . . . . . . . . . . . . . 12
4.4. Generación de mallas por el método de Volúmenes Finitos . . . . . . 13
4.5. Elemento triangular . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.6. Coordenadas Locales . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

5.1. Interfaz Principal del programa . . . . . . . . . . . . . . . . . . . . . 27


5.2. Interfaz de Propiedades . . . . . . . . . . . . . . . . . . . . . . . . . . 29
5.3. Discretización de la Presa Titay . . . . . . . . . . . . . . . . . . . . . 29
5.4. Importación y visualización de las condiciones de borde . . . . . . . . 30
5.5. Condiciones de borde actualizados . . . . . . . . . . . . . . . . . . . . 30
5.6. Alturas Piezométricas-Presa Tintay . . . . . . . . . . . . . . . . . . . 31
5.7. Presiones-Presa Tintay . . . . . . . . . . . . . . . . . . . . . . . . . . 31
5.8. Velocidades-Presa Tintay . . . . . . . . . . . . . . . . . . . . . . . . . 32
5.9. Reporte de los nodos-Presa Tintay . . . . . . . . . . . . . . . . . . . 32
5.10. Reporte de los elementos-Presa Tintay . . . . . . . . . . . . . . . . . 33

6.1. Discretización en elementos finitos Caso I . . . . . . . . . . . . . . . . 36


6.2. Redes de Flujo Caso I . . . . . . . . . . . . . . . . . . . . . . . . . . 36
6.3. Gradiente Hidráulico Caso I . . . . . . . . . . . . . . . . . . . . . . . 37
6.4. Discretización en elementos finitos Caso II . . . . . . . . . . . . . . . 37
6.5. Redes de Flujo Caso II . . . . . . . . . . . . . . . . . . . . . . . . . . 38

4
6.6. Gradiente Hidráulico Caso II . . . . . . . . . . . . . . . . . . . . . . . 39
6.7. Discretización en elementos finitos Caso III . . . . . . . . . . . . . . . 39
6.8. Redes de Flujo Caso III . . . . . . . . . . . . . . . . . . . . . . . . . 40
6.9. Gradiente Hidráulico Caso III . . . . . . . . . . . . . . . . . . . . . . 40

5
Índice de cuadros

5.1. Datos basicos de la Presa Tintay . . . . . . . . . . . . . . . . . . . . 28


5.2. Propiades-Presa Tintay . . . . . . . . . . . . . . . . . . . . . . . . . . 28

6
Capı́tulo 2

INTRODUCCIÓN

Los procesos de filtración, dentro de la mecánica de los suelos, han sido tratados
durante mucho tiempo desde el punto de vista de los medios porosos continuos y
saturados. En estas condiciones, los modelos planteados resultan sencillos y basados
exclusivamente en la permeabilidad del medio. Sin embargo, la comprensión con
mayor detalle de las respuestas observadas, demanda la necesidad de inclusión de
conceptos de la mecánica de los suelos saturados y no saturados. Los suelos de la
Region Ayacucho presentan caracterı́sticas particulares, tanto desde el punto de vista
de su génesis, como en relación con su comportamiento tenso-deformacional y bajo
procesos de infiltración. En todos los casos, esta particularidad se relaciona con la
inestabilidad ante la acción de diversos agentes externos. Las caracterı́sticas propias
de los suelos de cada zona de proyecto en cualquier parte del mundo demanda la
necesidad de profundizar en el conocimiento de la respuesta de estos frente a su
utilización en distintas aplicaciones geotécnicas.
El flujo de agua en Presas de Tierra constituye uno de los casos de mayor impor-
tancia, ello se debe tanto a la importancia que la presa tiene en sı́, como estructura,
por ello es necesario realizar un análisis riguroso para este fenómeno. Hoy en dı́a
con la aparición de la computadora, que simplifica considerablemente los procesos
de cálculo, el análisis de flujo se realizará resolviendo directamente la ecuación dife-
rencial que gobierna el fenómeno fı́sico.

7
Capı́tulo 3

PLANTEAMIENTO DEL
PROBLEMA

La superficie freática del régimen de infiltración, es decir, la superficie libre, debe


mantenerse alejada del paramento aguas abajo para evitar altas presiones del agua en
los poros que puedan promover la inestabilidad del talud. En el caso extremo en que
la lı́nea de infiltración emerja en el paramento, ocurrirá ablandamiento local y erosión
y se iniciara desprendimientos. Las presiones y velocidades de infiltración también
deben controlarse para prevenir la erosión interna y la migración de partı́culas.
Sin embargo, la descripción de la infiltración en condiciones de campo, se complica
mucho en vista de que las condiciones iniciales y de contorno no son constantes y
las propiedades del suelo pueden variar en el espacio y el tiempo.
Elproceso de infiltración que es la interacción entre el suelo y la percolation
de agua por su interior, constituye la responsabilidad del ingeniero en los casos de
infiltración a través de las presas de tierra, por el terreno de fundación debajo de la
cimentación de presas de gravedad, presas de contrafuertes, presas en arco, estudio
de aguas subterráneas, en muros de contención, etc.

8
Capı́tulo 4

MODELACIÓN MATEMÁTICA

4.1. Ecuación gobernante del flujo estacionario

Consideremos el flujo de agua a través de un elemento cúbico de dimensiones


dx, dy, dz saturado de suelo localizado en el sistema de coordenadas (X, Y, Z) como
muestra en la Figura 4.5. Además como el flujo es estacionario la velocidad V con que
el agua pasa por el elemento posee tres componentes (V x, V y, V z) y no depende del
tiempo. En estas condiciones las caras por las que ingresa el agua, posee velocidades:
V x, V y, V z y en las caras por donde sale posee las siguientes velocidades:

     
∂Vx ∂Vy ∂Vz
Vx dydz + Vy dxdz + Vz dxdy = Vx + + Vy + dxdz + Vz + dxdy
∂x ∂y ∂z
(4.1)
Simplificando la Ecuación 4.1, se obtiene:

∂Vx ∂Vy ∂Vz


+ + =0 (4.2)
∂x ∂y ∂z
La Ecuación 4.2, se conoce como la Ecuación de Continuidad. Como es válida
la ley de Darcy, escribimos la velocidad en función de la conductividad hidráulica y
del gradiente hidráulico, de la siguiente manera:

∂h ∂h ∂h
Vx = −Kx Vy = −Ky Vz = −Kz (4.3)
∂x ∂y ∂z
Reemplazando la Ecuación 4.3 en 4.2, para un suelo anisotrópico tenemos:

9
Figura 4.1: Componentes de la velocidad de descarga en un elemento diferencial de
suelo

∂ 2h ∂ 2h ∂ 2h
Kx + K y + K z =0 (4.4)
∂x2 ∂y 2 ∂z 2
La Ecuación 4.4 describe matemáticamente el flujo estacionario de aguas subte-
rráneas en el estado tridimensional para un suelo anisotrópico. Pero en el modelo que
se analizará: Presa de Tierra es suficiente una aproximación bidimensional, porque
el flujo a lo largo de la Presa es muy pequeña en comparación con el Flujo en la
sección transversal. Por tal motivo en las Presas de Gravedad y de Tierra es muy
frecuente que el flujo en la dirección longitudinal se desprecie. Entonces tenemos:

∂ 2h ∂ 2h
Kx + K y =0 (4.5)
∂x2 ∂y 2
La Ecuación 4.5 describe el flujo bidimensional estacionario de suelos anisotró-
picos. Teniendo en cuenta que el gasto puede expresarse como el producto del área
de la sección por la velocidad del flujo, obtenemos:

∂h ∂h
dq = Kx dydz + Ky dxdz (4.6)
∂x ∂y2

10
4.2. Formulación del Método de Volúmenes Fini-

tos

La técnica de los volúmenes finitos se ha mostrado muy útil a la hora de desarro-


llar esquemas de alta resolución en dos dimensiones. Los volúmenes finitos permiten
discretizar el dominio con mallas irregulares, y por lo tanto adaptadas a los contor-
nos, y utiliza la formulación integral de las ecuaciones.

4.2.1. Discretización en Volúmenes Finitos

El dominio de cálculo es dividido en volúmenes de control disjuntos. Cada uno


rodea un nodo de la red.

Para obtener la ecuación discretizada se integra la ecuación diferencial sobre


cada VC. De esta manera la ED cumple el principio de conservación en un vo-
lumen finito, tal como la ec. diferencial lo cumple en un volumen infinitesimal.

Figura 4.2: Discretización en volúmenes finitos de un dominio bidimensional

11
4.2.2. Generación de Malla (Gid o Mesh)

MESH GENERATION:PRESA TINTAY

5
25

20
0

15 15
Z(msnm)

10 −5

−10

−5
−15

0 5 10 15 20 25 30 35 40 45
X(m)

Figura 4.3: Generacion de malla de la presa Tintay-Sucre

En esta sección se aplica el método de volúmenes finitos a la solución de la


ecuación (3.12), deducida en el capitulo 3, la misma que se presenta en la sección
3.3.1, página 52

   
∂ ∂h ∂ ∂h ∂h
Kx + Ky = mw γ +Q (4.7)
∂x ∂x ∂y ∂y ∂t
Esta misma ecuación se puede expresar en la forma vectorial

∂h
div(k∇h) = λ +Q
∂t

∂h
λ = div(k∇h) − Q (4.8)
∂t
Donde:
λ = mw γ

12
PRESIONES Y VELOCIDAD DEL FLUJO:PRESA TINTAY

25
4

20 2

0
15

−2
12
Z(msnm)

10
−4

5 −6

−8
0

−10

−5
−12

0 5 10 15 20 25 30 35 40 45 50
X(m)

Figura 4.4: Generación de mallas por el método de Volúmenes Finitos

∂ ∂
div = ∂x
+ ∂y
∂ ∂
∇= ∂x
+ ∂y

k = (kx , ky )
Integrando la Ecuación 4.8 sobre un intervalo de tiempo t y el volumen de control
V c se tiene:

Z Z Z Z Z Z
∂h
λ dV dt = (div(k∇h))dV dt − QdV dt
∆t ∆V c ∂t ∆t ∆V c ∆t ∆V c

Z
∂h
(∆t)(∆V )λ = ∆t (div(k∇h))dV − (∆t)(∆V )Q
∂t Vc

Z
∂h
∆V λ = (div(k∇h))dV − ∆V Q (4.9)
| {z ∂t} | Vc
{z
| {z }
} T ermino f uente
T ermino transitorio T ermino estacionario

13
4.2.3. Solución para Flujo Estacionario

En esta parte de la solución no se toma en cuenta la variación del tiempo por lo


∂h
que se asume ∂t
= 0 y la Ecuación 4.9 queda reducido en la forma siguiente:

Z
(div(k∇h))dV − ∆V Q = 0 (4.10)
Vc

El termino fuente ∆V Q es referido al fuente potencial que hace posible el flu-


jo que en nuestro caso se ve solamente afectado por la altura piezométrica h, la
cual que se incorporara como condiciones de contorno en determinados nodos de la
discretización.

4.2.3.1. Método de integración del término estacionario

Aplicando el Teorema de divergencia de Gauss, la integral volumétrica de la


Ecuación 4.10 es igual a la integral de supervise en el volumen de control, la cual es
como sigue para el termino estacionario


−→−
Z Z
(div(k∇h))dV = F N dS (4.11)
Vc Sc

Donde:


F = kx ∂h
∂x
+ kz ∂h
∂z


N : Es el vector normal a la superficie dirigido hacia afuera

4.2.3.2. Interpolación del potencial h

Los valores de h son almacenados en los vertices de los elementos triangulares,


haciéndose necesarios el establecimiento de una función de interpolación para h,
tal función de interpolación debe ser suponiendo conocido el h en los vertices de
los triángulos, y ası́ permitir el calculo de h y de sus derivadas en cualquier punto
dentro del elemento triangular. En especial en los valores de las derivadas de h serán
necesario en los puntos t y r, conforme se muestra en la Figura 4.7. De este modo
la función de interpolación para h sea lineal.

14
3(X3,Z3)

ñ(Xñ,Zñ)

n(Xn,Zn)
t
o

r
2(X2,Z2)

m(Xm,Zm)

1(X1,Z1)

Figura 4.5: Elemento triangular

h = ax + bz + c (4.12)

Ahora calculando los valores de a, b y c a partir de la interpolación h1 , h2 y h3


en los vertices 1, 2 y 3 conocidos supuestamente.

h1 = ax1 + bz1 + c

h2 = ax2 + bz2 + c

h3 = ax3 + bz3 + c

En su forma matricial sera.

    
x z 1 a h
 1 1    1 
 x2 z2 1   b  =  h2 
    
    
x3 z3 1 c h3
Por algebra lineal

15
   −1  
a x1 z1 1 h1
     
= (4.13)
     
 b   x2 z2 1   h2 
     
c x3 z3 1 h3
Sea:  
x1 z1 1
 
A =  x2 z2 1 
 
 
x3 z3 1
Reemplazando en la Ecuación 4.13

   
a h
   1 
 b  = A−1  h2  (4.14)
   
   
c h3
Invirtiendo la matriz A por método de la adjunta

adjA
A−1 = (4.15)
detA
Primero se calculará la determinante

 
x1 z1 1
 
detA = det  x2 z2 1  = x1 (z2 − z3 ) − z1 (x2 − x3 ) + (x2 z3 − x3 z2 )
 
 
x3 z3 1

Multiplicando y ordenando

detA = x1 z2 + x2 z3 + x3 z1 − z1 x2 − z2 x3 − z3 x1 (4.16)

La adjunta de A queda determinado ası́:

 
a11 a12 a13
 
adjA =  a21 a22 a23 (4.17)
 

 
a31 a32 a33
Siendo:

16

z2 1


a11 = + = (1z1 − 1z2 ) = (z1 − z2 )

z3 1

x2 1


a21 = − = −(1x2 − 1x3 ) = (x3 − x2 )

x3 1

x2 z2


a31 = + = (x2 z3 − x3 z2 )

x3 z3

z1 1


a12 = − = −(1z1 − 1z3 ) = (z3 − z1 )

z3 1

x1 1


a22 = + = (1x1 − 1x3 ) = (x1 − x3 )

x3 1

x1 z1


a32 = − = −(x1 z3 − x3 z1 ) = (x3 z1 − x1 z3 )

x3 z3

z1 1


a13 = + = (1z1 − 1z2 ) = (z1 − z2 )

z2 1

x1 1


a23 = − = −(1x1 − 1x3 ) = (x3 − x1 )

x3 1

x1 z1


a33 = + = (x1 z2 − x2 z1 )

x2 z2

Reemplazando en la Ecuación 4.17

   
a a a (z1 − z2 ) (z3 − z1 ) (z1 − z2 )
 11 12 13   
adjA =  a21 a22 a23 = (x3 − x2 ) (x1 − x3 ) (x3 − x1 )
   

   
a31 a32 a33 (x2 z3 − x3 z2 ) (x3 z1 − x1 z3 ) (x1 z2 − x2 z1 )

Reemplazando la adjunta y determinante de la matriz A en la Ecuacion 4.15

 
(z1 − z2 ) (z3 − z1 ) (z1 − z2 )
 
(x3 − x2 ) (x1 − x3 ) (x3 − x1 )
 
 
 
adjA (x2 z3 − x3 z2 ) (x3 z1 − x1 z3 ) (x1 z2 − x2 z1 )
A−1 = =
detA x1 (z2 − z3 ) − z1 (x2 − x3 ) + (x2 z3 − x3 z2 )

17
Matriz inversa A−1

 
(z1 − z2 ) (z3 − z1 ) (z1 − z2 )
1  
A−1 = = (x3 − x2 ) (x1 − x3 ) (x3 − x1 ) (4.18)
 
detA 


(x2 z3 − x3 z2 ) (x3 z1 − x1 z3 ) (x1 z2 − x2 z1 )

Reemplazando 4.18 en 4.14 calculamos los valores de a, b y c

      
a h1 (z1 − z2 ) (z3 − z1 ) (z1 − z2 ) h1
    1   
 b  = A−1  h2  =  (x3 − x2 ) (x1 − x3 ) (x3 − x1 )
      
  h2 
    detA   
c h3 (x2 z3 − x3 z2 ) (x3 z1 − x1 z3 ) (x1 z2 − x2 z1 ) h3
(4.19)
Sea detA = det, desarrollando 4.19 resultan los valores para las constantes a b y
c

(z2 − z3 )h1 + (z3 − z1 )h2 + (z1 − z2 )h3


a= (4.20)
det

(x3 − x2 )h1 + (x1 − x3 )h2 + (x2 − x1 )h3


b= (4.21)
det

(x2 z3 − x3 z2 )h1 + (x3 z1 − x1 z3 )h2 + (x1 z2 − x2 z1 )h3


c= (4.22)
det

4.2.3.3. Derivada del potencial h

La función vectorial representa el flujo estacionario y esta dado por la ecuación


− ∂h ∂h
F = kx + kz (4.23)
∂x ∂z
El gradiente hidráulico de flujo subterráneo es negativo

18
 
dh
Vd = ki = k −
dx
Por lo tanto la ecuación vectorial 4.23 resulta.

   

− ∂h ∂h
F = kx − + kz −
∂x ∂z

   

− ∂h ∂h
F = −kx − kz (4.24)
∂x ∂z
De las Ecuaciones 4.20, 4.21 y 4.22 determinamos las derivadas de h respecto a
las posiciones x y z.
∂h ∂(ax + bz + c)
= =a
∂x ∂x
(4.25)
∂h ∂(ax + bz + c)
= =b
∂z ∂z
Reemplazando 4.25 en 4.24 se tiene:



F = −akx − bkz

Haciendo

fx = −akx
(4.26)
fz = −bkz


Por lo tanto el vector F queda definida como



F = fx + fz

4.2.3.4. Integración del término estacionario

Interpolación geométrica en los puntos medios del triángulo Geométricamente


de la Figura 5.10 determinamos las coordenadas de los puntos m, nyn, comenzando
por la coordenada del punto m

x2 − x1 2x1 + x2 − x1 x1 + x2
xm = x1 + = =
2 2 2

19
3(X3,Z3)

ñ(Xñ,Zñ)

n(Xn,Zn)
t
o

r
2(X2,Z2)

m(Xm,Zm)

1(X1,Z1)

Figura 4.6: Coordenadas Locales

Entonces

x1 + x2
xm =
2
Análogamente se determina el resto de las coordenadas

x1 + x2 z1 + z2
xm = ; zm =
2 2
x1 + x3 z1 + z3
xn = ; zn = (4.27)
2 2
x2 + x3 z2 + z3
xn̄ = ; zn̄ =
2 2
Integrando el termino estacionario nodo por nodo en el elemento triangular
formado por los puntos 123, Figura 5.10, que representa un elemento i dentro de
un enmallado triangular del dominio.
Integración en el nudo 1
Flujo que atraviesa por la cara mo

−fx (zm − zo ) + fz (xm − xo ) = fx (zo − zm ) + fz (xm − xo )

20
Flujo que atraviesa por la cara on

fx (zn − zo ) − fz (xn − xo ) = fx (zn − zo ) + fz (xo − xn )

A partir de la ecuación 4.11, la integral del termino estacionario toma la siguiente


forma

n o n

−→− →
−→− →
−→− →
−→−
Z Z Z Z
F N dS = F N dS = F N dS + F N dS
Sc m m o
o

−→−
Z
F N dS = fx (zo − zm ) + fz (xm − xo )
Zm n

−→−
F N dS = fx (zn − zo ) + fz (xo − xn )
o
Por lo tanto

n o n

−→− →
−→− →
−→−
Z Z Z
F N dS = F N dS + F N dS = fx (zn − zm ) + fz (xm − xn )
m m o

n

−→−
Z
F N dS = fx (zn − zm ) + fz (xm − xn )
m

Reemplazando los términos fx y fz de la ecuación 4.26

n

−→−
Z
F N dS = −akx (zn − zm ) − bkz (xm − xn )
m
n

−→−
Z
F N dS = akx (zm − zn ) + bkz (xn − xm ) (4.28)
m

Reemplazando las ecuaciones 4.20 y 4.21 en 4.28 se determina la ecuación de


interpolación del potencial h

n  

−→− (z2 − z3 )h1 + (z3 − z1 )h2 + (z1 − z2 )h3
Z
F N dS = kx (zm − zn )
m det
 
(x3 − x2 )h1 + (x1 − x3 )h2 + (x2 − x1 )h3
+kz (xn − xm )
det
Z n  

−→− (z2 − z3 )(zm − zn )h1 + (z3 − z1 )(zm − zn )h2 + (z1 − z2 )(zm − zn )h3
F N dS = kx
m det
 
(x3 − x2 )(xn − xm )h1 + (x1 − x3 )(xn − xm )h2 + (x2 − x1 )(xn − xm )h3
+kz
det

21
n

−→−
Z
F N dS =
m
1
[kx (z2 − z3 )(zm − zn ) + kz (x3 − x2 )(xn − xm )] h1 +
|det {z }
D11
1 (4.29)
[kx (z3 − z1 )(zm − zn ) + kz (x1 − x3 )(xn − xm )] h2 +
|det {z }
D12
1
[kx (z1 − z2 )(zm − zn ) + kz (x2 − x1 )(xn − xm )] h3
|det {z }
D13

Para llevar en funcion de las coordenadas del elemento triangular reemplazaremos


la Ecuación 4.27 en 4.29

n

−→−
Z
F N dS =
m
1
[kx (z2 − z3 )(z2 − z3 ) + kz (x3 − x2 )(x3 − x2 )] h1 +
|2det {z }
D11
1
[kx (z3 − z1 )(z2 − z3 ) + kz (x1 − x3 )(x3 − x2 )] h2 +
2det
| {z }
D12
1
[kx (z1 − z2 )(z2 − z3 ) + kz (x2 − x1 )(x3 − x2 )] h3
|2det {z }
D13

Expresando de forma más compacta

n

−→−
Z
F N dS = D11 h1 + D12 h2 + D13 h3 (4.30)
m

De forma similar tenemos para los nodos 2 y 3


Integración en el nudo 2

22
n

−→−
Z
F N dS =
m
1
[kx (z2 − z3 )(z3 − z1 ) + kz (x3 − x2 )(x1 − x3 )] h1 +
|2det {z }
D21
1
[kx (z3 − z1 )(z3 − z1 ) + kz (x1 − x3 )(x1 − x3 )] h2 +
|2det {z }
D22
1
[kx (z1 − z2 )(z3 − z1 ) + kz (x2 − x1 )(x1 − x3 )] h3
|2det {z }
D23

Expresando de forma más compacta

m

−→−
Z
F N dS = D21 h1 + D22 h2 + D23 h3 (4.31)

Integración en el nudo 3

n

−→−
Z
F N dS =
m
1
[kx (z2 − z3 )(z1 − z2 ) + kz (x3 − x2 )(x2 − x1 )] h1 +
|2det {z }
D31
1
[kx (z3 − z1 )(z1 − z2 ) + kz (x1 − x3 )(x2 − x1 )] h2 +
|2det {z }
D32
1
[kx (z1 − z2 )(z1 − z2 ) + kz (x2 − x1 )(x2 − x1 )] h3
2det
| {z }
D33

Expresando de forma más compacta



−→−
Z
F N dS = D31 h1 + D32 h2 + D33 h3 (4.32)
n

Integración para cada elemento i


Resumiendo las integrales en los nudos 1, 2 y 3 tenemos los coeficientes

23
1
D11 = [kx (z2 − z3 )(z2 − z3 ) + kz (x3 − x2 )(x3 − x2 )]h1
2det
1
D12 = [kx (z3 − z1 )(z2 − z3 ) + kz (x1 − x3 )(x3 − x2 )]h2
2det
1
D13 = [kx (z1 − z2 )(z2 − z3 ) + kz (x2 − x1 )(x3 − x2 )]h3
2det
1
D21 = [kx (z2 − z3 )(z3 − z1 ) + kz (x3 − x2 )(x1 − x3 )]h1
2det
1
D22 = [kx (z3 − z1 )(z3 − z1 ) + kz (x1 − x3 )(x1 − x3 )]h2
2det
1
D23 = [kx (z1 − z2 )(z3 − z1 ) + kz (x2 − x1 )(x1 − x3 )]h3
2det
1
D31 = [kx (z2 − z3 )(z1 − z2 ) + kz (x3 − x2 )(x2 − x1 )]h1
2det
1
D32 = [kx (z3 − z1 )(z1 − z2 ) + kz (x1 − x3 )(x2 − x1 )]h2
2det
1
D33 = [kx (z1 − z2 )(z1 − z2 ) + kz (x2 − x1 )(x2 − x1 )]h3
2det

Formando un sistema de ecuaciones para el elemento triangular 123


Z n 

−→−
F N dS = D11 h1 + D12 h2 + D13 h3
m
Z m 1

−→−
F N dS = D21 h1 + D22 h2 + D23 h3 (4.33)
Zn̄ n̄ 2

−→−
F N dS = D31 h1 + D32 h2 + D33 h3
n 3

En forma matricial   
D11 D12 D13 h1
  
(4.34)
  
 D21 D22 D23   h2 
  
D31 D32 D33 h3

4.2.3.5. Solucion

Recordando

Z
(div(k∇h))dV − ∆V Q = 0 (4.35)
Vc

La ecuación 4.34 representa la solución del primer termino de la ecuación 4.35

24
  
D11 D12 D13 h1
  
  h2  = ∆V Q (4.36)
  
 D21 D22 D23
  
D31 D32 D33 h3

En forma compacta

Di hi = Qi (4.37)

Donde:
Di : Matriz de propiedades
hi : Vector de alturas piezometricas
Qi : Vector de condiciones de borde
Solución general o completa del problema

Dh = Q (4.38)

Donde:
Di : Matriz de propiedades para todo el dominio
hi : Vector de alturas piezométricas en todo los nodos de la discretizacion
Qi : Vector de condiciones de borde en los nodos de la discretizacion

Entonces la solucion sera

h = D−1 Q (4.39)

4.2.4. Calculo de variables secundarios

4.2.4.1. Presión del agua

P = µw = γ(h − z) (4.40)

25
4.2.4.2. Gradiente hidráulico

∂h ∂(ax + bz + c)
= = −a
∂x ∂x
(4.41)
∂h ∂(ax + bz + c)
= = −b
∂z ∂z
Siendo:

(z2 − z3 )h1 + (z3 − z1 )h2 + (z1 − z2 )h3


a= (4.42)
det

(x3 − x2 )h1 + (x1 − x3 )h2 + (x2 − x1 )h3


b= (4.43)
det

 
x z 1
 1 1 
det = det  x2 z2 1  = x1 (z2 − z3 ) − z1 (x2 − x3 ) + (x2 z3 − x3 z2 )
 
 
x3 z3 1

4.2.4.3. Velocidad de filtración

fx = −akx
(4.44)
fz = −bkz

4.2.4.4. Caudal de filtración

Teniendo la velocidad de filtración, el caudal de filtración es la multiplicación de


la velocidad de filtración por el area de la sección de filtración.

4.2.4.5. Volumen filtrado

A partir del conocimiento de los caudales de filtración para cada sección de


presa analizada, mediante una sumatoria simple se determina el caudal de filtración
en todo el contorno de la presa, multiplicando este ultimo por el tiempo en que se
quiera determinar se obtiene el volumen filtrado

26
Capı́tulo 5

PROGRAMACIÓN EN MATLAB

Se ha implementado un programa de computo basado en el método de Volúmenes


Finitos en el interfaz gráfica de usuario GUIDE de MATLAB.

5.1. Manual del Programa

Para describir el funcionamiento de nuestro programa llamado INFILTRACIÓN,


resolveremos el problema de infiltración de la Presa de Tintay, Sucre-Ayacucho

Figura 5.1: Interfaz Principal del programa

27
Cuadro 5.1: Datos basicos de la Presa Tintay

Ubicación Rı́o Durasnachayoc


Tipo de Presa Presa de Tierra en Relleno Homogéneo
Función Embalse de Regulación Horaria
Volumen de almacenamiento máximo 82,000 m3
Altura Útil 10 m
Altura total de la presa 13 m
Altura al NAMO 11.5 m
Borde Libre 1.5m
Ancho de Coronación 3m
Longitud de la base 44.6m
Espesor del medio poroso a anlizar 4m
Talud aguas arriba y abajo 1V:1.6H

Cuadro 5.2: Propiades-Presa Tintay

Cohesion Angulo K
Cuerpo 18 33 0.00000001
Basamiento 0 45 0.0000000001
Filtro 8 25 0.01

28
Figura 5.2: Interfaz de Propiedades

Figura 5.3: Discretización de la Presa Titay

29
CONDICIONES
3 DE BORDE
18
5 4
1 0

16

14

12
4 2

1 0 1 0

10
Z(m)

6
8 9
7 6 3 2
0 1 0 1
4
5 1

1 0 1 0
2
6 7
8 9 1
1 0 1 0
0
0 10 20 30 40 50 60
X(m)

Figura 5.4: Importación y visualización de las condiciones de borde

Figura 5.5: Condiciones de borde actualizados

30
ALTURAS PIEZOMETRICAS:PRESA TINTAY

11

25
10

20 9

15
7

12
Z(msnm)

10 6

5
5
4

0 3

2
−5
1

0 5 10 15 20 25 30 35 40 45 50
X(m)

Figura 5.6: Alturas Piezométricas-Presa Tintay

PRESIONES:PRESA TINTAY

25
4

20 2

0
15

−2
12
Z(msnm)

10
−4

5 −6

−8
0

−10

−5
−12

0 5 10 15 20 25 30 35 40 45 50
X(m)

Figura 5.7: Presiones-Presa Tintay

31
PRESIONES Y VELOCIDAD DEL FLUJO:PRESA TINTAY

25
4

20 2

0
15

−2
12
Z(msnm)

10
−4

5 −6

−8
0

−10

−5
−12

0 5 10 15 20 25 30 35 40 45 50
X(m)

Figura 5.8: Velocidades-Presa Tintay

Figura 5.9: Reporte de los nodos-Presa Tintay

32
Figura 5.10: Reporte de los elementos-Presa Tintay

33
Capı́tulo 6

MODELACIÓN DE LA PRESA
TINTAY CON EL SOFTWARE
SLIDE

6.1. Análisis de Redes de Flujos

Se ha elaborado las redes de flujo con la ayuda del Software SLIDE versión 5, en
este se han utilizado las siguientes 3 consideraciones:

Se van elaborar en tres diferentes casos las redes de flujo y se va encontrar un


diferente valor del gradiente hidráulico.

Primer caso cuando asumimos que la geomembrana fallo, pero no consideramos


el uso del filtro.

Segundo caso cuando asumimos que la geomembrana fallo y el agua se filtra


directamente a través de la presa y llega al filtro, este es el caso más desfavora-
ble, debido a que el filtro acorta el recorrido del agua pero, como vimos antes
en la estabilidad de taludes ayuda a la estabilidad del talud aguas abajo.

Tercer caso cuando consideramos todas las consideraciones que se están plan-
teando a la presa, el uso de la geomembrana, ası́ como el dentellón, y también
el filtro.

34
Configuración de datos de la modelación con el programa SLIDE:
Slide Analysis Information
Document Name
File Name: tintay
Project Settings
Project Title: Presa Tintay
Failure Direction: Right to Left
Units of Measurement: SI Units
Pore Fluid Unit Weight: 9.81 kN/m3
Groundwater Method: Finite Element Analysis
Tolerance (groundwater): 1e-006
Maximum number of iterations (groundwater): 500
Data Output: Maximum
Random Numbers: Pseudo-random Seed
Random Number Seed: 10116
Random Number Generation Method: Park and Miller v.3
Groundwater Analysis
Maximum Number of Iterations: 500
Iteration Tolerance: 1e-006
Mesh Element Type: 3 noded triangles
Number of Elements: 1714
Number of Nodes: 917
Material Properties
Material: Cuerpo
Ks: 1e-008
K2/K1: 1
K Angle: 0
Model: Simple
Material: Basamiento
Ks: 1e-0010

35
K2/K1: 1
K Angle: 0
Model: Simple
Material: Filtro
Ks: 1e-002
K2/K1: 1
K Angle: 0
Model: Simple

Figura 6.1: Discretización en elementos finitos Caso I

Figura 6.2: Redes de Flujo Caso I

36
Figura 6.3: Gradiente Hidráulico Caso I

Figura 6.4: Discretización en elementos finitos Caso II

Ahora debemos controlar el sifonamiento que se pueda presentar en la presa. El


sifonamiento se produce cuando se logra una velocidad lo suficientemente alta, como
para que presión de infiltración puede cancelar el esfuerzo efectivo en su totalidad;
en otras palabras el esfuerzo de corte del suele será cero, debido a que el es esfuerzo
efectivo y la presión de infiltración son iguales, considerando este efecto podemos
encontrar la longitud del recorrido del agua en la cual se producirá este efecto de
sifonamiento:

37
Figura 6.5: Redes de Flujo Caso II

τ = σt − U = 0

σt = U

γp hp = (h + Lc )γw

1.7.13 = (11.5 + Lc )1

Lc = 10.6m

Calculada esta longitud que llamamos critica, podemos encontrar con esta lon-
gitud el gradiente hidráulico que seria el crı́tico, y viendo las gráficas anteriores
podemos encontrar el factor de seguridad para cada caso:

h 11.5
ic = = = 1.08
Lc 17.1
CASO I

ic 1.08
FS = = = 1.81
i 0.60
CASO II

ic 1.08
FS = = = 1.66
i 0.65
CASO III

38
Figura 6.6: Gradiente Hidráulico Caso II

Figura 6.7: Discretización en elementos finitos Caso III

ic 1.08
FS = = = 2.84
i 0.38
Como podemos apreciar todos los factores de seguridad nos dan mayores a la
unidad pero el mas importante es el caso 3, porque ese es el caso en el que trabajara
la presa, pero aun fallando la cara de concreto y el filtro que se encuentra en el talud
aguas arriba de la presa, no se presentará el fenómeno de sifonamiento.

39
Figura 6.8: Redes de Flujo Caso III

Figura 6.9: Gradiente Hidráulico Caso III

40
Capı́tulo 7

CONCLUSIONES

El modelo numérico desarrollado e implementado permite simular el movimien-


to del flujo de agua debajo de una presa de tierra y conocer el valor del vector
velocidad en cualquier punto de la lı́nea de corriente, ası́ mismo la distribución
de equipotenciales (lı́neas de igual carga Hidráulica).

El método de Volúmenes Finitos son una herramienta muy poderosa en el


análisis de todo tipo de estructuras y son simples de programar en el caso
bidimensional y bidimensional cuando se utilizan funciones de forma lineales.

Dentro de la formulación del método de volúmenes finitos con mallas no es-


tructuradas, el método de la medianas tiene mayores facilidades en cuanto a la
sistematización de datos, aunque tiene mayor complejidad en la formulación,
respecto a otros métodos como el diagrama de Voronoi.

Haciendo la comparación entre los resultados del modelamiento de la Presa


de Tintay Sucre con el programa SLIDE v.5 que utiliza una formulación por
elementos finitos y por nuestro programa INFILTRACIÓN, que utiliza una
formulación por volúmenes finitos, se puede afirmar que ambas metodológicas
son valida y los resultados tienen una ligera variación.

41
Bibliografı́a

[1] E. B. CASTELLET. Tesis Doctoral: ”Modelacion del flujo en lamina libre sobre
cauces naturales. Analisis integrado con esquemas en volumenes finitos en una y
dos dimensiones. Universidad politecnica de Cataluñia - E. T. S. Ingenieros de
caminos, canales y puertos, 2005.

[2] T. R. CHANDRUPATLA and A. D. BELEGUNDO. Introduccion al metodo del


elemento finito. Prentice Hall, segunda edicion, 1999.

[3] S. C. CHAPRA and R. P. CANALE. Metodos numericos para ingenieros(Quinta


edicion). Mc Graw Hill., 2007.

[4] S. MOAVENI. Finite Element Analysis - Theory and aplication with ANSYS.
Minnessota State University, Mankat, 1999.

[5] CRISTIAN CATRO PEREZ. Apuntes de Clase: Mecánica de suelos II. Univer-
sidad Nacional San Cristóbal de Huamanga-UNSCH, Diciembre-2009.

[6] ISAÍAS A. VILCA TUEROS. Modelamiento numérico de infiltración en presas


con el método de volúmenes finitos: caso presa cuchoquesera/Ayacucho. Univer-
sidad Nacional San Cristóbal de Huamanga-UNSCH, Setiembre-2009.

[7] O. C. ZIENKIEWICZ and R. L. TAYLOR. El metodo de los elementos finitos -


Volumen II (Meccanica de solidos y fuidos, dinamica y no linealidad. Mc Graw-
Hill, cuarta edicion, 1994.

42
Apéndice A

CODIGO DEL PROGRAMA EN


MATLAB

A.1. Código del interfaz principal

1 f u n c t i o n v a r a r g o u t = INFILTRACION( v a r a r g i n )
2 gui Singleton = 1;
3 g u i S t a t e = struct ( ’ gui Name ’ , mfilename , ...
4 ’ gui Singleton ’ , gui Singleton , ...
5 ’ gui OpeningFcn ’ , @INFILTRACION OpeningFcn , ...
6 ’ gui OutputFcn ’ , @INFILTRACION OutputFcn , ...
7 ’ gui LayoutFcn ’ , [] , ...
8 ’ gui Callback ’ , []) ;
9 i f n a r g i n && i s c h a r ( v a r a r g i n { 1 } )
10 g u i S t a t e . gui Callback = s t r 2 f u n c ( varargin {1}) ;
11 end
12 i f nargout
13 [ varargout {1: nargout } ] = gui mainfcn ( gui State , varargin { : } ) ;
14 else
15 gui mainfcn ( gui State , varargin {:}) ;
16 end
17 f u n c t i o n INFILTRACION OpeningFcn ( hObject , eve ntda ta , h a n d l e s , v a r a r g i n )
18 s c r s z=g e t ( 0 , ’ s c r e e n s i z e ’ ) ;
19 pa=g e t ( g c f , ’ p o s i t i o n ’ ) ;

43
20 xr=s c r s z ( 3 )−pa ( 3 ) ;
21 xp=round ( xr / 2 ) ;
22 yr=s c r s z ( 4 )−pa ( 4 ) ;
23 yp=round ( yr / 2 ) ;
24 s e t ( g c f , ’ p o s i t i o n ’ , [ 0 yp pa ( 3 ) pa ( 4 ) ] ) ;
25 g lo ba l idenMalla
26 i d e n M a l l a =1;
27 h a n d l e s . output = hObject ;
28 g u i d a t a ( hObject , h a n d l e s ) ;
29 f u n c t i o n v a r a r g o u t = INFILTRACION OutputFcn ( hObject , e ven tda ta , h a n d l e s
)
30 v a r a r g o u t {1} = h a n d l e s . output ;
31 f u n c t i o n u i p u s h t o o l 1 C l i c k e d C a l l b a c k ( hObject , eve ntda ta , h a n d l e s )
32 meshgeneration
33 function meshgeneration
34 [ p d e f i g , ax ]= p d e i n i t ;
35 pdetool ( ’ appl cb ’ , 1 ) ;
36 p d e t o o l ( ’ snapon ’ , ’ on ’ ) ;
37 s e t ( ax , ’ DataAspectRatio ’ , [ 1 0 . 5 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 8 1 ] ) ;
38 s e t ( ax , ’ PlotBoxAspectRatio ’ , [ 5 0 3 3 . 3 3 3 3 3 3 3 3 3 3 3 3 3 3 6 1 ] ) ;
39 XG=l i n s p a c e ( 0 , 5 5 , 5 6 ) ;
40 YG=l i n s p a c e ( 0 , 2 0 , 2 1 ) ;
41 Xmax=max(XG)
42 Ymax=max(YG)
43 s e t ( ax , ’ XLim ’ , [ 0 Xmax ] ) ;
44 s e t ( ax , ’ YLim ’ , [ 0 Ymax ] ) ;
45 s e t ( ax , ’ XTick ’ ,XG) ;
46 s e t ( ax , ’ YTick ’ ,YG) ;
47 p d e t o o l ( ’ g r i d o n ’ , ’ on ’ ) ;
48 s e t ( f i n d o b j ( g e t ( p d e f i g , ’ C h i l d r e n ’ ) , ’ Tag ’ , ’ PDEEval ’ ) , ’ S t r i n g ’ , ’ DIBUJE
EL DOMINO DE LA PRESA’ )
49 pdeseteq ( 1 , ’ 1 . 0 ’ , ’ 0 . 0 ’ , ’ 1 0 . 0 ’ , ’ 1 . 0 ’ , ’ 0 : 1 0 ’ , ’ 0 . 0 ’ , ’ 0 . 0 ’ , ’ [ 0 100] ’)
50 s e t a p p d a t a ( p d e f i g , ’ currparam ’ , [ ’ 1 . 0 ’; ’0.0 ’; ’10.0 ’; ’1.0 ’])
51 s e t a p p d a t a ( p d e f i g , ’ solveparam ’ , . . .
52 s t r 2 m a t ( ’ 0 ’ , ’ 1 0 0 0 ’ , ’ 1 0 ’ , ’ pdeadworst ’ , . . .
53 ’ 0 . 5 ’ , ’ l o n g e s t ’ , ’ 0 ’ , ’ 1 E− 4 ’ , ’ ’ , ’ fixed ’ , ’ I n f ’ ) )

44
54 setappdata ( pde fig , ’ p l o t f l a g s ’ , [ 1 1 1 1 1 1 1 1 0 0 0 1 1 0 0 0 0 1 ] ) ;
55 setappdata ( pde fig , ’ c o l s t r i n g ’ , ’ ’ ) ;
56 setappdata ( pde fig , ’ arrowstring ’ , ’ ’ ) ;
57 setappdata ( pde fig , ’ deformstring ’ , ’ ’ ) ;
58 setappdata ( pde fig , ’ heightstring ’ , ’ ’ ) ;
59 f u n c t i o n U n t i t l e d 1 C a l l b a c k ( hObject , e ven tda ta , h a n d l e s )
60 f u n c t i o n U n t i t l e d 2 C a l l b a c k ( hObject , e ven tda ta , h a n d l e s )
61 f u n c t i o n U n t i t l e d 3 C a l l b a c k ( hObject , e ven tda ta , h a n d l e s )
62 f u n c t i o n U n t i t l e d 4 C a l l b a c k ( hObject , e ven tda ta , h a n d l e s )
63 f u n c t i o n U n t i t l e d 5 C a l l b a c k ( hObject , e ven tda ta , h a n d l e s )
64 f u n c t i o n U n t i t l e d 6 C a l l b a c k ( hObject , e ven tda ta , h a n d l e s )
65 f u n c t i o n U n t i t l e d 7 C a l l b a c k ( hObject , e ven tda ta , h a n d l e s )
66 meshgeneration
67 f u n c t i o n U n t i t l e d 8 C a l l b a c k ( hObject , e ven tda ta , h a n d l e s )
68 g l o b a l RE
69 RE=1;
70 Resultados
71 f u n c t i o n U n t i t l e d 9 C a l l b a c k ( hObject , e ven tda ta , h a n d l e s )
72 g l o b a l RE
73 RE=2;
74 Resultados
75 f u n c t i o n U n t i t l e d 1 0 C a l l b a c k ( hObject , e ve ntda ta , h a n d l e s )
76 APIEZOMETRICAS
77 f u n c t i o n U n t i t l e d 1 1 C a l l b a c k ( hObject , e ve ntda ta , h a n d l e s )
78 PRESIONES
79 f u n c t i o n U n t i t l e d 1 2 C a l l b a c k ( hObject , e ve ntda ta , h a n d l e s )
80 VELOCIDADES
81 f u n c t i o n u i p u s h t o o l 7 C l i c k e d C a l l b a c k ( hObject , eve ntda ta , h a n d l e s )
82 g l o b a l Xi Xf Z
83 u i o p e n ( ’LOAD’ )
84 s a v e dat
85 xc=(Xi+Xf ) /2
86 NS=Z
87 figure
88 l i n e ( [ Xi Xf ] , [ NS NS ] , ’ L i n e S t y l e ’ , ’ − ’ )
89 l i n e ( [ xc ∗ 0 . 9 8 xc ∗ 1 . 0 2 ] , [ NS∗ 0 . 9 9 9 NS ∗ 0 . 9 9 9 ] , ’ L i n e S t y l e ’ , ’ − ’ )

45
90 l i n e ( [ xc ∗ 0 . 9 9 xc ∗ 1 . 0 1 ] , [ NS∗ 0 . 9 9 8 NS ∗ 0 . 9 9 8 ] , ’ L i n e S t y l e ’ , ’ − ’ )
91 t e x t ( xc , NS∗ 1 . 0 0 1 , i n t 2 s t r (NS) , ’ FontSize ’ , 7 )
92 Restaurar
93 f u n c t i o n U n t i t l e d 1 3 C a l l b a c k ( hObject , e ve ntda ta , h a n d l e s )
94 f u n c t i o n U n t i t l e d 1 4 C a l l b a c k ( hObject , e ve ntda ta , h a n d l e s )
95 f u n c t i o n U n t i t l e d 1 5 C a l l b a c k ( hObject , e ve ntda ta , h a n d l e s )
96 g l o b a l Ap
97 Ap=0;
98 Propiedades ;
99 f u n c t i o n U n t i t l e d 1 6 C a l l b a c k ( hObject , e ve ntda ta , h a n d l e s )
100 Contorno
101 f u n c t i o n U n t i t l e d 1 7 C a l l b a c k ( hObject , e ve ntda ta , h a n d l e s )
102 Agua
103 f u n c t i o n u i p u s h t o o l 8 C l i c k e d C a l l b a c k ( hObject , eve ntda ta , h a n d l e s )
104 g l o b a l Acb
105 Acb=1;
106 Contorno
107 f u n c t i o n u i p u s h t o o l 9 C l i c k e d C a l l b a c k ( hObject , eve ntda ta , h a n d l e s )
108 g l o b a l Ap
109 Ap=1;
110 Propiedades
111 f u n c t i o n u i p u s h t o o l 1 0 C l i c k e d C a l l b a c k ( hObject , ev entd a ta , h a n d l e s )
112 EJECUTAR
113 f u n c t i o n EJECUTAR
114 EJECUTAR1
115 EJECUTAR2
116 msgbox ( ’EJECUCION FINALIZADA CON EXITO’ , ’ FELICIDADES ’ ) ;
117 f u n c t i o n u i p u s h t o o l 1 1 C l i c k e d C a l l b a c k ( hObject , ev entd a ta , h a n d l e s )
118 PRESIONES
119 f u n c t i o n PRESIONES
120 g l o b a l i d e n i d e n M a l l a Xi Xf CC
121 xc=(Xi+Xf ) / 2 ;
122 NV=(CC( : , 3 : 4 ) )
123 NS=max(NV) ;
124 NS=max(NS) ;
125 close ( figure (1) )

46
126 s c r s z = get (0 , ’ ScreenSize ’ ) ;
127 f i g u r e ( ’ P o s i t i o n ’ , [ 0 0 s c r s z ( 3 ) s c r s z ( 4 ) ] , ’ Name ’ , ’ P r e s i o n e s ’ , ’
NumberTitle ’ , ’ o f f ’ ) ;
128 figure (1)
129 l i n e ( [ Xi Xf ] , [ NS NS ] , ’ L i n e S t y l e ’ , ’ − ’ )
130 l i n e ( [ xc ∗ 0 . 9 8 xc ∗ 1 . 0 2 ] , [ NS∗ 0 . 9 9 9 NS ∗ 0 . 9 9 9 ] , ’ L i n e S t y l e ’ , ’ − ’ )
131 l i n e ( [ xc ∗ 0 . 9 9 xc ∗ 1 . 0 1 ] , [ NS∗ 0 . 9 9 8 NS ∗ 0 . 9 9 8 ] , ’ L i n e S t y l e ’ , ’ − ’ )
132 t e x t ( xc , NS∗ 1 . 0 0 1 , i n t 2 s t r (NS) , ’ FontSize ’ , 7 )
133 i d e n =2;
134 COLORBAR
135 x l a b e l ( ’X(m) ’ ) ;
136 y l a b e l ( ’ Z (msnm) ’ ) ;
137 set ( figure (1) , ’ color ’ , ’ c ’ ) ;
138 f u n c t i o n u i p u s h t o o l 1 3 C l i c k e d C a l l b a c k ( hObject , ev entd a ta , h a n d l e s )
139 g l o b a l RE
140 RE=1;
141 Resultados
142 f u n c t i o n u i p u s h t o o l 1 6 C l i c k e d C a l l b a c k ( hObject , ev entd a ta , h a n d l e s )
143 g l o b a l RE
144 RE=2;
145 Resultados
146 f u n c t i o n u i p u s h t o o l 1 7 C l i c k e d C a l l b a c k ( hObject , ev entd a ta , h a n d l e s )
147 msgbox ( ’ S i t i e n e a l g u n a duda , comuniquese inmediatamente con l o s
a u t o r e s ’ , ’ HELP’ )
148 f u n c t i o n u i p u s h t o o l 1 2 C l i c k e d C a l l b a c k ( hObject , ev entd a ta , h a n d l e s )
149 APIEZOMETRICAS
150 f u n c t i o n APIEZOMETRICAS
151 g l o b a l i d e n i d e n M a l l a CC Xi Xf
152 xc=(Xi+Xf ) / 2 ;
153 NV=(CC( : , 3 : 4 ) )
154 NS=max(NV) ;
155 NS=max(NS) ;
156 close ( figure (1) )
157 s c r s z = get (0 , ’ ScreenSize ’ ) ;
158 f i g u r e ( ’ P o s i t i o n ’ , [ 0 0 s c r s z ( 3 ) s c r s z ( 4 ) ] , ’ Name ’ , ’ A l t u r a s P i e z o m e t r i c a s
’ , ’ NumberTitle ’ , ’ o f f ’ ) ;

47
159 figure (1)
160 l i n e ( [ Xi Xf ] , [ NS NS ] , ’ L i n e S t y l e ’ , ’ − ’ )
161 l i n e ( [ xc ∗ 0 . 9 8 xc ∗ 1 . 0 2 ] , [ NS∗ 0 . 9 9 9 NS ∗ 0 . 9 9 9 ] , ’ L i n e S t y l e ’ , ’ − ’ )
162 l i n e ( [ xc ∗ 0 . 9 9 xc ∗ 1 . 0 1 ] , [ NS∗ 0 . 9 9 8 NS ∗ 0 . 9 9 8 ] , ’ L i n e S t y l e ’ , ’ − ’ )
163 t e x t ( xc , NS∗ 1 . 0 0 1 , i n t 2 s t r (NS) , ’ FontSize ’ , 7 )
164 i d e n =1;
165 COLORBAR
166 x l a b e l ( ’X(m) ’ ) ;
167 y l a b e l ( ’ Z (msnm) ’ ) ;
168 set ( figure (1) , ’ color ’ , ’ c ’ ) ;
169 f u n c t i o n U n t i t l e d 1 8 C a l l b a c k ( hObject , e ve ntda ta , h a n d l e s )
170 g lo ba l idenMalla
171 i d e n M a l l a =2;
172 f u n c t i o n U n t i t l e d 1 9 C a l l b a c k ( hObject , e ve ntda ta , h a n d l e s )
173 g lo ba l idenMalla
174 i d e n M a l l a =1;
175 f u n c t i o n u i p u s h t o o l 1 8 C l i c k e d C a l l b a c k ( hObject , ev entd a ta , h a n d l e s )
176 VELOCIDADES
177 f u n c t i o n VELOCIDADES
178 g l o b a l i d e n i d e n M a l l a Xi Xf CC
179 xc=(Xi+Xf ) / 2 ;
180 NV=(CC( : , 3 : 4 ) )
181 NS=max(NV) ;
182 NS=max(NS) ;
183 close ( figure (1) )
184 s c r s z = get (0 , ’ ScreenSize ’ ) ;
185 f i g u r e ( ’ P o s i t i o n ’ , [ 0 0 s c r s z ( 3 ) s c r s z ( 4 ) ] , ’ Name ’ , ’ V e l o c i d a d e s ’ , ’
NumberTitle ’ , ’ o f f ’ ) ;
186 figure (1)
187 l i n e ( [ Xi Xf ] , [ NS NS ] , ’ L i n e S t y l e ’ , ’ − ’ )
188 l i n e ( [ xc ∗ 0 . 9 8 xc ∗ 1 . 0 2 ] , [ NS∗ 0 . 9 9 9 NS ∗ 0 . 9 9 9 ] , ’ L i n e S t y l e ’ , ’ − ’ )
189 l i n e ( [ xc ∗ 0 . 9 9 xc ∗ 1 . 0 1 ] , [ NS∗ 0 . 9 9 8 NS ∗ 0 . 9 9 8 ] , ’ L i n e S t y l e ’ , ’ − ’ )
190 t e x t ( xc , NS∗ 1 . 0 0 1 , i n t 2 s t r (NS) , ’ FontSize ’ , 7 )
191 i d e n =3;
192 COLORBAR
193 x l a b e l ( ’X(m) ’ ) ;

48
194 y l a b e l ( ’ Z (msnm) ’ ) ;
195 set ( figure (1) , ’ color ’ , ’ c ’ ) ;
196 f u n c t i o n U n t i t l e d 2 0 C a l l b a c k ( hObject , e ve ntda ta , h a n d l e s )
197 EJECUTAR
198 f u n c t i o n U n t i t l e d 2 1 C a l l b a c k ( hObject , e ve ntda ta , h a n d l e s )
199 close ( figure (1) )
200 f i g u r e ( ’ Name ’ , ’AUTORES’ , ’ NumberTitle ’ , ’ o f f ’ ) ;
201 figure (1)
202 t e x t ( 0 . 0 7 , 0 . 7 , ’CRUZ HEREDIA, J u l i o César ’ , ’ FontSize ’ , 2 0 , ’ FontWeight ’ , ’
bold ’ )
203 t e x t ( 0 . 0 7 , 0 . 5 5 , ’ BELLIDO SANTA CRUZ, N á t a l i ’ , ’ FontSize ’ , 2 0 , ’ FontWeight
’ , ’ bold ’ )
204 t e x t ( 0 . 0 7 , 0 . 4 , ’OCHOA HUARHUACHI, Edı́n ’ , ’ FontSize ’ , 2 0 , ’ FontWeight ’ , ’ bold
’)
205 axis off
206 c o l o r b a r ( ’ l o c a t i o n ’ , ’ s o u t h o u t s i d e ’ , ’ YTickLabel ’ , { ’ J u l i o César ’ , ’ N á t a l i
’ , ’ Edı́n ’ } )
207 set ( figure (1) , ’ color ’ , ’ y ’ ) ;
208 f u n c t i o n COLORBAR
209 g lo ba l iden idenMalla
210 load Htotal −ASCII
211 load Presion −ASCII
212 l o a d Vx −ASCII
213 l o a d Vy −ASCII
214 l o a d xc −ASCII
215 l o a d yc −ASCII
216 Vx=Vx ’ ;
217 Vy=Vy ’ ;
218 xc=xc ’ ;
219 yc=yc ’ ;
220 i f i d e n==1
221 PHI=H t o t a l ;
222 TITULO=’ALTURAS PIEZOMETRICAS :PRESA TINTAY’
223 e l s e i f i d e n==2
224 PHI=P r e s i o n ;
225 TITULO=’PRESIONES :PRESA TINTAY’

49
226 e l s e i f i d e n==3
227 PHI=P r e s i o n ;
228 TITULO=’PRESIONES Y VELOCIDAD DEL FLUJO :PRESA TINTAY’
229 end
230 l o a d dat
231 NODES=p ’ ;
232 t=t ’ ; t ( : , 4 ) = [ ] ;
233 NP=t ;
234 e=e ’ ;
235 NUMNP = s i z e (NODES, 1 ) ;
236 NUMEL = s i z e (NP, 1 ) ;
237 NNPE = 3;
238 NODES( : , 3 ) = [ 0 ] ;
239 f o r i =1:NUMNP
240 b=0;h=0;
241 fo r j =1: s i z e ( e , 1 ) ;
242 i f i==e ( j , 1 )
243 b=i ;
244 h=e ( j , 5 ) ;
245 end
246 end
247 i f b==i
248 NODES( i , 3 )=h ;
249 end
250 end
251 NODES;
252 XMAX = NODES( 1 , 1 ) ;
253 XMIN = XMAX;
254 YMAX = NODES( 1 , 2 ) ;
255 YMIN = YMAX;
256 f o r I =1:NUMNP
257 XORD( I )=NODES( I , 1 ) ;
258 YORD( I )=NODES( I , 2 ) ;
259 NPBC( I )=NODES( I , 3 ) ;
260 i f XORD( I ) > XMAX
261 XMAX = XORD( I ) ;

50
262 e l s e i f XORD( I ) < XMIN
263 XMIN = XORD( I ) ;
264 end
265 i f YORD( I ) > YMAX
266 YMAX = YORD( I ) ;
267 e l s e i f YORD( I ) < YMIN
268 YMIN = YORD( I ) ;
269 end
270 end
271 c l e a r NODES
272 c l e a r MESHo
273 c l e a r NPA
274 i f NNPE == 3
275 NSIDES=3;
276 NTRIAG=1;
277 NPA=[1 2 3 1 ] ;
278 e l s e i f NNPE == 6
279 NSIDES=3;
280 NTRIAG=4;
281 NPA = [ 1 2 6 1 2 3 4 2 4 5 6 4 2 4 6 2 ] ;
282 e l s e i f NNPE == 4
283 NSIDES=3;
284 NTRIAG=4;
285 NPA = [ 4 1 0 4 1 2 0 1 2 3 0 2 3 4 0 3 ] ;
286 e l s e i f NNPE == 8
287 NSIDES=3;
288 NTRIAG=8;
289 NPA= [ 0 1 2 0 0 2 3 0 0 3 4 0 0 4 5 0 ...
290 0 5 6 0 0 6 7 0 0 7 8 0 0 8 1 0 ];
291 end
292 i f i d e n M a l l a==1
293 imsh = ’ ’ ;
294 e l s e i f i d e n M a l l a==2
295 imsh =’y ’ ;
296 end
297 i c n t r =6;

51
298 if icntr > 0
299 pMax=PHI ( 1 ) ;
300 pMin=pMax ;
301 fo r i =2:NUMNP
302 i f PHI ( i ) > pMax
303 pMax=PHI ( i ) ;
304 end
305 i f PHI ( i ) < pMin
306 pMin=PHI ( i ) ;
307 end
308 end
309 nc = icntr ;
310 dc = (pMax−pMin ) / nc ;
311 n = f i x ( l o g 1 0 ( dc ) ) ;
312 mfc = 10ˆ(1 −n ) ;
313 dc = f i x ( dc ∗ mfc ) ;
314 dca = dc / mfc ;
315 end
316 c o l r =’y ’ ;
317 isym=0 ;
318 i f isym < 0
319 isym == 0 ;
320 e l s e i f isym > 3
321 isym == 0 ;
322 end
323 h o l d on
324 axis equal
325 i f isym == 1 | isym == 3
326 YMIN = −YMAX;
327 end
328 i f isym == 2 | isym == 3
329 XMIN = −XMAX;
330 end
331 xmin = XMIN − 0 . 0 1 ∗ (XMAX−XMIN) ;
332 xmax = XMAX + 0 . 0 1 ∗ (XMAX−XMIN) ;
333 ymin = YMIN − 0 . 0 1 ∗ (YMAX−YMIN) ;

52
334 ymax = YMAX + 0 . 0 1 ∗ (YMAX−YMIN) ;
335 PropertyName ={’ Color ’ } ;
336 Pro p ertyV a lue ={’w ’ } ;
337 H = l i n e ( [ xmin xmax xmax xmin ] , [ ymin ymin ymax ymax ] ) ;
338 s e t (H, PropertyName , Pro p ertyV a lue )
339 i f c o l r == ’ y ’
340 fo r J =1:NUMEL
341 xave = 0 ;
342 yave = 0 ;
343 pave = 0 ;
344 f o r K=1:NNPE
345 xave = xave + XORD(NP( J ,K) ) ;
346 yave = yave + YORD(NP( J ,K) ) ;
347 pave = pave + PHI (NP( J ,K) ) ;
348 end
349 xave = xave /NNPE;
350 yave = yave /NNPE;
351 pave = pave /NNPE;
352 for K=1:NTRIAG
353 f o r L=1:4
354 NL = NPA( (K−1)∗4+L) ;
355 i f NL == 0
356 xp (L) = xave ;
357 yp (L) = yave ;
358 pp (L) = pave ;
359 else
360 NLP=NP( J , NL) ;
361 xp (L)=XORD(NLP) ;
362 yp (L)=YORD(NLP) ;
363 pp (L)= PHI (NLP) ;
364 end
365 end
366 c l e a r gg
367 i f c o l r == ’ y ’
368 gg = pp ;
369 else

53
370 gg = [ 0 . 7 1 0 . 7 ] ;
371 end
372 f i l l ( xp , yp , gg )
373 i f isym == 1 | isym == 3
374 f i l l ( xp,−yp , gg )
375 end
376 i f isym == 2 | isym == 3
377 f i l l (−xp , yp , gg )
378 end
379 i f isym == 3
380 f i l l (−xp,−yp , gg )
381 end
382 end
383 end
384 i f c o l r == ’ y ’
385 colorbar ( ’ vert ’ )
386 end
387 shading i n t e r p
388 end
389 if icntr > 0
390 clear H
391 nL = 0 ;
392 fo r J =1:NUMNP
393 PHIp ( J ) = PHI ( J ) ∗ mfc ;
394 end
395 fo r J =1:NUMEL
396 xave = 0 ;
397 yave = 0 ;
398 pave = 0 ;
399 f o r K=1:NNPE
400 xave = xave + XORD(NP( J ,K) ) ;
401 yave = yave + YORD(NP( J ,K) ) ;
402 pave = pave + PHIp (NP( J ,K) ) ;
403 end
404 xave = xave /NNPE;
405 yave = yave /NNPE;

54
406 pave = pave /NNPE;
407 JNP=NP( J , 1 ) ;
408 cmin=PHIp (JNP) ;
409 cmax=cmin ;
410 f o r K=1:NNPE
411 KNP=NP( J ,K) ;
412 i f PHIp (KNP) < cmin
413 cmin=PHIp (KNP) ;
414 end
415 i f PHIp (KNP) > cmax
416 cmax=PHIp (KNP) ;
417 end
418 end
419 i f cmin < pMin∗ mfc ;
420 cmin = pMin∗ mfc ;
421 end
422 i f cmax > pMax∗ mfc ;
423 cmax = pMax∗ mfc ;
424 end
425 n=f l o o r ( cmin / dc ) −1;
426 C=n∗ dc ;
427 while C <= cmax
428 clear x y
429 for K=1:NTRIAG
430 J3 =0;
431 for L=1:NSIDES
432 L0=(K−1) ∗ (NSIDES+1)+L ;
433 L1=NPA( L0 ) ;
434 L2=NPA( L0+1) ;
435 i f L1 ˜= 0
436 L1 =NP( J , L1 ) ;
437 XL1=XORD( L1 ) ;
438 YL1=YORD( L1 ) ;
439 PL1=PHIp ( L1 ) ;
440 else
441 XL1=xave ;

55
442 YL1=yave ;
443 PL1=pave ;
444 end
445 i f L2 ˜= 0
446 L2 =NP( J , L2 ) ;
447 XL2=XORD( L2 ) ;
448 YL2=YORD( L2 ) ;
449 PL2=PHIp ( L2 ) ;
450 else
451 XL2=xave ;
452 YL2=yave ;
453 PL2=pave ;
454 end
455 SLOPE=PL2−PL1 ;
456 PT=−100;
457 i f abs (SLOPE) ˜= 0
458 PT=(C−PL1 ) /SLOPE ;
459 end
460 i f PT >= 0 & PT < 1
461 J3=J3 +1;
462 x ( J3 )=XL1+PT∗ (XL2−XL1) ;
463 y ( J3 )=YL1+PT∗ (YL2−YL1) ;
464 e l s e i f SLOPE == 0
465 i f PL1 == C
466 J3=J3 +1;
467 x ( J3 )=XL1 ;
468 y ( J3 )=YL1 ;
469 J3=J3 +1;
470 x ( J3 )=XL2 ;
471 y ( J3 )=YL2 ;
472 end
473 end
474 end
475 i f J3 >= 2
476 nL=nL+1;
477 H( nL ) = l i n e ( x , y ) ;

56
478 i f isym == 1 | isym == 3
479 nL=nL+1;
480 H( nL ) = l i n e ( x,−y ) ;
481 end
482 i f isym == 2 | isym == 3
483 nL=nL+1;
484 H( nL ) = l i n e (−x , y ) ;
485 end
486 if isym == 3
487 nL=nL+1;
488 H( nL ) = l i n e (−x,−y ) ;
489 end
490 end
491 end
492 C=C+dc ;
493 end
494 end
495 i f c o l r == ’ y ’
496 PropertyName ={’ Color ’ } ;
497 Pro p ertyV a lue ={’w ’ } ;
498 else
499 PropertyName ={’ Color ’ } ;
500 Pro p ertyV a lue ={’ r ’ } ;
501 end
502 s e t (H, PropertyName , Pro pe rtyV a lue )
503 end
504 clear H
505 clear rot
506 nL=0;
507 i f NNPE == 3 ;
508 nS=3;
509 pS=2;
510 r o t =[1 2 3 1 2 ] ;
511 end
512 i f NNPE == 4
513 nS=4;

57
514 pS=2;
515 r o t =[1 2 3 4 1 2 ] ;
516 end
517 i f NNPE == 6
518 nS=3;
519 pS=3;
520 r o t =[1 2 3 4 5 6 1 2 ] ;
521 end
522 i f NNPE == 8
523 nS=4;
524 pS=3;
525 r o t =[1 2 3 4 5 6 7 8 1 2 ] ;
526 end
527 f o r I =1:NUMNP
528 sA ( I ) = 0 . 0 ;
529 LpN( I ) =0;
530 end
531 f o r I =1:NUMEL
532 fo r J =2:NNPE+1
533 no =NP( I , r o t ( J ));
534 na =NP( I , r o t ( J−1) ) ;
535 nb =NP( I , r o t ( J+1) ) ;
536 LpN( no )=LpN( no ) +1;
537 a ( 1 )=XORD( na )−XORD( no ) ;
538 a ( 2 )=YORD( na )−YORD( no ) ;
539 b ( 1 )=XORD( nb )−XORD( no ) ;
540 b ( 2 )=YORD( nb )−YORD( no ) ;
541

542 aa=a ( 1 ) ∗ a ( 1 )+a ( 2 ) ∗ a ( 2 ) ;


543 bb=b ( 1 ) ∗b ( 1 )+b ( 2 ) ∗b ( 2 ) ;
544 ab=a ( 1 ) ∗b ( 1 )+a ( 2 ) ∗b ( 2 ) ;
545

546 ang=a c o s ( ab/ s q r t ( aa ∗bb ) ) ;


547 sA ( no )=sA ( no )+ang ;
548 end
549 end

58
550 A t e s t =2∗pi −1.0 e −06;
551 clear H
552 nL=0;
553 f o r I =1:NUMEL
554 fo r J =1:NNPE
555 r 1=r o t ( J ) ;
556 r 2=r o t ( J+1) ;
557 JP1=NP( I , r 1 ) ;
558 JP2=NP( I , r 2 ) ;
559 i f sA ( JP1 ) < A t e s t
560 i f sA ( JP2 ) < A t e s t
561 nL=nL+1;
562 Hx( nL , 1 ) = XORD( JP1 ) ;
563 Hx( nL , 2 ) = XORD( JP2 ) ;
564 Hy( nL , 1 ) = YORD( JP1 ) ;
565 Hy( nL , 2 ) = YORD( JP2 ) ;
566 end
567 end
568 end
569 end
570 f o r I =1:nL−1
571 x11=Hx( I , 1 ) ;
572 x12=Hx( I , 2 ) ;
573 y11=Hy( I , 1 ) ;
574 y12=Hy( I , 2 ) ;
575 fo r J=I +1:nL
576 x21=Hx( J , 1 ) ;
577 x22=Hx( J , 2 ) ;
578 y21=Hy( J , 1 ) ;
579 y22=Hy( J , 2 ) ;
580 i f x11 == x22 & x12 == x21 . . .
581 & y11 == y22 & y12 == y21
582 Hx( I , 1 ) = XMIN;
583 Hx( I , 2 ) = XMIN;
584 Hy( I , 1 ) = YMIN;
585 Hy( I , 2 ) = YMIN;

59
586 Hx( J , 1 ) = XMIN;
587 Hx( J , 2 ) = XMIN;
588 Hy( J , 1 ) = YMIN;
589 Hy( J , 2 ) = YMIN;
590 end
591 end
592 end
593 f o r I =1:nL
594 x1=Hx( I , 1 ) ;
595 x2=Hx( I , 2 ) ;
596 y1=Hy( I , 1 ) ;
597 y2=Hy( I , 2 ) ;
598 i f isym == 1 | isym == 3
599 i f y1 == 0 & y2 == 0
600 Hx( I , 1 ) = XMIN;
601 Hx( I , 2 ) = XMIN;
602 Hy( I , 1 ) = 0 ;
603 Hy( I , 2 ) = 0 ;
604 end
605 end
606 i f isym == 2 | isym == 3
607 i f x1 == 0 & x2 == 0
608 Hx( I , 1 ) = 0 ;
609 Hx( I , 2 ) = 0 ;
610 Hy( I , 1 ) = YMIN;
611 Hy( I , 2 ) = YMIN;
612 end
613 end
614 end
615 f o r I =1:nL
616 l i n e (Hx( I , : ) ,Hy( I , : ) , ’ Color ’ , ’ k ’ , ’ LineWidth ’ , 2 )
617 end
618 i f isym == 1 | isym == 3
619 fo r I =1:nL
620 l i n e (Hx( I , : ) ,−Hy( I , : ) , ’ Color ’ , ’ k ’ , ’ LineWidth ’ , 2 )
621 end

60
622 end
623 i f isym == 2 | isym == 3
624 fo r I =1:nL
625 l i n e (−Hx( I , : ) ,Hy( I , : ) , ’ Color ’ , ’ k ’ , ’ LineWidth ’ , 2 )
626 end
627 end
628 i f isym == 3
629 fo r I =1:nL
630 l i n e (−Hx( I , : ) ,−Hy( I , : ) , ’ Color ’ , ’ k ’ , ’ LineWidth ’ , 2 )
631 end
632 end
633 i f imsh == ’ y ’
634 clear H
635 nL=0;
636 fo r I =1:NUMEL
637 f o r J =1:NNPE
638 r 1=r o t ( J ) ;
639 r 2=r o t ( J+1) ;
640 JP1=NP( I , r 1 ) ;
641 JP2=NP( I , r 2 ) ;
642 nL=nL+1;
643 H( nL )=l i n e ( [XORD( JP1 ) XORD( JP2 ) ] , [YORD( JP1 ) YORD( JP2 ) ] ) ;
644 end
645 end
646 s e t (H, ’ Color ’ , ’ k ’ , ’ LineWidth ’ , 1 )
647 end
648 i f i d e n==3
649 q u i v e r ( xc , yc , Vx , Vy)
650 end
651 t i t l e (TITULO)
652 hold o f f
653 g r i d on
654 clear
655 f u n c t i o n EJECUTAR1
656 global kz kx e s NODE ELEMENT CONTOUR x1 x2 x3 y1 y2 y3 V1x V2x V3x V1y
V2y V3y

61
657 g l o b a l CC Kxz Di S1 S2 S3 w d e t Ae r s 1 r s 2 r s 3 Hf NN indCC Rnodo
658 CCnudos ( s i z e (CC, 1 ) , 2 ) = [ 0 ] ;
659 l o a d dat
660 es =1.0;
661 NODE=p ’ ; ELEMENT=t ’ ; CONTOUR=e ’ ;
662 NODE( : , 3 : 1 3 ) = [ 0 ] ;
663 f o r i =1: s i z e (CC, 1 )
664 nb=i ;
665 v=1;
666 fo r j =1: s i z e (CONTOUR, 1 )
667 i f CONTOUR( j , 5 )==nb
668 i f v==1
669 CCnudos ( i , v )= CONTOUR( j , 1 ) ;
670 CCnudos ( i , v+1)= CONTOUR( j , 2 ) ;
671 v=v+1;
672 else
673 i f CCnudos ( i , v )== CONTOUR( j , 1 )
674 CCnudos ( i , v )= CONTOUR( j , 1 ) ;
675 CCnudos ( i , v+1)= CONTOUR( j , 2 ) ;
676 v=v+1;
677 else
678 CCnudos ( i , v+1)= CONTOUR( j , 1 ) ;
679 CCnudos ( i , v+2)= CONTOUR( j , 2 ) ;
680 v=v+2;
681 end
682 end
683 end
684 end
685 end
686 f o r i =1: s i z e (CC, 1 )
687 fo r j =1: s i z e ( CCnudos , 2 )
688 i f CCnudos ( i , j ) ˜=0
689 n j=CCnudos ( i , j ) ;
690 i f CC( i , 3 ) ˜=0
691 NODE( nj , 3 )=CC( i , 3 ) ;
692 end

62
693 i f CC( i , 4 ) ˜=0
694 NODE( nj , 3 )=CC( i , 4 ) ;
695 end
696 NODE( nj , 5 )= NODE( nj , 5 )+CC( i , 5 ) ;
697 NODE( nj , 6 )= NODE( nj , 6 )+CC( i , 6 ) ;
698 NODE( nj , 7 )= NODE( nj , 7 )+CC( i , 7 ) ;
699 NODE( nj , 8 )=i ;
700 end
701 end
702 end
703 f o r i =1: s i z e (NODE, 1 )
704 i f NODE( i , 3 ) ˜=0
705 nb= NODE( i , 8 ) ;
706 n1=CC( nb , 1 ) ;
707 n2=CC( nb , 2 ) ;
708 x1= NODE( n1 , 1 ) ; x2= NODE( n2 , 1 ) ;
709 y1= NODE( n1 , 2 ) ; y2= NODE( n2 , 2 ) ;
710 H1=CC( nb , 3 ) ; H2=CC( nb , 4 ) ;
711 i f x1==x2
712 a=(H2−H1) / ( y2−y1 ) ;
713 b=H1−a ∗ y1 ;
714 y= NODE( i , 2 ) ;
715 Ho=a∗y+b ;
716 else
717 a=(H2−H1) / ( x2−x1 ) ;
718 b=H1−a ∗ x1 ;
719 x= NODE( i , 1 ) ;
720 Ho=a∗x+b ;
721 end
722 i f Ho˜=0
723 NODE( i , 3 )=Ho ;
724 NODE( i , 4 ) =0;
725 end
726 end
727 i f NODE( i , 5 )==1
728 NODE( i , 5 ) =0;

63
729 else
730 NODE( i , 5 ) =1;
731 end
732 i f NODE( i , 6 ) ==1;
733 NODE( i , 6 ) =0;
734 else
735 NODE( i , 6 ) =1;
736 end
737 end
738 NE=s i z e (ELEMENT, 1 ) ;
739 NN=s i z e (NODE, 1 ) ;
740 Nbordes=s i z e (CONTOUR, 1 ) ;
741 Qi=z e r o s (NN, 1 ) ;
742 D=z e r o s (NN) ;
743 Qi ( : , 1 )= NODE( : , 3 )
744 f o r i =1:NE
745 n1= ELEMENT( i , 1 ) ; n2= ELEMENT( i , 2 ) ; n3= ELEMENT( i , 3 ) ; M a t e r i a l=
ELEMENT( i , 4 ) ;
746 x1= NODE( n1 , 1 ) ; x2= NODE( n2 , 1 ) ; x3= NODE( n3 , 1 ) ;
747 y1= NODE( n1 , 2 ) ; y2= NODE( n2 , 2 ) ; y3= NODE( n3 , 2 ) ;
748 kx=Kxz ( M a t e r i a l , 1 )
749 kx=s t r 2 d o u b l e ( kx )
750 kz=Kxz ( M a t e r i a l , 2 )
751 kz=s t r 2 d o u b l e ( kz )
752 V1x= NODE( n1 , 5 ) ; V2x= NODE( n2 , 5 ) ; V3x= NODE( n3 , 5 ) ;
753 V1y= NODE( n1 , 6 ) ; V2y= NODE( n2 , 6 ) ; V3y= NODE( n3 , 6 ) ;
754 i f NODE( n1 , 3 ) ˜=0
755 S1= NODE( n1 , 3 ) / NODE( n1 , 3 ) ;
756 else
757 S1= NODE( n1 , 3 ) ;
758 end
759 i f NODE( n2 , 3 ) ˜=0
760 S2= NODE( n2 , 3 ) / NODE( n2 , 3 ) ;
761 else
762 S2= NODE( n2 , 3 ) ;
763 end

64
764 i f NODE( n3 , 3 ) ˜=0
765 S3= NODE( n3 , 3 ) / NODE( n3 , 3 ) ;
766 else
767 S3= NODE( n3 , 3 ) ;
768 end
769 integral
770 De=z e r o s (NN) ;
771 De ( n1 , n1 )=Di ( 1 , 1 ) ; De ( n1 , n2 )=Di ( 1 , 2 ) ; De ( n1 , n3 )=Di ( 1 , 3 ) ;
772 De ( n2 , n1 )=Di ( 2 , 1 ) ; De ( n2 , n2 )=Di ( 2 , 2 ) ; De ( n2 , n3 )=Di ( 2 , 3 ) ;
773 De ( n3 , n1 )=Di ( 3 , 1 ) ; De ( n3 , n2 )=Di ( 3 , 2 ) ; De ( n3 , n3 )=Di ( 3 , 3 ) ;
774 D=D+De ;
775 end
776 D;
777 Qi ;
778 Qf=z e r o s (NN, 1 ) ;
779 f o r i =1:NN
780 i f Qi ( i , 1 ) ˜=0
781 f o r f =1:NN
782 Qf ( f , 1 )=Qf ( f , 1 )−Qi ( i , 1 ) ∗D( f , i ) ;
783 end
784 end
785 end
786 Qf ;
787 v=0;
788 f o r i =1:NN
789 i f Qi ( i , 1 ) ˜=0
790 D( i −v , : ) = [ ] ;
791 D( : , i −v ) = [ ] ;
792 Qf ( i −v , : ) = [ ] ;
793 v=v+1;
794 end
795 end
796 D1=i n v (D) ;
797 H=D1∗Qf ;
798 v=1;
799 c l e a r Hf

65
800 Hf ( 1 , 1 ) = [ 0 ] ;
801 f o r i =1:NN
802 i f Qi ( i , 1 ) ˜=0
803 Hf ( i , 1 )=Qi ( i , 1 ) ;
804 else
805 Hf ( i , 1 )=H( v , 1 ) ;
806 v=v+1;
807 end
808 end
809 Hf ;
810 P r e s i o n=Hf ( : , 1 )− NODE( : , 2 ) ;
811 nodos = 1 : 1 :NN;
812 nodos=nodos ’ ;
813 Rnodo=nodos ;
814 Rnodo ( : , 2 : 3 )= NODE( : , 1 : 2 ) ;
815 Rnodo ( : , 4 )=Hf ( : , 1 ) ;
816 Rnodo ( : , 5 )=P r e s i o n ( : , 1 ) ;
817 H t o t a l=Hf ’ ;
818 P r e s i o n=P r e s i o n ’ ;
819 s a v e H t o t a l H t o t a l −ASCII
820 s a v e P r e s i o n P r e s i o n −ASCII
821 s a v e Rnodo Rnodo −ASCII
822 f u n c t i o n EJECUTAR2
823 global kz kx e s NODE ELEMENT CONTOUR x1 x2 x3 y1 y2 y3 V1x V2x V3x V1y
V2y V3y
824 g l o b a l Kxz Dxi Dyi S1 S2 S3 w d e t Ae r s 1 r s 2 r s 3 Hf NN indCC CC Relem
825 CCnudos ( 2 , 1 ) = [ 0 ] ;
826 l o a d dat
827 load Htotal
828 H=H to tal ’
829 es =1.0;
830 NODE=p ’ ; ELEMENT=t ’ ; CONTOUR=e ’ ;
831 NODE( : , 3 : 1 3 ) = [ 0 ] ;
832 NE=s i z e (ELEMENT, 1 ) ;
833 NN=s i z e (NODE, 1 ) ;
834 x=z e r o s (NE, 1 ) ;

66
835 y=z e r o s (NE, 1 ) ;
836 Vx=z e r o s (NE, 1 ) ;
837 Vy=z e r o s (NE, 1 ) ;
838 V=z e r o s (NE, 1 ) ;
839 Dx=z e r o s (NE, 1 ) ;
840 Dy=z e r o s (NE, 1 ) ;
841 D=z e r o s (NE, 1 ) ;
842 f o r i =1: NE
843 n1= ELEMENT( i , 1 ) ; n2= ELEMENT( i , 2 ) ; n3= ELEMENT( i , 3 ) ; M a t e r i a l=
ELEMENT( i , 4 ) ;
844 x1= NODE( n1 , 1 ) ; x2= NODE( n2 , 1 ) ; x3= NODE( n3 , 1 ) ;
845 y1= NODE( n1 , 2 ) ; y2= NODE( n2 , 2 ) ; y3= NODE( n3 , 2 ) ;
846 h1=H( n1 , 1 ) ; h2=H( n2 , 1 ) ; h3=H( n3 , 1 ) ;
847 kx=Kxz ( M a t e r i a l , 1 )
848 kx=s t r 2 d o u b l e ( kx )
849 kz=Kxz ( M a t e r i a l , 2 )
850 kz=s t r 2 d o u b l e ( kz )
851 x ( i , 1 ) =(x1+x2+x3 ) / 3 ;
852 y ( i , 1 ) =(y1+y2+y3 ) / 3 ;
853 d e t =(x1 ∗ y2+x2 ∗ y3+x3 ∗y1−y1 ∗x2−y2 ∗x3−y3 ∗ x1 ) ;
854 a =(( y2−y3 ) ∗h1+(y3−y1 ) ∗h2+(y1−y2 ) ∗h3 ) / d e t ;
855 b=(( x3−x2 ) ∗h1+(x1−x3 ) ∗h2+(x2−x1 ) ∗h3 ) / d e t ;
856 Vx( i , 1 )=−a ∗kx ;
857 Vy( i , 1 )=−b∗ kz ;
858 V( i , 1 ) =(Vx( i , 1 ) ˆ2+Vy( i , 1 ) ˆ 2 ) ˆ 0 . 5 ;
859 Dx( i , 1 )=−b ;
860 Dy( i , 1 )=−b ;
861 D( i , 1 ) =(Dx( i , 1 ) ˆ2+Dy( i , 1 ) ˆ 2 ) ˆ 0 . 5 ;
862 Relem ( i , 1 )=i ;
863 end
864 xc=x ’ ;
865 yc=y ’ ;
866 Vx=Vx ’ ;
867 Vy=Vy ’ ;
868 s a v e xc xc −ASCII
869 s a v e yc yc −ASCII

67
870 s a v e Vx Vx −ASCII
871 s a v e Vy Vy −ASCII
872 Relem ( : , 2 : 5 )= ELEMENT
873 Relem ( : , 6 )=Dx
874 Relem ( : , 7 )=Dy
875 Relem ( : , 8 )=D
876 Relem ( : , 9 )=Vx
877 function integral
878 g l o b a l kz kx e s NODE ELEMENT CONTOUR x1 x2 x3 y1 y2 y3 V1x V2x V3x V1y
V2y
879 g l o b a l V3y Di D11 D12 D13 D21 D22 D23 D31 D32 D33 S1 S2 S3 w d e t
880 d e t =(x1 ∗ y2+x2 ∗ y3+x3 ∗y1−y1 ∗x2−y2 ∗x3−y3 ∗ x1 )
881 w=1/(2∗ d e t )
882 Ae=d e t /2
883 kz
884 D11=w∗ ( kz ∗ ( x2−x3 ) ˆ2∗V1y+kx ∗ ( y2−y3 ) ˆ2∗V1x )−Ae/3∗ S1
885 D12=w∗ ( kz ∗ ( x2−x3 ) ∗ ( x3−x1 ) ∗V1y+kx ∗ ( y2−y3 ) ∗ ( y3−y1 ) ∗V1x )
886 D13=w∗ ( kz ∗ ( x2−x3 ) ∗ ( x1−x2 ) ∗V1y+kx ∗ ( y2−y3 ) ∗ ( y1−y2 ) ∗V1x )
887 D21=w∗ ( kz ∗ ( x2−x3 ) ∗ ( x3−x1 ) ∗V2y+kx ∗ ( y2−y3 ) ∗ ( y3−y1 ) ∗V2x )
888 D22=w∗ ( kz ∗ ( x3−x1 ) ˆ2∗V2y+kx ∗ ( y3−y1 ) ˆ2∗V2x )−Ae/3∗ S2 ;
889 D23=w∗ ( kz ∗ ( x1−x2 ) ∗ ( x3−x1 ) ∗V2y+kx ∗ ( y1−y2 ) ∗ ( y3−y1 ) ∗V2x ) ;
890 D31=w∗ ( kz ∗ ( x2−x3 ) ∗ ( x1−x2 ) ∗V3y+kx ∗ ( y2−y3 ) ∗ ( y1−y2 ) ∗V3x ) ;
891 D32=w∗ ( kz ∗ ( x3−x1 ) ∗ ( x1−x2 ) ∗V3y+kx ∗ ( y3−y1 ) ∗ ( y1−y2 ) ∗V3x ) ;
892 D33=w∗ ( kz ∗ ( x1−x2 ) ˆ2∗V3y+kx ∗ ( y1−y2 ) ˆ2∗V3x )−Ae/3∗ S3 ;
893 Di =[D11 D12 D13 ; D21 D22 D23 ; D31 D32 D33 ] ;
894 function Restaurar
895 g l o b a l LADO M a t e r i a l e s
896 l o a d dat
897 NODE=p ’ ; ELEMENT=t ’ ; CONTOUR=e ’ ;
898 LADO( 1 , 5 ) = [ 0 ] ;
899 v=0;
900 nb=0;
901 f o r i =1: s i z e (CONTOUR, 1 )
902 if CONTOUR( i , 5 ) ˜=v & v< CONTOUR( i , 5 )
903 LADO( v +1 ,1)= CONTOUR( i , 5 ) ;
904 LADO( v +1 ,4)= CONTOUR( i , 6 ) ;

68
905 LADO( v +1 ,5)= CONTOUR( i , 7 ) ;
906 v=v+1;
907 end
908 end
909 Belem ( 1 , 1 ) = [ 0 ] ;
910 f o r i =1: s i z e (CONTOUR, 1 )
911 nb= CONTOUR( i , 5 ) ;
912 n1= CONTOUR( i , 1 ) ; n2= CONTOUR( i , 2 ) ;
913 Belem ( i , 2 ∗ nb−1)=n1 ; Belem ( i , 2 ∗ nb )=n2 ;
914 end
915 f o r i =1: s i z e (LADO, 1 )
916 n1 =10ˆ20;
917 n2 =10ˆ20;
918 fo r j =1: s i z e ( Belem , 1 )
919 i f Belem ( j , 2 ∗ i −1)˜=0
920 i f Belem ( j , 2 ∗ i −1)<n1
921 n1=Belem ( j , 2 ∗ i −1) ;
922 LADO( i , 2 )=n1 ;
923 end
924 end
925 i f Belem ( j , 2 ∗ i ) ˜=0
926 i f Belem ( j , 2 ∗ i )<n2
927 n2=Belem ( j , 2 ∗ i ) ;
928 LADO( i , 3 )=n2 ;
929 end
930 end
931 end
932 end
933 x(1 ,1) =[0];
934 y(1 ,1) =[0];
935 v=1;
936 close ( figure (1) )
937 s c r s z = get (0 , ’ ScreenSize ’ ) ;
938 f i g u r e ( ’ P o s i t i o n ’ , [ 0 0 s c r s z ( 3 ) s c r s z ( 4 ) ] , ’ Name ’ , ’ Contorno d e l Dominio
’ , ’ NumberTitle ’ , ’ o f f ’ ) ;
939 figure (1)

69
940 f o r i =1: s i z e (LADO, 1 )
941 n1=LADO( i , 2 ) ;
942 n2=LADO( i , 3 ) ;
943 x ( v , 1 )=NODE( n1 , 1 ) ;
944 y ( v , 1 )= NODE( n1 , 2 ) ;
945 x ( v +1 ,1)= NODE( n2 , 1 ) ;
946 y ( v +1 ,1)= NODE( n2 , 2 ) ;
947 l i n e ( [ x ( v , 1 ) x ( v +1 ,1) ] , [ y ( v , 1 ) y ( v +1 ,1) ] , ’ Marker ’ , ’ . ’ , ’ L i n e S t y l e
’ , ’ − ’ , ’ LineWidth ’ , 2 ) ;
948 v=v+2;
949 end
950 f o r i =1: s i z e (LADO, 1 )
951 n1=LADO( i , 2 ) ;
952 n2=LADO( i , 3 ) ;
953 m1=LADO( i , 4 ) ;
954 m2=LADO( i , 5 ) ;
955 x1= NODE( n1 , 1 ) ;
956 y1= NODE( n1 , 2 ) ;
957 x2= NODE( n2 , 1 ) ;
958 y2= NODE( n2 , 2 ) ;
959 xc =0.5∗( x1+x2 ) ;
960 yc =0.5∗( y1+y2 ) ;
961 t e x t ( xc , yc +0.3 , i n t 2 s t r (LADO( i , 1 ) ) , ’ FontSize ’ , 1 2 ) ;
962 t e x t ( xc −0.3 , yc −0.8 , i n t 2 s t r (m1) , ’ FontSize ’ , 7 ) ;
963 t e x t ( xc +0.5 , yc −0.8 , i n t 2 s t r (m2) , ’ FontSize ’ , 7 ) ;
964 t e x t ( x1 , y1 −0.3 , i n t 2 s t r ( n1 ) , ’ FontSize ’ , 7 ) ;
965 t e x t ( x2 , y2 −0.3 , i n t 2 s t r ( n2 ) , ’ FontSize ’ , 7 ) ;
966 end
967 Xmin=min ( x ) ; Xmax=max( x ) ;
968 Ymin=min ( y ) ; Ymax=max( x ) ;
969 x l a b e l ( ’X(m) ’ ) ;
970 y l a b e l ( ’ Z (m) ’ ) ;
971 t i t l e ( ’CONDICIONES DE BORDE’ ) ;
972 set ( figure (1) , ’ color ’ , ’ c ’ ) ;
973 M a t e r i a l e s=max(ELEMENT( : , 4 ) ) ;

70
A.2. Código del interfaz Propiedades

1 function varargout = Propiedades ( varargin )


2 gui Singleton = 1;
3 g u i S t a t e = struct ( ’ gui Name ’ , mfilename , ...
4 ’ gui Singleton ’ , gui Singleton , ...
5 ’ gui OpeningFcn ’ , @Propiedades OpeningFcn , ...
6 ’ gui OutputFcn ’ , @Propiedades OutputFcn , ...
7 ’ gui LayoutFcn ’ , [] , ...
8 ’ gui Callback ’ , []) ;
9 i f n a r g i n && i s c h a r ( v a r a r g i n { 1 } )
10 g u i S t a t e . gui Callback = s t r 2 f u n c ( varargin {1}) ;
11 end
12 i f nargout
13 [ varargout {1: nargout } ] = gui mainfcn ( gui State , varargin { : } ) ;
14 else
15 gui mainfcn ( gui State , varargin {:}) ;
16 end
17 f u n c t i o n Propiedades OpeningFcn ( hObject , e ven tda ta , h a n d l e s , v a r a r g i n )
18 g l o b a l LADO M a t e r i a l e s NM Ap Kxz
19 NM=M a t e r i a l e s ;
20 s c r s z=g e t ( 0 , ’ s c r e e n s i z e ’ ) ;
21 pa=g e t ( g c f , ’ p o s i t i o n ’ ) ;
22 xr=s c r s z ( 3 )−pa ( 3 ) ;
23 xp=round ( xr / 2 ) ;
24 yr=s c r s z ( 4 )−pa ( 4 ) ;
25 yp=round ( yr / 2 ) ;
26 s e t ( g c f , ’ p o s i t i o n ’ , [ 0 yp pa ( 3 ) pa ( 4 ) ] ) ;
27 i f Ap==1
28 s e t ( h a n d l e s . e d i t 1 , ’ string ’ ,NM)
29 s e t ( handles . edit1 , ’ enable ’ , ’ o f f ’ )
30 s e t ( h a n d l e s . Propiedad , ’ v i s i b l e ’ , ’ on ’ )
31 s e t ( h a n d l e s . pushbutton1 , ’ v i s i b l e ’ , ’ on ’ )
32 s e t ( h a n d l e s . pushbutton2 , ’ v i s i b l e ’ , ’ on ’ )
33 s e t ( h a n d l e s . Propiedad , ’ Data ’ , Kxz )
34 else

71
35 s e t ( h a n d l e s . e d i t 1 , ’ e n a b l e ’ , ’ on ’ )
36 s e t ( h a n d l e s . Propiedad , ’ v i s i b l e ’ , ’ o f f ’ )
37 s e t ( h a n d l e s . pushbutton1 , ’ v i s i b l e ’ , ’ o f f ’ )
38 s e t ( h a n d l e s . pushbutton2 , ’ v i s i b l e ’ , ’ o f f ’ )
39 end
40 h a n d l e s . output = hObject ;
41 g u i d a t a ( hObject , h a n d l e s ) ;
42 f u n c t i o n v a r a r g o u t = Propiedades OutputFcn ( hObject , eve ntd a ta , h a n d l e s )
43 v a r a r g o u t {1} = h a n d l e s . output ;
44 f u n c t i o n p u s h b u t t o n 1 C a l l b a c k ( hObject , ev entd a ta , h a n d l e s )
45 g l o b a l Kxz NM M a t e r i a l
46 NM=s t r 2 d o u b l e ( g e t ( h a n d l e s . e d i t 1 , ’ string ’ ) )
47 M a t e r i a l=NM
48 Kxz=g e t ( h a n d l e s . Propiedad , ’ Data ’ )
49 c l o s e ( Propiedades ) ;
50 f u n c t i o n p u s h b u t t o n 2 C a l l b a c k ( hObject , ev entd a ta , h a n d l e s )
51 c l o s e ( Propiedades ) ;
52 f u n c t i o n e d i t 1 C a l l b a c k ( hObject , e ven tda ta , h a n d l e s )
53 g l o b a l NM M a t e r i a l
54 NM=s t r 2 d o u b l e ( g e t ( h a n d l e s . e d i t 1 , ’ string ’ ) )
55 M a t e r i a l=NM
56 s e t ( h a n d l e s . Propiedad , ’ v i s i b l e ’ , ’ on ’ )
57 s e t ( h a n d l e s . pushbutton1 , ’ v i s i b l e ’ , ’ on ’ )
58 s e t ( h a n d l e s . pushbutton2 , ’ v i s i b l e ’ , ’ on ’ )
59 r a n g e= c e l l (NM, 4 ) ;
60 range ( : , : ) ={ ’ ’};
61 s e t ( h a n d l e s . Propiedad , ’ Data ’ , r a n g e )
62 s e t ( h a n d l e s . Propiedad , ’ ColumnEditable ’ , true ( 1 , 4 ) )
63 f u n c t i o n e d i t 1 C r e a t e F c n ( hObject , e ven tda ta , h a n d l e s )
64 i f i s p c && i s e q u a l ( g e t ( hObject , ’ BackgroundColor ’ ) , g e t ( 0 , ’
defaultUicontrolBackgroundColor ’ ) )
65 s e t ( hObject , ’ BackgroundColor ’ , ’ white ’ ) ;
66 end

72
A.3. Código del interfaz Agua

1 f u n c t i o n v a r a r g o u t = Agua ( v a r a r g i n )
2 gui Singleton = 1;
3 g u i S t a t e = struct ( ’ gui Name ’ , mfilename , ...
4 ’ gui Singleton ’ , gui Singleton , ...
5 ’ gui OpeningFcn ’ , @Agua OpeningFcn , ...
6 ’ gui OutputFcn ’ , @Agua OutputFcn , ...
7 ’ gui LayoutFcn ’ , [] , ...
8 ’ gui Callback ’ , []) ;
9 i f n a r g i n && i s c h a r ( v a r a r g i n { 1 } )
10 g u i S t a t e . gui Callback = s t r 2 f u n c ( varargin {1}) ;
11 end
12 i f nargout
13 [ varargout {1: nargout } ] = gui mainfcn ( gui State , varargin { : } ) ;
14 else
15 gui mainfcn ( gui State , varargin {:}) ;
16 end
17 f u n c t i o n Agua OpeningFcn ( hObject , eve ntda ta , h a n d l e s , v a r a r g i n )
18 s c r s z=g e t ( 0 , ’ s c r e e n s i z e ’ ) ;
19 pa=g e t ( g c f , ’ p o s i t i o n ’ ) ;
20 xr=s c r s z ( 3 )−pa ( 3 ) ;
21 xp=round ( xr / 2 ) ;
22 yr=s c r s z ( 4 )−pa ( 4 ) ;
23 yp=round ( yr / 2 ) ;
24 s e t ( g c f , ’ p o s i t i o n ’ , [ 0 yp pa ( 3 ) pa ( 4 ) ] ) ;
25 h a n d l e s . output = hObject ;
26 g u i d a t a ( hObject , h a n d l e s ) ;
27 f u n c t i o n v a r a r g o u t = Agua OutputFcn ( hObject , e ve ntda ta , h a n d l e s )
28 v a r a r g o u t {1} = h a n d l e s . output ;
29 f u n c t i o n p u s h b u t t o n 1 C a l l b a c k ( hObject , ev entd a ta , h a n d l e s )
30 g l o b a l Xi Xf Z
31 Xi=s t r 2 d o u b l e ( g e t ( h a n d l e s . e d i t 2 , ’ S t r i n g ’ ) ) ;
32 Xf=s t r 2 d o u b l e ( g e t ( h a n d l e s . e d i t 1 , ’ S t r i n g ’ ) ) ;
33 Z=s t r 2 d o u b l e ( g e t ( h a n d l e s . e d i t 3 , ’ S t r i n g ’ ) ) ;
34 c l o s e ( Agua )

73
35 f u n c t i o n e d i t 1 C a l l b a c k ( hObject , e ven tda ta , h a n d l e s )
36 f u n c t i o n e d i t 1 C r e a t e F c n ( hObject , e ven tda ta , h a n d l e s )
37 i f i s p c && i s e q u a l ( g e t ( hObject , ’ BackgroundColor ’ ) , g e t ( 0 , ’
defaultUicontrolBackgroundColor ’ ) )
38 s e t ( hObject , ’ BackgroundColor ’ , ’ white ’ ) ;
39 end
40 f u n c t i o n e d i t 2 C a l l b a c k ( hObject , e ven tda ta , h a n d l e s )
41 f u n c t i o n e d i t 2 C r e a t e F c n ( hObject , e ven tda ta , h a n d l e s )
42 i f i s p c && i s e q u a l ( g e t ( hObject , ’ BackgroundColor ’ ) , g e t ( 0 , ’
defaultUicontrolBackgroundColor ’ ) )
43 s e t ( hObject , ’ BackgroundColor ’ , ’ white ’ ) ;
44 end
45 f u n c t i o n e d i t 3 C a l l b a c k ( hObject , e ven tda ta , h a n d l e s )
46 f u n c t i o n e d i t 3 C r e a t e F c n ( hObject , e ven tda ta , h a n d l e s )
47 i f i s p c && i s e q u a l ( g e t ( hObject , ’ BackgroundColor ’ ) , g e t ( 0 , ’
defaultUicontrolBackgroundColor ’ ) )
48 s e t ( hObject , ’ BackgroundColor ’ , ’ white ’ ) ;
49 end

A.4. Código del interfaz Contorno

1 f u n c t i o n v a r a r g o u t = Contorno ( v a r a r g i n )
2 gui Singleton = 1;
3 g u i S t a t e = struct ( ’ gui Name ’ , mfilename , ...
4 ’ gui Singleton ’ , gui Singleton , ...
5 ’ gui OpeningFcn ’ , @Contorno OpeningFcn , ...
6 ’ gui OutputFcn ’ , @Contorno OutputFcn , ...
7 ’ gui LayoutFcn ’ , [] , ...
8 ’ gui Callback ’ , []) ;
9 i f n a r g i n && i s c h a r ( v a r a r g i n { 1 } )
10 g u i S t a t e . gui Callback = s t r 2 f u n c ( varargin {1}) ;
11 end
12 i f nargout
13 [ varargout {1: nargout } ] = gui mainfcn ( gui State , varargin { : } ) ;
14 else

74
15 gui mainfcn ( gui State , varargin {:}) ;
16 end
17 f u n c t i o n Contorno OpeningFcn ( hObject , e ventd a ta , h a n d l e s , v a r a r g i n )
18 s c r s z=g e t ( 0 , ’ s c r e e n s i z e ’ ) ;
19 pa=g e t ( g c f , ’ p o s i t i o n ’ ) ;
20 xr=s c r s z ( 3 )−pa ( 3 ) ;
21 xp=round ( xr / 2 ) ;
22 yr=s c r s z ( 4 )−pa ( 4 ) ;
23 yp=round ( yr / 2 ) ;
24 s e t ( g c f , ’ p o s i t i o n ’ , [ 0 yp pa ( 3 ) pa ( 4 ) ] ) ;
25 g l o b a l LADO M a t e r i a l e s Acb
26 i f Acb==1
27 e l e m e n t= c e l l ( s i z e (LADO, 1 ) , 7 ) ;
28 element ( : , : ) ={ ’ ’};
29 s e t ( h a n d l e s . contour , ’ Data ’ , e l e m e n t )
30 CC( s i z e ( element , 1 ) , 7 ) = [ 0 ] ;
31 CC( : , 1 : 2 )=LADO( : , 2 : 3 ) ;
32 s e t ( h a n d l e s . contour , ’ Data ’ ,CC)
33 else
34 end
35 h a n d l e s . output = hObject ;
36 g u i d a t a ( hObject , h a n d l e s ) ;
37 f u n c t i o n v a r a r g o u t = Contorno OutputFcn ( hObject , eve ntda ta , h a n d l e s )
38 v a r a r g o u t {1} = h a n d l e s . output ;
39 f u n c t i o n p u s h b u t t o n 1 C a l l b a c k ( hObject , ev entd a ta , h a n d l e s )
40 g l o b a l CC
41 CC=g e t ( h a n d l e s . contour , ’ Data ’ ) ;
42 c l o s e ( Contorno )
43 f u n c t i o n p u s h b u t t o n 2 C a l l b a c k ( hObject , ev entd a ta , h a n d l e s )
44 c l o s e ( Contorno )

A.5. Código del interfaz Resultados

1 function varargout = Resultados ( varargin )


2 gui Singleton = 1;

75
3 g u i S t a t e = struct ( ’ gui Name ’ , mfilename , ...
4 ’ gui Singleton ’ , gui Singleton , ...
5 ’ gui OpeningFcn ’ , @Resultados OpeningFcn , ...
6 ’ gui OutputFcn ’ , @Resultados OutputFcn , ...
7 ’ gui LayoutFcn ’ , [] , ...
8 ’ gui Callback ’ , []) ;
9 i f n a r g i n && i s c h a r ( v a r a r g i n { 1 } )
10 g u i S t a t e . gui Callback = s t r 2 f u n c ( varargin {1}) ;
11 end
12 i f nargout
13 [ varargout {1: nargout } ] = gui mainfcn ( gui State , varargin { : } ) ;
14 else
15 gui mainfcn ( gui State , varargin {:}) ;
16 end
17 f u n c t i o n Resultados OpeningFcn ( hObject , eve ntda ta , h a n d l e s , v a r a r g i n )
18 g l o b a l Rnodo Relem RE
19 s c r s z=g e t ( 0 , ’ s c r e e n s i z e ’ ) ;
20 pa=g e t ( g c f , ’ p o s i t i o n ’ ) ;
21 xr=s c r s z ( 3 )−pa ( 3 ) ;
22 xp=round ( xr / 2 ) ;
23 yr=s c r s z ( 4 )−pa ( 4 ) ;
24 yp=round ( yr / 2 ) ;
25 s e t ( g c f , ’ p o s i t i o n ’ , [ 0 yp pa ( 3 ) pa ( 4 ) ] ) ;
26 i f RE==1
27 s e t ( g c f , ’ Name ’ , ’ Reporte de l o s Nodos ’ )
28 s e t ( h a n d l e s . u i t a b l e 1 , ’ columnname ’ , { ’ Nodo ’ , ’X (m) ’ , ’ Z (m. s . n .m) ’ , ’
Alt . P i e z t . (m) ’ , ’ Alt . Pres . (m) ’ } ) ;
29 s e t ( h a n d l e s . u i t a b l e 1 , ’ Data ’ , Rnodo )
30 e l s e i f RE==2
31 s e t ( g c f , ’ Name ’ , ’ Reporte de l o s Elementos ’ )
32 s e t ( h a n d l e s . u i t a b l e 1 , ’ columnname ’ , { ’ Elemento ’ , ’ Nodo1 ’ , ’ Nodo2 ’ , ’
Nodo3 ’ , ’ M a t e r i a l ’ , ’ Grad . X(m/m) ’ , ’ Grad . Z (m/m) ’ , ’ Grad (m/m) ’ , ’
Vx (m/ s ) ’ , ’ Vz (m/m) ’ , ’V (m/ s ) ’ } ) ;
33 s e t ( h a n d l e s . u i t a b l e 1 , ’ Data ’ , Relem )
34 end
35 h a n d l e s . output = hObject ;

76
36 g u i d a t a ( hObject , h a n d l e s ) ;
37 f u n c t i o n v a r a r g o u t = Resultados OutputFcn ( hObject , ev entd a ta , h a n d l e s )
38 v a r a r g o u t {1} = h a n d l e s . output ;
39 f u n c t i o n p u s h b u t t o n 1 C a l l b a c k ( hObject , ev entd a ta , h a n d l e s )
40 c l o s e ( Resultados )
41 f u n c t i o n p u s h b u t t o n 2 C a l l b a c k ( hObject , ev entd a ta , h a n d l e s )
42 c l o s e ( Resultados )

77
Apéndice B

PLANOS

Plano Topográfico

Plano Geológico

Plano Esquema Hidráulico

Sección de la Presa Tintay

78

También podría gustarte