TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE...

170
TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA PROYECTO DE FINAL DE CARRERA TITULACIÓN: Enginyeria Automàtica i Electrònica Industrial (2008) AUTOR: SANTI MENSA DIRECTOR: LLUIS MARSAL FECHA: junio 2008.

Transcript of TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE...

Page 1: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

TITULO DEL PROYECTO:

OPTIMIZACIÓN Y EXTRACCIÓN DE

PARAMETROS ÓPTICOS DE ESTRUCTURAS

MULTICAPA

PROYECTO DE FINAL DE CARRERA

TITULACIÓN: Enginyeria Automàtica i Electrònica Industrial (2008)

AUTOR: SANTI MENSA

DIRECTOR: LLUIS MARSAL

FECHA: junio 2008.

Page 2: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 2 de 98

ÍNDICE:1 Objetivo. ............................................................................................................................. 42. Antecedentes...................................................................................................................... 43. Memoria descriptiva. ......................................................................................................... 4

3.1. Propiedades Ópticas de Sólidos.................................................................................. 43.1.1.Generalidades........................................................................................................4

3.1.2. Ecuaciones de Maxwell. .......................................................................................4

3.1.3. Ecuaciones de la materia. ....................................................................................5

3.1.4.Propiedades del tensor .....................................................................................9

3.1.5. Las relaciones de Kramers-Krönig. ...................................................................11

3.1.6 Ondas Electromagnéticas en medios isótropos...................................................12

3.1.7 Transiciones intrabanda......................................................................................16

3.1.7.1 Ecuación cinética de Boltzmann. .....................................................................16

3.2 Efectos de superficie en los espectros ópticos........................................................... 183.2.1. Elipsometría. ......................................................................................................18

3.2.2. Efectos de interferencia en capas delgadas .......................................................21

3.2.3. Obtención del .................................................................................................21

3.3. Rugosidad. ................................................................................................................ 223.3.1. Campo Local. .....................................................................................................23

3.3.2. Campo Exterior. .................................................................................................24

3.3.3. Modelo de Medio Efectivo. .................................................................................27

3.4. Figuras originales. .................................................................................................... 293.4.1. Efectos de interferencia en capas delgadas. ......................................................29

3.4.2. Efectos de película de óxido. ..............................................................................29

3.4.3. Rugosidad. ..........................................................................................................29

3.5 Transiciones Interbanda............................................................................................. 323.5.1. Teoría de Transiciones Interbanda. ...................................................................32

3.5.2. Transiciones banda-banda. ................................................................................36

3.5.3. Algunos Casos. ...................................................................................................39

3.6. Punto crítico M0. ...................................................................................................... 403.6.1 Transiciones prohibidas en el punto crítico M0. ................................................42

3.7. Punto de Ensilladura M1. ......................................................................................... 423.8. Cristales Bidimensionales......................................................................................... 443.9. Cristales Unidimensionales. ..................................................................................... 443.10. Constante dieléctrica de un sistema de osciladores quánticos................................ 453.11. Radiación en la materia. ......................................................................................... 453.12.Ecuaciones de dispersión del índice de refracción. ................................................. 47

3.12.1. La ecuación de Cauchy. ...................................................................................47

Page 3: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 3 de98

3.12.2. Ecuación de sellmeier.......................................................................................49

4. Entorno MATLAB. ......................................................................................................... 524.1. Entorno gráfico GUIDE con MATLAB................................................................... 52

4.1.1. Herramienta GUIDE. .........................................................................................52

4.1.2. Inicio...................................................................................................................52

4.1.3. Propiedades de los componentes........................................................................55

4.1.4. Funcionamiento de una aplicación GUI. ...........................................................56

4.1.5. Manejo de datos entre los elementos de la aplicación y el archivo .M..............56

4.1.6. Sentencias GET y SET. .......................................................................................57

4.2 Matlab optimización. ................................................................................................. 584.2.1.LSQNONLIN........................................................................................................58

4.2.1.1 Ecuación. ..........................................................................................................58

4.2.1.2 Sintaxis. ............................................................................................................58

4.2.1.3 Descripción.......................................................................................................58

4.2.1.3 Argumentos de entrada.....................................................................................60

4.2.1.4 Argumentos de salida. ......................................................................................61

4.2.1.5. Opciones. .........................................................................................................62

4.2.1.4.1. Algoritmos de mediana i larga escala..........................................................62

4.2.1.4.1.1. Solo algoritmo de larga escala..................................................................63

4.2.1.4.1.2 Solo para algoritmo de mediana escala. ....................................................65

4.2.1.4.2. Ejemplos. ......................................................................................................65

4.2.1.4.2.1 Optimización de gran escala. .....................................................................66

4.2.1.4.2.2 Optimización mediana escala.....................................................................66

4.2.1.4.3 Limitaciones. .................................................................................................66

4.2.1.4.3.1. Optimización a gran escala.......................................................................66

5. Medidas experimentales. ................................................................................................. 685.1. Espectrofotómetro de Infrarrojo por transformada de Fourier VERTEX 70. .......... 70

5.1.1. Características VERTEX 70. ..............................................................................71

5.1.2. Puesta a punto del sistema de medida con el espectrofotómetro IR del DEEEA.73

5.2. Software OPUS 5.0 for QA/QC. .............................................................................. 746. Programa principal. ......................................................................................................... 76

6.1 Menu principal........................................................................................................... 766.2 Funcionamiento del programa. .................................................................................. 79

7 Resultados obtenidos. ....................................................................................................... 817.1 Pruebas con una sola lámina de cristal. ..................................................................... 817.2 Optimizacion de doble capa. ..................................................................................... 96

8. Referencias bibliográficas. .............................................................................................. 98

Page 4: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 4 de 98

1 Objetivo.El Objetivo principal es el desarrollo de un entorno gráfico que permita la determinaciónde los parámetros ópticos de los materiales. Este entorno nos permitirá representargráficamente los datos experimentales y a partir de estos datos obtener los parámetrosópticos óptimos para los resultados experimentales obtenidos.Para el desarrollo del proyecto es necesario tener conocimientos en:

Conocimientos de las propiedades ópticas.Lenguaje de programación MATLAB.La herramienta para el desarrollo del interfaz gráfico (GUIDE).

2. Antecedentes.El departamento EEEA lleva años experimentando con cristales nanoporosos de diferentesmateriales y desarrollando aplicaciones para poder contrastar los resultados experimentalescon los teóricos. Este no deja de ser un proyecto de ayuda para la obtención de parámetrosópticos a partir de resultados prácticos desarrollados en el laboratorio.

3. Memoria descriptiva.3.1. Propiedades Ópticas de Sólidos.

3.1.1.Generalidades.Ecuaciones de Maxwell, causalidad y relaciones de Kramers-Krönig. Constante dieléctricacompleja y conductividad compleja. Índice de refracción complejo. Índice de refracción real ycoeficiente de absorción. Reflectancia.

3.1.2. Ecuaciones de Maxwell.

Como fenómeno electromagnético, la luz está determinada por las ecuaciones de Maxwell. Lasenunciamos aquí de la forma más general posible.

Las características del material están implícitas en las cargas y corrientes ligadas, que vienen aser la respuesta del medio ante los campos aplicados. En nuestro caso, estamos interesados enuna descripción macroscópica de estos fenómenos. Por esto, es conveniente definir los promedios

Donde Δv y Δt son magnitudes lo suficientemente pequeñas para describir precisamente loscampos, pero lo suficientemente grandes para redondear las variaciones bruscas dentro de unátomo. En otras palabras, el volumen de integración es muy pequeño en comparación con el

Memoria descriptiva

Page 5: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 5 de 98

volumen total del sólido, pero mucho más grande que el de un núcleo. Por su parte, el tiempo deintegración debe ser consistente con una distancia promedio definida por el volumen(típicamente la raíz cúbica de éste) y la velocidad de la luz. En metales es común asociarlo conel tiempo de relajación de los electrones, que se explicará en detalle en el capítulo siguiente.

Además le llamaremos

B al promedio

H .

Suponiendo que las integrales convergen uniformemente, las ecuaciones de Maxwell sonválidas para los campos definidos por (5) y (6).

3.1.3. Ecuaciones de la materia.

Ahora, caractericemos el campo eléctrico dentro de un sólido. Debido a nuestra escala detrabajo, el momento dipolar, definido por:

dvrpp

(1.7)

Es la magnitud apropiada para describir la reacción de los átomos frente a los campos aplicados.

De esta forma, la contribución al campo eléctrico total será la polarización

P , que correspondeal momento dipolar por unidad de volumen. A partir de esta definición se desprende fácilmenteque:

Suponiendo además que el cuerpo es eléctricamente neutro,

Y utilizando la identidad vectorial

Donde

a es un vector arbitrario, es posible concluir:

Lo cual liga el campo interno con las fuentes inducidas de carga. Reemplazando esteresultado en la ecuación de continuidad

Memoria descriptiva

Page 6: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 6 de 98

Tenemos

O bien,

Donde

N es un vector cualquiera por ahora. Es posible identificarlo con la magnetización

M si t

P

= 0. En tal caso,

En caso contrario, las variaciones de la polarización contribuyen a la corriente,oscureciendo un poco más su identificación.Para evitar estas distinciones engorrosas, incluyamos todos los efectos materiales en unsolo vector. Para ello, definimos:

De tal forma que satisface

Y

Así, la polarización y la corriente están completamente determinadas por

p . Es posibledefinir un vector desplazamiento eléctrico con esta polarización, de la forma

Memoria descriptiva

Page 7: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 7 de 98

Y relacionarlo con el campo eléctrico de la forma más general posible

La integral respecto al volumen expresa una posible dependencia del campo respecto a la magnitudde éste en regiones vecinas. Por ejemplo, si el desplazamiento de los portadores es comparable a lalongitud característica del campo eléctrico, deberemos considerar su valor en regiones aledañas,pues afectarán su valor notablemente en un futuro cercano. Por otra parte la integral temporalrepresenta los efectos de retardo debidos a la existencia de corrientes transientes. La anisotropíaestá incluida en el carácter tensorial de la constante dieléctrica (de importancia enestructuras cristalinas, para explicar fenómenos como birrefringencia y efecto Kerr). Si elcomportamiento del medio es invariante ante traslaciones, sólo depende de su vecindad, y nodel punto donde se evalúe.

Para la invariancia temporal, la expresión es análoga

En la mayoría de los casos se cumple esta última expresión. Si es así, la ecuación (19) queda:

Que es una convolución en el tiempo, por lo que es más conveniente trabajar en el espacio deFourier. Aplicando la transformada a cada lado de la ecuación (22), la transformada de laconvolución se transforma en un producto de transformadas, resultando

De aquí que la dispersión en el espacio de frecuencias proviene de los efectos de retardo. Por otraparte, de cumplirse (20) el procedimiento es equivalente en el espacio recíproco de la posición.Análogamente, escribimos la corriente como

Hasta ahora la introducción del vector

p nos permite calcular la polarización y la corriente, que a suvez dependen linealmente del campo eléctrico por las relaciones (18), (23) y (24). Esto nos permiteinferir que debe haber alguna relación entre los tensores y . Efectivamente, reescribiendo (18) y(23), queda

Memoria descriptiva

Page 8: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 8 de 98

Donde

Integrando por partes, resulta

Finalmente, igualando las partes real e imaginaria en (23), queda

De aquí podemos concluir que es puramente real para un dieléctrico y puramente imaginario paraun metal. O bien, es imaginario puro si el material no es conductor, y completamente real en elcaso contrario. El trabajar con tensores complejos es el precio que debemos pagar por introducir unvector que unifica ambos fenómenos.A modo de ejemplo, calculemos la constante dieléctrica de un conjunto de N dipolos nointeractuantes. Cada uno consta de dos partículas de cargas q y -q, separadas por una distancia r.Podemos suponer que para pequeñas perturbaciones en torno a la separación de equilibrio r oscilará

armónicamente con frecuencia w0, por lo que al aplicar un campo eléctrico

)(tE tenemos para cadadipolo

Aplicando la transformada de Fourier a ambos lados de la ecuación, resulta una expresión algebraica

para

r .

Reordenando, se obtiene

Con esto, es posible calcular el momento dipolar de cada dipolo, que viene dado por

Habiendo N dipolos en un volumen V, la polarización resulta ser

Memoria descriptiva

Page 9: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 9 de 98

Pues no hay magnetización en el sistema (con lo cual se cumple ). Finalmente, obtenemosla relación

Donde la función dieléctrica es compleja. A partir de la solución r() es posible calcular

J en

función de

E y verificar las relaciones (28) y (29). Así, si

Tenemos que

Lo cual es completamente consistente con el cálculo de . Esta frecuencia de resonancia w0corresponde al color que el cuerpo absorbe, reflejando el resto. Es posible introducir a dedo másfrecuencias de absorción.

Por otra parte, podemos modelar un material conductor con este mismo modelo. Si w0 = 0, seentiende que los portadores de carga se mueven sin una fuerza restitutiva, aunque sigue existiendo

el término responsable de la amortiguación de tal movimiento. Se dará un sustento teórico a tal

suposición en el capítulo siguiente. Sin embargo, es de notar que ajustando las constantes y w0,el modelo resulta ser más general de lo previsto.

3.1.4.Propiedades del tensor

Estudiemos las propiedades de E como la función compleja que es. Designamos

Donde 'tt

Ante la conjugación, se puede deducir fácilmente

Por lo tanto, la parte real es par y la imaginaria impar.

Ahora, si w es complejo

Memoria descriptiva

Page 10: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 10 de 98

Entonces, posee un valor acotado en el semiplano superior, y por ende es analítica en estaregión. A partir de esto, es posible deducir una relación un poco más general,

Veamos ahora que sucede en los valores límite de w. Para w → 0, podemos recurrir a la ecuación

(27) y escribir

Separemos las partes real e imaginaria, expresando

Donde

Im4)(

.Podemos calcular el límite para medios dieléctricos y conductores. Físicamente es de esperar queen un dieléctrico, tenga un valor acotado para un campo estático y la parte real de tienda acero debido a la ausencia de corrientes estables.Sin embargo, éstas pueden existir en un conductor, por lo que la parte imaginaria de divergeen estos materiales para frecuencias nulas.

Para el límite , consideremos

Memoria descriptiva

Page 11: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 11 de 98

Que corresponde la solución dada por el modelo de Lorentz. La única suposición hecha enél es que los electrones son partículas clásicas. Tomando los primeros términos de laexpansión en torno a ,resulta

Donde

e es la carga del electrón, n la densidad de electrones y m, la masa efectiva de éstos ( quepuede variar según el material). A wp se le llama frecuencia de plasma, y su valor es crucialpara determinar la propagación o atenuación de una onda en un medio de electrones libres, comola ionosfera.

3.1.5. Las relaciones de Kramers-Krönig.

Hasta ahora hemos deducido la analiticidad del tensor en el semiplano superior complejo.

Gracias a esta propiedad podremos relaciones entre sus partes real e imaginaria.Para ello, recordemos la fórmula integral de Cauchy

si el contorno de integración incluye el punto z = z0. Ahora, consideremos la función — 1.Gracias a la ecuación (1.45), su valor tiende a cero para frecuencias muy altas. Integrémosla enel contorno que muestra la figura, aislando las singularidades = 0 y 0.

Entonces,

lo cual se puede entender como que la suma de las cuatro integrales (las dos semicircunferenciasque rodean los polos, el radio mayor y la que cubre la mayor parte del eje real) es nula.Naturalmente, tomaremos los límites R r1 → 0 y r2 → 0. Para el primer límite, la

contribución de la integral C3 se anula, debido a que, según la ecuación (39), decae como 2para valores grandes. Para las dos integrales alrededor de los polos, tenemos que por la ecuación(42), sus valores serán la mitad de los residuos si es que los radios r1 y r2 tienden a cero. Así,

y

Memoria descriptiva

Page 12: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 12 de 98

Entonces, la integral en el eje real está determinada completamente, y resulta ser

separando las partes real e imaginaria, resulta finalmente

donde

Estas son las llamadas relaciones de Kramers-Krönig. De las ecuaciones se desprende que si laparte real o imaginaria de es conocida, la función está determinada completamente.

3.1.6 Ondas Electromagnéticas en medios isótropos.

Hasta ahora ha sido útil caracterizar en el espacio de Fourier la respuesta de un medio ante un

campo aplicado. Si escribimos cada vector

C de la forma.

las ecuaciones de Maxwell pasan a ser ecuaciones algebraicas

con la ya mencionada ecuación de la materia

Memoria descriptiva

Page 13: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 13 de 98

por lo que la solución estará determinada por la relación entre w y

k . Para hallar

k . hacemos

producto cruz entre el vector

k y la ecuación (50), obteniendo

De aquí podemos clasificar las posibles soluciones como ondas longitudinales y transversales.Si el lado derecho de la ecuación es nulo, tenemos una onda longitudinal, donde el campo eléctricooscila en la dirección de propagación. Esto puede producirse porque el valor de es nulo paraciertas frecuencias, o porque la dirección del campo eléctrico es tal que el producto del tensordieléctrico con el vector es nulo. Naturalmente, esto depende de las características del medio, yno puede concebirse en el vacío.

El caso contrario corresponde a las ondas transversales, donde el campo eléctrico es perpendicularal vector de onda. Entonces

por lo que en un medio isótropo,

donde n es el índice de refracción habitual de la ley de Snell y k0 es el módulo del

vector de onda en el vacío. Supongamos ahora un pulso monocromático en los espacios

k y

por lo que a partir de la ecuación (55) obtenemos una onda plana en el tiempo y el espacio,

Sin embargo, es posible que n sea un número complejo. En tal caso, lo denotamos por

y definimos

donde k es el coeficiente de extinción. De acuerdo a (65), n determinará la forma de propagaciónde la onda, estableciendo los puntos de fase constante. Por otra parte, será responsable de undecaimiento exponencial de la amplitud de la onda en su dirección. Se denomina profundidad de

piel (skindepth) a la distancia

1que indica cuánto penetrará la onda en el material antes de

desvanecerse significativamente. Es posible apreciar este fenómeno aún cuando el índice de

Memoria descriptiva

Page 14: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 14 de 98

refracción sea puramente real. Por ejemplo, en la reflexión total interna sucede algo similar entredos medios dieléctricos. En este caso, la naturaleza compleja reside en el vector unitario queacompaña a , y no en su valor.

Es posible obtener a partir de N como.

Veamos como segundo ejemplo, un modelo de material conductor. Queremos calcular la fracciónde energía que transmite y refleja al incidir una onda plana sobre él. En el medio inicial(supuestamente no absorbente), existen una onda incidente y una reflejada, mientras que en elmetal sólo hay una onda transmitida. Sean sus expresiones en los medios 1 y 2, respectivamente

y

donde km = nmk0, según la ecuación (63) . Si la frecuencia es lo suficientemente pequeña, la

constante dieléctrica viene dada por

Entonces el índice de refracción complejo es

Consideremos además que el medio inicial es vacío, o sea, ni = 1. Apliquemos ahora lascondiciones de borde. Sobre las fases, imponemos que en la interfase, éstas no dependen del punto

Memoria descriptiva

Page 15: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 15 de 98

de evaluación. Entonces, si igualamos las partes real e imaginaria de todas las fases en el plano deinterfase,

donde

r pertenece a dicho plano.De las partes reales se deducen fácilmente las leyes de reflexión y de Snell. De la parte imaginaria,concluimos que el vector siempre es perpendicular al plano para cualquier ángulo de incidencia.Esto implica que los planos de amplitud constante son paralelos a la interfase, mientras que losplanos de fase constante están determinados por las direcciones de los vectores de onda.Supongamos ahora que la incidencia es normal. Esto simplifica mucho las cosas, ya que todos losvectores de onda están en el eje z, como muestra la figura. Así,

y la única diferencia sustancial entre los vectores de onda es el índice de refracción. Respecto a lasamplitudes, simplemente por continuidad de las componentes tangenciales al plano de incidencia

de los vectores

E y

H , tenemos

La segunda ecuación es de utilidad si recordamos que, para el caso de ondas planas longitudinales,

por lo que

De esta forma, podemos resolver el sistema de ecuaciones y obtener la reflectancia y transmitanciadefinidas por

Como

Memoria descriptiva

Page 16: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 16 de 98

donde se ha preferido trabajar con los módulos cuadrados de las amplitudes, para obtenermagnitudes proporcionales al flujo de energía.

3.1.7 Transiciones intrabanda.

Propiedades ópticas de portadores libres en los metales. Modelo de Drude. Modelo de ecuación deBoltzman.(4cl)

Figura 2.1: Función dieléctrica de un gas de electrones libres. hω p = 10 eV, γ = h/τ= 0,1 eV.

3.1.7.1 Ecuación cinética de Boltzmann.

Memoria descriptiva

Page 17: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 17 de 98

Figura 2.2: Parte imaginaria de la función dieléctrica del cobre [PR 118, 1509 (1960)]

Figura 2.3: constantes opticas del cobre n y k tomadas de [Jonson y christy, PRB 6, 4370 (1972)].

Memoria descriptiva

Page 18: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 18 de 98

Figura 2.4: Representación esquemática de la conservación del número de electrones en su

movimiento en el espacio de fase

kr ,

3.2 Efectos de superficie en los espectros ópticos.

3.2.1. Elipsometría.

3.2.2. Determinación directa de €1 y €2, sin utilizar las relaciones de Kramer-Krönig.

Considérese el problema general de la reflexión y refracción de un rayo de luz polarizado, quedesde un medio 1 incide en la intercara de un medio 2.

Los vectores p y s representan la polarización del campo E de la onda incidente, reflejada yrefractada.Onda P: Polarización paralela al plano de incidenciaOnda S: Polarización perpendicular al plano de incidencia

Figura 3.1: Esquema de Polarizaciones de la luz.

En un medio isótropo o cúbico, al aplicar las condiciones de borde de la electrodinámica seobtiene:

Amplitud de Reflectividad (coeficiente de reflexión de Fresnel)

Memoria descriptiva

Page 19: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 19 de 98

Reflectividad

Como N1 y N2 son complejos, las amplitudes de reflectividad son complejas: rs = |rs | exp (iΔs)

y rp = |rp| exp (iΔp).

Nótese que N1 y N2 reales producen Δs, Δp igual a 0 o 180°.

La elipsometría determina el cambio en el estado de polarización del haz incidente alreflejarse en la muestra. Dicho cambio se expresa en términos de la razón:

La ecuación anterior define los ángulos elipsométricos W y Δ las ecuaciones de Fresnelpermiten determinar E(w) de las mediciones elipsométricas de acuerdo con la relación:

Para una reflexión aire/sustrato, N1 = 1 y N2 = n + ik, la constante dieléctrica se puedeescribir como E = 1 + i 2, por lo tanto de la ecuación anterior podemos despejar losvalores de 1 y 2, obteniéndose:

La luz incidente sobre la muestra esta linealmente polarizada y la reflejada resultaelípticamente polarizada. Pues en la onda incidente se cumple que

Las que están en faseY en la onda reflejada se obtiene que

Memoria descriptiva

Page 20: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 20 de 98

Esto satisface

Con Δ= Δp - Δr, esto es una elipse rotada en un ángulo .

Figura 3.2: Onda incidente linealmente polarizada y onda reflejada elípticamentepolarizada.

El ángulo de rotación de los ejes de la elipse satisfaceErs

Erptan ,medible con

polarizadores. es medible usando polarizadores.Hay métodos más sofisticados usando dispositivos optoelectrónicos, que son de utilizacióncorriente, como el elipsometro.

Memoria descriptiva

Page 21: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 21 de 98

Figura 3.3: elipsometro

3.2.2. Efectos de interferencia en capas delgadas.

En la vida real, no hay superficies iguales al bulto. La superficie puede estar oxidada, tener

rugosidad, o sufrir daos o reconstrucción, lo cual le cambia las constantes 1, 2 (o n, k).

El modelo mas simple supone una capa intermedia entre el aire y el sustrato que se quieremedir.

Figura 3.4: reflexión de múltiples intercaras y su efecto en la transmitancia de una película delgada

(T=1-R).

Donde 2 es igual a la diferencia de fase entre dos reflexiones sucesivas

3.2.3. Obtención del

La diferencia de camino óptico

Memoria descriptiva

Page 22: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 22 de 98

Con esto finalmente tenemos que:

La amplitud de la onda reflejada es la interferencia de las reflexiones en las intercaras 1-2 y 2-3. Entonces la amplitud de reflexión neta es:

Usando r21 = -r12 y t12t21 =1 – r212 obtenemos:

Si al medir tanψ y Δ se calculan 1 y 2 con un modelo AIRE/SUSTRATO, a 1 + i 2 sele llama pseudofunción dieléctrica. Volveremos sobre este tema más adelante. Solamente si la

superficie esta limpia y sin dado, la pseudofunción dieléctrica ser la verdadera (ω).

3.3. Rugosidad.

La mayoría de las muestras utilizadas en laboratorios, son generadas sobre sustratos, donde seforman capas rugosas de materiales, como se observa en la figura.

Memoria descriptiva

Page 23: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 23 de 98

Figura 3.5: Esquema de la rugosidad superficial. [Adachi, 1999].

En estos casos, se realiza una aproximación sobre el modelo que mejor describe la superficie,modelos piramidales, semiesféricos, etc. Para ello también se utilizan imágenes obtenidas convariados métodos, como se observa en la figura a continuación.

Figura 3.6: Imagen AFM de superficie de Cu(110) [Stahrenberg et al, PRB64, 115111 (2001)].

En lo que prosigue haremos un análisis más electrodinámico del material, para comprender larugosidad.

3.3.1. Campo Local.

Distinción entre el campo 'E

que actúa sobre un tomo y el campo promediado EEE

' .

Para calcular Δ 'E

, consideremos una división del espacio entre una esfera de radio R grandecomparado con sus dimensiones, y el resto del medio. Tenemos:

inE

se puede calcular dado el punto de vista microscópico, tomo por tomo.outE

puede

calcularse con un enfoque macroscópico.outE

es el campo del dieléctrico dentro de la

cavidad vaca.Consideremos que los tomos o moléculas dentro de la cavidad se pueden representar por dipolospuntuales.

Donde R

son las posiciones de los tomos y

R

dsus dipolos.

Memoria descriptiva

Page 24: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 24 de 98

Si los tomos no tienen momento dipolar permanente, sino que la polarización es inducida

por el campo local, entonces

EtocR

d , Eloc es el mismo para todos, donde es la

polarizabilidad.

Donde R =

Rd ,( .En un medio desordenado R se convierte en 2R sindRddψ.

Veamos que :

Es decir 0E in

en un medio desordenado. De hecho en una red cúbica, la evaluación

cuidadosa da que 0E in

.

3.3.2. Campo Exterior.

La discontinuidad de

P en el borde produce una carga de polarización.

Si integramos sobre el volumen del cilindro (ver figura) la expresión anterior:

Memoria descriptiva

Page 25: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 25 de 98

Figura 3.7: La discontinuidad de

P . en el borde produce una carga de polarización.

cuando 0h , polpol h · , por lo tanto de las ecuaciones anteriores obtenemos:

pero P1n = 0 y P2n = P cos(θ) como muestra la figura, entonces la expresión final para la

densidad de carga polarizada es

El campo eléctrico en el centro de la esfera generado por esta carga de polarización es

paralelo a

P

Este viene a ser el campo en la posición atómica. Una aproximación mejor será :

Memoria descriptiva

Page 26: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 26 de 98

Con 0 1, esto da cuenta de los dipolos no son puntuales. = 0 es el caso deelectrones libres deslocalizados.

Como simplificación adicional, supondremos que el medio es isótropo. En tal caso la

polarización inducida

P es paralela a

Etoc , con un coeficiente de proporcionalidad que esindependiente de la dirección.

Reemplazando el valor del campo eléctrico local antes mostrado, obtenemos

donde V

Nn

densidad de dipolos, ordenando la expresión anterior

Por lo tanto el desplazamiento eléctrico

D es:

Finalmente tenemos que :

Poniendo = 1 se obtiene la formula de Clausius-Mossolti.

Esta formula es valida cuando n es muy pequeño, que es el caso para gases enrarecidos.

Memoria descriptiva

Page 27: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 27 de 98

3.3.3. Modelo de Medio Efectivo.

El modelo de aproximación de medio-efectivo de Bruggeman (EMA), el de Lorentz-Lorenz (LL) y el de Maxwell Garnett (MG) son teorías simples de medio efectivo, querepresentan una mezcla dieléctrica heterogénea. Todos los modelos LL, MG y EMA tienenla misma forma genérica:

Donde < >, h, 1, 2,... son las funciones dieléctricas (complejas) de un medio efectivo,medio servidor e inclusiones del tipo 1,2,…..en el servidor respectivamente y donde v1,

v2,... representan fracciones de volumen (1 vi

i ) del material del tipo 1,2,... en elvolumen total.

En la aproximación LL, la cual fue desarrollada para describir entidades de puntospolarizadles, de polarizabilidad , insertadas en vacío, h = 1,< >= y vi es igual a las

fracciones volumen, donde ivi 1

La relación LL es usualmente expresada en términos de la polarizabilidad i , la cual

esta relacionada con la función dieléctrica macroscópica por la relación Clausius-Mossotti :

En el modelo MG1 el sustrato es insertado en un servidor hueco (Eh = 1) siendoidéntico al modelo LL. En el modelo MG2 los huecos son insertados en el sustrato. Siasumimos un medio hipotético, por ejemplo, de 50 % de huecos y 50 % de sustrato, losresultados LL y MG1 son idénticos pero son muy diferentes los resultados de MG2 a pesardel hecho que las fracciones de volumen relativas son idénticas. Los modelos MG1 y MG2difieren solo en la opción del material del servidor.

En el modelo de Bruggeman, se reemplaza h por < >, es decir, dejando que el medioefectivo actúe como medio servidor.

Donde ivi 1 y <> es la solución numérica de la ecuación anterior. Las formulas de

LL, MG y EMA se reducen simplemente a opciones diferentes de la función dieléctrica delmaterial servidor Eh. Para elegir el modelo de medio efectivo correcto a usar, depender de lascondiciones del sistema.

Memoria descriptiva

Page 28: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 28 de 98

Figura 3.8: Comparación de la parte imaginaria 2 de la función dieléctrica efectiva para unamezcla con 50% de sustrato y 50% de huecos calculada con los modelos LL, MG1, EMA y MG2.

Para el caso en que L « λ, siendo L la longitud característica de la rugosidad, se modela el

medio rugoso o poroso como una mezcla física de material y vacío, con < > efectiva.

Para una superficie dada y mediciones de elipsometría tan exp ,cos exp,se pueden hacer modelos

y obtener tan calc y cos calc .

La última parte del proceso es comparar los valores medidos con las predicciones del modelobasadas en las ecuaciones de Fresnel. El procedimiento de análisis usualmente se denomina ajustede datos, ya que los parámetros ajustables del modelo se varan para encontrar el mejorajuste de los datos generados a los datos experimentales reales. Los parámetros de ajuste autilizar acordes al modelo seleccionado pueden ser: los grosores de las películas, loscoeficientes de la relación de dispersión para sus constantes ópticas, fracciones de volumen,etc. Existen diferentes algoritmos de ajuste para el análisis de datos ópticos. El objetivo esdeterminar rápidamente el modelo que exhibe la menor diferencia (mejor ajuste) entre los datosmedidos y los calculados. La raíz del error cuadrático medio se utiliza para cuantificar la diferenciaentre los datos experimentales y los predichos, considerando las desviaciones estándar de las cantidadesexperimentalmente medidas, exp. Para mediciones espectroscópicas con un elipsometro deanalizador rotatorio, el cual determina los valores de tan( ) y cos(Δ), el valor se calcula

Donde N es el número de datos experimentales (a distintas ), P es el número de parámetrosdesconocidos.Vemos algunos resultados para el Si.

Memoria descriptiva

Page 29: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 29 de 98

Figura 3.9: Pseudo ε del Si con la corrección de la rugosidad simulada con la teoría del medio efectivo.[Adachi, 1999].

En la Figura se presenta el espectro de para el silicio obtenido por espectroscopia elipsométrica.Las transiciones electrónicas (puntos críticos) ocurren para energías cercanas a los 3.4 y 4.3 eV, y se

manifiestan como máximos en 2. Este espectro puede representarse adecuadamente con unageneralización del modelo de oscilador armónico. La rugosidad puede determinarseindependientemente mediante AFM [Adachi et al, J. Appl. Phys. 80, 5422 (1996)] y comprobar deacuerdo con las mediciones ópticas.

3.4. Figuras originales.

3.4.1. Efectos de interferencia en capas delgadas.

3.4.2. Efectos de película de óxido.

3.4.3. Rugosidad.

Memoria descriptiva

Page 30: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 30 de 98

Figura 3.10: a) Esquema de polarizaciones de la luz para el cálculo de los coeficientes de

Fresnel. b) Elipsometro. c) Reflectancia en función del ángulo de incidencia.

Figura 3.11: Reflexión en múltiples intercaras y su efecto en la transmitancia de una película

delgada (T=1-R).

Memoria descriptiva

Page 31: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 31 de 98

Figura 3.12: a)Pseudo 2 del GaAs con la corrección por la capa de óxido. [Aspnes and

Studna, PRB 27, 985 (1983)]. b) Pseudo del Si con la corrección por la capa de óxido.[Adachi, 1999].

Figura 3.13: Imagen AFM de superficie de Cu(110) [Stahrenberg et al, PRB64, 115111 (2001)].

Memoria descriptiva

Page 32: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 32 de 98

Figura 3.14: Esquema de la rugosidad superficial. [Adachi, 1999].

Figura 3.15: Pseudo del Si con la corrección de la rugosidad simulada con la teoría delmedio efectivo. [Adachi, 1999].

3.5 Transiciones Interbanda.

3.5.1. Teoría de Transiciones Interbanda.

Vamos a estar enmarcados en la Aproximación monoelectrónica.Consideremos un Hamiltoniano monoelectrónico :

De ac )(

rV ) es el potencial ocasionado por los núcleos y los demás electrones, y conocemos del

Hamiltoniano sus autofunciones ψn )(

r ) y autoenergías En y su ocupación f(Ei)

(probabilidad de que este ocupado el estado Ei) que por lo general es de la forma

1

1)(

EfEie

f

En donde:

Memoria descriptiva

Page 33: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 33 de 98

Sea un campo electromagnético, caracterizado por :

Donde cc. es el complejo conjugado del primer término, también

qe , con esto tenemos

que nuestro Hamiltoniano toma la forma:

De esta forma, cortando términos de orden 2oA tenemos :

Con Teoría de perturbaciones, la probabilidad de absorción de un fotón, que es igual a laprobabilidad de transición, esta dada por :

Reemplazando W nos queda :

Así también tenemos la probabilidad de emisión inducida:

La probabilidad de Transmisión neta de pasar del estado i al estado j esta dada por:

entonces :

Veamos lo que ocurre con el término

Memoria descriptiva

Page 34: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 34 de 98

Recordando que :

entonces :

Utilizando ahora el hecho de que

qe , nos queda que :

Por lo tanto ijji PP .

Además )()())(1)(())(1)(( EjfEifEifEjfEjfEif

De esta manera nos queda:

Finalmente, la energía absorbida por unidad de tiempo es:

Por otra parte : La energía disipada por unidad de tiempo, por un campo eléctrico :

con

.

Page 35: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 35 de 98

en donde:

El termino

EJ · , queda:

Promediando :

Donde 21 = + ∗.

Ahora integramos esto, lo que nos deja :

Recordemos que :

con esto

es decir, tenemos la parte imaginaria de la constante dieléctrica. Entonces:

Memoria descriptiva

Page 36: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 36 de 98

Finalmente:

Este resultado lleva un factor 2 adicional causado por la degeneración de spin. Si queremoscalcular la parte real de la constante dieléctrica, nos basta usar las relaciones de Kramers-Krönig.

3.5.2. Transiciones banda-banda.

Cuando existen condiciones de simetría periódica, como en sólidos, las funciones de onda sepueden escribir de la forma (Teorema de Bloch):

Donde

Para cada

k , hay una secuencia de soluciones para uk(k

) y E(k

). Entonces de la ecuación de

Schrödinger, tenemos que :

Lo que nos lleva a:

Para k

dado, E=En(k

) u=unk (r

)

El conjunto de todos los puntos En(k

) para n dado y todos los k

posibles, se llama banda.

Page 37: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 37 de 98

El conjunto de puntos k

que dan soluciones linealmente independientes esta limitado a la

primera zona de Brillouin (1ZB). La 1ZB es la región del espacio, tal que |k

| < |k

-G

|

para todo 321 bbbG lkh

,vector de la llamada red recíproca (RR).

Con esto entonces nos estamos acercando a nuestro valor de la constante dieléctrica,recordemos que 1 puede obtenerse va Kramers-Krönig. Para continuar entonces, se puedeusar la relación :

Por tanto para tener la constante dieléctrica total, basta reemplazar la delta, quedándonos:

El decaimiento espontáneo del estado excitado Ej se puede tener en cuenta mediante:

conh

tiempo de vida medio.

La expresión (q

, ω) puede ser reducida, bajo ciertas aproximaciones, a la (q

, w) que se

obtiene de la ecuación de Boltzmann.

Además dentro de la 1ZB, k

toma valores:

Donde mi=0, 1, 2,……, 2

),12

(NiNi

Siendo Ni el numero de celdas cristalinas en la dirección i.

Para un cristal infinito, Ni → ∞ y

k . toma los valores continuos.

Memoria descriptiva

Page 38: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 38 de 98

Entonces las ψi y ψj se pueden denotar como :

ψi = ψv,

k i(

r ) Banda v (valencia o core).

ψj = ψc,

k j(

r ) Banda c (conducción).

Para el caso de los aislantes, f(Ei ) = 1, f(Ej) = 0.

Veamos la integral:

Recordemos que la derivada de una función periódica es otra función periódica.

en donde

rGi

kiGeGuGih )( una función periódica.

Entonces, nuestro término de la constante dieléctrica nos queda de la forma

donde el último término de la integral pude escribirse de la forma (Recordemos procedimientosimilar realizado en la sección anterior) :

De esta forma entonces, el término de la constante dieléctrica nos queda :

en donde:

Memoria descriptiva

Page 39: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 39 de 98

es una función periódica.La integral del termino de la constante dieléctrica no se anula, solo si el argumento de la

exponencial

Gkikjq )( ~ki) donde RRG

(red reciproca).

Ahora bien, como

ik y

jk estan en la 1ZB, entonces podemos tener que 0

q y

ik =

jk

Cuando 0

q hablamos de la aproximación Dipolar, y cuando

ik =

jk se habla de

transiciones verticales.

Lo anterior es una regla de selección ocasionada por la simetría de traslación del cristal. Con

esta regla de selección se simplifica el valor de la parte imaginaria de la constante dieléctrica .

con ZBk 1

, esta es la fórmula fundamental de las transiciones ópticas en cristales o sistemas

periódicos.

Ahora como

i

biNi

miko , tenemos que un punto

k ocupa un volumen:

Con esto

k

kdV 3

3)2( ,, quedándonos la constante dieléctrica de la forma:

Donde .··)(

kckc

pkpcv

3.5.3. Algunos Casos.

Hay materiales en los que los electrones están muy ligados, 2 depende de la topología de lasbandas, y en particular, de las diferencias entre Evk y Eck. Las regiones particularmenteimportantes, son las regiones de la 1ZB en donde Eck-Evk ≈ cte.

Memoria descriptiva

Page 40: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 40 de 98

Para continuar recordemos que .··)(

kckc

pkpcv , y usando el hecho de que

k

kdV 3

3)2( donde

i

biNi

miko , con esto obtenemos la ecuación:

En general )(·

kpe cv es una función suave de

k y (ω) tiene una gran correlación con la

llamada Densidad Conjunta de Estados (JDOS).

En donde se utiliza la formula mas conveniente dado el problema. Los puntos

k en que0)( EvkEckk se llaman puntos críticos. La integral mata las singularidades, pero hay

variaciones rápidas, es decir, en estos puntos críticos, pueden integrarse analíticamente.Consideremos el caso de los semiconductores.

3.6. Punto crítico M0.

En el borde de absorción, las energías de las bandas de conducción (c) y de valencia (v)son de la forma

Con esto la diferencia de energía esta dada por:

DondeLa superficie de integración es:

Esto conforma un elipsoide, donde su ecuación analítica esta dada por :

Memoria descriptiva

Page 41: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 41 de 98

con

Ahora el área del elipsoide que este descrito por la ecuación anterior nos facilita el cálculode la integral de volumen que esta dada por:

haciendo cambio de coordenadas:

Con esto tenemos entonces :

Utilizando:

Obtenemos :

Entonces tenemos que EghJ cv . Este es el llamado punto crítico M0.

Memoria descriptiva

Page 42: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 42 de 98

3.6.1 Transiciones prohibidas en el punto crítico M0.

Puede darse el caso de que en el punto crítico

ko , ocurra que 0)(

kopcv . En este caso es

importante la variación de

cvp . Expandiendo en serie tenemos :

entonces :

es un vector, y

kKoMcvpe cv )·(· , con esto tenemos entonces que la parte imaginaria de

la función dieléctrica es :

Punto critico M0 en -.k0 = 0. Contribución de bandas cv. Entonces,

es mas complicado.En el caso en que 1 = 2 = 3, se obtiene que :

3.7. Punto de Ensilladura M1.

Tomemos el caso:

Memoria descriptiva

Page 43: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 43 de 98

Sea 3 < 0; 1, 2 > 0, entonces

332

32

kh

q

, entonces tenemos :

Utilizamos ahora coordenadas cilíndricas, cos1 qq , sin2 qq , q3=q3 y d

3.

q = 3dqddqq . Entonces tenemos que:

Se debe notar que la superficie de integración no puede salirse de la 1ZB, y la dependenciacuadrática con qi esta limitada a puntos cercanos, esto es una tendencia.Entonces :

DondeΘ(x) es la función escalón de Heavyside. Finalmente nuestro resultado queda:

Memoria descriptiva

Page 44: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 44 de 98

3.8. Cristales Bidimensionales.

Lo siguiente es válido para superficies, pozos quánticos o estructuras de capas, en que losfenómenos ocurren confinados en ciertos planos cristalinos. El grafito es un ejemplo de esto. Sederiva principalmente de un cristal 3D para el caso en que 3→ ∞.

Tabla I : Resultados para cristales bidimensionales.

3.9. Cristales Unidimensionales.

Un ejemplo clásico de este caso, son los nanotubos. Tenemos entonces que :

Memoria descriptiva

Page 45: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 45 de 98

3.10. Constante dieléctrica de un sistema de osciladores quánticos.

Finalmente :Para el caso en que µ < 0 tenemos que :

Tenemos un punto crítico 0-dimensional donde Eck - Evk E0.

Donde D0 incluye las constantes, esto es un oscilador y coincide con el modelo de Lorentz.Corresponde a bandas paralelas en una amplia región del espacio.

Notemos que en la deducción de la regla de oro de Fermi )(2

hEEEh

P ijji ,

se hace uso explícito de que h> 0 y se desprecian términos de menor orden. Si no se desprecianestos términos y se considera el tiempo de vida finito, se obtiene :

Con > 0. Esta forma cumple la propiedad ()∗ = (-)

3.11. Radiación en la materia.

Si la materia es expuesta a la radiación electromagnética, por ejemplo a la luz infrarroja, laradiación puede ser absorbida, transmitida, reflejada, dispersada o puede sufrir lafotoluminiscencia.La fotoluminiscencia es un término que se usó para designar un tipo de efectos como lafosforescencia y la dispersión de Raman.

Memoria descriptiva

Page 46: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 46 de 98

Reflexión

Figura 3.11.1. Reflexión.

Transmisión

Figura 3.11.2. Transmisión

Absorción

Figura 3.11.3. Absorción

Memoria descriptiva

Page 47: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 47 de 98

Dispersión

Figura 3.11.4. Dispersión

3.12.Ecuaciones de dispersión del índice de refracción.

3.12.1. La ecuación de Cauchy.

La ecuación de Cauchy es una relación empírica entre el índice de refracción n y lalongitud de onda de la luz para un material transparente λ. La forma general de la ecuaciónde Cauchy de la es:

Donde A, B, C, etc, son los coeficientes que se pueden determinar para un materialdeterminado de la ecuación para medir índices de refracción conocidas las longitudes deonda.

Por lo general, es suficiente con utilizar un par de términos de la ecuación:

Donde A y B son los coeficientes de antes.

La tabla de coeficientes de los materiales ópticos se muestra a continuación:

Memoria descriptiva

Page 48: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 48 de 98

La teoría de la interacción luz-materia en la que se basa esta ecuación de Cauchy puede darvalores incorrectos. En particular, la ecuación es válida sólo para las regiones de dispersiónnormal en la región de longitud de onda visible. En el infrarrojo, la ecuación será inexacta,y no puede representar a las regiones de dispersión anómala. A pesar de ello, su sencillezmatemática le hace útil en algunas aplicaciones.

La ecuación Sellmeier es posterior al desarrollo de los trabajos de Cauchy anormalmentedispersivo que se ocupa de las regiones, y más exactamente de los modelos de un materialde índice de refracción en todo rango de ultravioletas, visibles e infrarrojos del espectro.

Figura 3.12.1 Gráfica de índice de refracción frente a la longitud de onda de vidrio BK7.Cruces rojas muestran los valores medidos. Más de la región visible (rojo sombreado), la

ecuación de Cauchy (línea azul) y de acuerdo con la medición de índices de refracción y laSellmeier parcela (verde línea discontinua). Se desvía en el ultravioleta y el infrarrojo

regiones

Memoria descriptiva

Page 49: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 49 de 98

3.12.2. Ecuación de sellmeier.

En óptica la ecuación Sellmeier es una relación empírica entre el índice de refracción n y λla longitud de onda para un medio transparente. La forma usual de la ecuación de las lenteses

Donde B 1,2,3 y C 1,2,3 son determinado experimentalmente Sellmeier coeficientes Estoscoeficientes suelen ser citado para. λ en micrómetros. Tenga en cuenta que esta λ es lalongitud de onda de vacío, que no en el propio material, que es λ y n (λ).

La ecuación se utiliza para determinar la dispersión de la luz en un medio refractantes. Unaforma diferente de la ecuación a veces se utiliza para algunos tipos de materiales, porejemplo los cristales.

La ecuación fue deducida en 1871 por W. Sellmeier, y es un desarrollo de los trabajos deCauchy Augustin Cauchy en la ecuación para la elaboración de modelos de dispersión.

A modo de ejemplo, los coeficientes de una corona de vidrio borosilicato conocido comoBK7 se muestran a continuación:

El Sellmeier coeficientes para muchos lentes ópticas comunes se pueden encontrar en elcatálogo de vidrio Schott, o en el Catálogo de Ohara.

Para lentes ópticas comunes, el índice de refracción calculado con tres coeficientes de laecuación Sellmeier se desvía de la actual índice de refracción en menos de 5 × 10 -6 másde la gama de longitudes de onda de 365 nm a 2,3 μ m [1], que es del orden de lahomogeneidad de una muestra de vidrio [2]. Términos adicionales se añade a veces parahacer el cálculo más preciso. En su forma más general, la ecuación de Sellmeier se dacomo

Con cada término de la suma que representa una absorción de fuerza de resonancia B, enuna longitud de onda i √ C i. Por ejemplo, los coeficientes de BK7 anteriormente

Memoria descriptiva

Page 50: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 50 de 98

corresponden a dos resonancias de absorción en el ultravioleta, y una en la región delinfrarrojo medio. Cerca de absorción de cada pico, la ecuación no da física de los valores n= ± ∞, y, en estas regiones de longitud de onda de manera más precisa el modelo dedispersión, como la Helmholtz debe utilizarse.

Si todos los términos se especifican para un material, a las longitudes de onda larga lejosde los picos de absorción el valor de n tiende a

donde ε es la constante dieléctrica del medio.

La ecuación de Sellmeier también puede administrarse en otra forma:

Aquí, el coeficiente A es una aproximación de la longitud de onda corta (por ejemplo,ultravioleta), la absorción de las contribuciones para el índice de refracción en longitudesde onda más largo. Otras variantes de la ecuación de Sellmeier cuenta que pueden existirpara un índice de refracción del material de cambio, debido a la temperatura, la presión, yotros parámetros.

Memoria descriptiva

Page 51: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 51 de 98

Coeficientes

Figura 3.12.2 Un gráfico de índice de refracción frente a la longitud de onda de vidrioBK7, mostrando los puntos medidos (cruces azules) y una porción de la ecuación Sellmeier

(línea roja).

Memoria descriptiva

Page 52: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 52 de 98

4. Entorno MATLAB.

4.1. Entorno gráfico GUIDE con MATLAB.

4.1.1. Herramienta GUIDE.

GUIDE es un entorno de programación visual disponible en MATLAB para realizar yejecutar programas que necesiten ingreso continuo de datos. Tiene las característicasbásicas de todos los programas visuales como Visual Basic o Visual C++.

4.1.2. Inicio

Para iniciar nuestro proyecto, lo podemos hacer de dos maneras:

Ejecutando la siguiente instrucción en la ventana de comandos:

>> guide

Haciendo un click en el ícono que muestra la figura:

Fig. 4.1. Icono GUIDE.

Se presenta el siguiente cuadro de diálogo:

Fig. 4.2. Ventana de inicio de GUI.

Se presentan las siguientes opciones:

Entorno MATLAB

Page 53: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 53 de 98

a) Blank GUI (Default)La opción de interfaz gráfica de usuario en blanco (viene predeterminada), nos presentaun formulario nuevo, en el cual podemos diseñar nuestro programa.

b) GUI with UicontrolsEsta opción presenta un ejemplo en el cual se calcula la masa, dada la densidad y elvolumen, en alguno de los dos sistemas de unidades. Podemos ejecutar este ejemplo yobtener resultados.

c) GUI with Axes and MenuEsta opción es otro ejemplo el cual contiene el menú File con las opciones Open, Printy Close. En el formulario tiene un Popup menu, un push button y un objeto Axes,podemos ejecutar el programa eligiendo alguna de las seis opciones que se encuentranen el menú despegable y haciendo click en el botón de comando.

d) Modal Question DialogCon esta opción se muestra en la pantalla un cuadro de diálogo común, el cual constade una pequeña imagen, una etiqueta y dos botones Yes y No, dependiendo del botónque se presione, el GUI retorna el texto seleccionado (la cadena de caracteres ‘Yes’ o‘No’).

Elegimos la primera opción, Blank GUI, y tenemos:

Fig. 4.3. Entorno de diseño de GUI

Entorno MATLAB

Page 54: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 54 de 98

La interfaz gráfica cuenta con las siguientes herramientas:

Para obtener la etiqueta de cada elemento de la paleta de componentes ejecutamos:

File>>Preferentes y seleccionamos Show names in component palette. Tenemos la

siguiente presentación:

Fig. 4.4. Entorno de diseño: componentes etiquetados.

La siguiente tabla muestra una descripción de los componentes:

54

Entorno MATLAB

Page 55: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 55 de 98

4.1.3. Propiedades de los componentes.

Cada uno de los elementos de GUI, tiene un conjunto de opciones que podemos accedercon click derecho.

Fig.4.5. Opciones del componente.

Fig.4.6. Entorno Property Inspector.

Permite ver y editar las propiedades de un objeto.

La opción Property Inspector nos permite personalizar cada elemento.

55

Entorno MATLAB

Page 56: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 56 de 98

Al hacer click derecho en el elemento ubicado en el área de diseño, una de las opcionesmás importantes es View Callbacks, la cual, al ejecutarla, abre el archivo .m asociado anuestro diseño y nos posiciona en la parte del programa que corresponde a la subrutina quese ejecutará cuando se realice una determinada acción sobre el elemento que estamoseditando.Por ejemplo, al ejecutar View Callbacks>>Callbacks en el Push Button, nos ubicaremosen la parte del programa:

function pushbutton1_Callback(hObject, eventdata, handles) %hObjecthandle to pushbutton1 (see GCBO)

%eventdata reserved-to be defined in a future version of MATLAB %handlesstructure with handles and user data (see GUIDATA)

4.1.4. Funcionamiento de una aplicación GUI.

Una aplicación GUIDE consta de dos archivos: .m y .fig. El archivo .m es el que contieneel código con las correspondencias de los botones de control de la interfaz y el archivo .figcontiene los elementos gráficos.

Cada vez que se adicione un nuevo elemento en la interfaz gráfica, se generaautomáticamente código en el archivo .m.

Para ejecutar una Interfaz Gráfica, si la hemos etiquetado con el nombre curso.fig,simplemente ejecutamos en la ventana de comandos >> curso. O haciendo click derechoen el m-file y seleccionando la opción RUN.

4.1.5. Manejo de datos entre los elementos de la aplicación y el archivo .M.

Todos los valores de las propiedades de los elementos (color, valor, posición, string…) ylos valores de las variables transitorias del programa se almacenan en una estructura, loscuales son accedidos mediante un único y mismo identificador para todos éstos. Tomandoel programa listado anteriormente, el identificador se asigna en:

handles.output = hObject;

handles, es nuestro identificador a los datos de la aplicación. Esta definición deidentificador es salvada con la siguiente instrucción:

guidata(hObject, handles);

guidata, es la sentencia para salvar los datos de la aplicación.

Aviso: guidata es la función que guarda las variables y propiedades de los elementos en laestructura de datos de la aplicación, por lo tanto, como regla general, en cada subrutina sedebe escribir en la última línea lo siguiente:

guidata(hObject,handles);

56

Entorno MATLAB

Page 57: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 57 de 98

Esta sentencia nos garantiza que cualquier cambio o asignación de propiedades o variablesquede almacenado.

Por ejemplo, si dentro de una subrutina una operación dio como resultado una variablediego para poder utilizarla desde el programa u otra subrutina debemos salvarla de lasiguiente manera:

handles.diego=diego;

guidata(hObject,handles);

La primera línea crea la variable diego a la estructura de datos de la aplicación apuntadapor handles y la segunda graba el valor.

4.1.6. Sentencias GET y SET.

La asignación u obtención de valores de los componentes se realiza mediante lassentencias get y set. Por ejemplo si queremos que la variable utpl tenga el valor del Sliderescribimos:

utpl= get(handles.slider1,'Value');

Notar que siempre se obtienen los datos a través de los identificadores handles.

Para asignar el valor a la variable utpl al statictext etiquetada como text1 escribimos:

set(handles.text1,'String',utpl);%Escribe el valor del Slider... %enstatic- text

Entorno MATLAB

Page 58: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 58 de 98

4.2 Matlab optimización.

4.2.1.LSQNONLIN.

Resuelve los mínimos cuadrados no lineales (datos de montaje no lineales) problemas

4.2.1.1 Ecuación.

Resuelve problemas no lineales de mínimos cuadrados de ajuste de curvas de la forma

4.2.1.2 Sintaxis.

x = lsqnonlin(fun,x0)

x = lsqnonlin(fun,x0,lb,ub)

x = lsqnonlin(fun,x0,lb,ub,options)

x = lsqnonlin(problem)

[x,resnorm] = lsqnonlin(...)

[x,resnorm,residual] = lsqnonlin(...)

[x,resnorm,residual,exitflag] = lsqnonlin(...)

[x,resnorm,residual,exitflag,output] = lsqnonlin(...)

[x,resnorm,residual,exitflag,output,lambda] = lsqnonlin(...)

[x,resnorm,residual,exitflag,output,lambda,jacobian] =

lsqnonlin(...)

4.2.1.3 Descripción.

Lsqnonlin resuelve problemas de mínimos cuadrados no lineales, incluyendo los datos demontaje de problemas no lineales.

En lugar de calcular el valor , (La suma de los cuadrados), lsqnonlin requiere lafunción definida por el usuario para calcular el valor del vector función

Entorno MATLAB

Page 59: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 59 de 98

En términos de vectores, puede repetir este problema de optimización como

Donde x es un vector y f (x) es una función que devuelve un vector de valor.

x = lsqnonlin(fun,x0) se inicia en el punto x0 y encuentra un mínimo de la suma de loscuadrados de las funciones descritas en la función. Fun debe devolver un vector de valores,y no la suma de los cuadrados de los valores.

x = lsqnonlin(fun,x0,lb,ub) define un conjunto de límites inferior y superior en el diseño delas variables en x, de manera que la solución está siempre en el rango de lb ≤ x ≤ ub.

x = lsqnonlin(fun,x0,lb,ub,options) minimiza con las opciones de optimizaciónespecificadas en la estructura de las opciones. Utilice optimset para establecer estasopciones. Pass vacía matrices de lb y ub en caso de que no existan límites.

x = lsqnonlin(problem) considera que el mínimo de problema, es un problema que sedescribe en la estructura de entrada de argumentos.

Crear la estructura de la exportación de un problema de optimización de la herramienta, taly como se describe en Exportación MATLAB de trabajo.

[x,resnorm] = lsqnonlin(...) devuelve el valor del cuadrado de 2 de la norma

residual a x: suma (fun (x). ^ 2).

[x,resnorm,residual] = lsqnonlin(...) devuelve el valor residual de la

función(x) en la solución x.

[x,resnorm,residual,exitflag] = lsqnonlin(...) exitflag devuelve un valor

que describe la condición de salida.

[x,resnorm,residual,exitflag,output] = lsqnonlin(...) devuelve

una estructura de la producción que contiene información acerca de la optimización.

[x,resnorm,residual,exitflag,output,lambda] = lsqnonlin(...)

devuelve una estructura lambda cuyos campos contienen los multiplicadores de Lagrange

en la solución x.

[x,resnorm,residual,exitflag,output,lambda,jacobian] =

lsqnonlin(...)devuelve el Jacobiano de la función en la solución x.

Entorno MATLAB

Page 60: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 60 de 98

Nota Si la entrada de los límites especificados por un problema son incompatibles, lasalida x es x0 y los productos residuales y se resnorm .Componentes de x0 que violan loslímites lb≤ x ≤ ub se restablecerá en el interior del cuadro definido por los límites.Componentes que respetan los límites no cambian.

4.2.1.3 Argumentos de entrada.

función de argumentos contiene descripciones generales de los argumentos pasados enlsqnonlin. Esta sección proporciona la función de los detalles específicos para la fun,opciones, y el problema:

fun La función de las plazas cuya suma es mínima. fun es una función que acepta unvector x y devuelve un vector F, el objetivo funciones evaluadas en x. Lafunción de la fun puede especificarse como una función para manejar un M-archivo de la función

x = lsqnonlin(@myfun,x0)Donde myfun MATLAB es una función, comofunction F = myfun(x) función F = F (x)Cálculo de los valores en función de x

fun puede ser también una función para manejar una función anónima.

x = lsqnonlin(@(x)sin(x.*x),x0);

Si los valores definidos por el usuario para x y F son matrices, que se conviertenen un vector lineal utilizando la indexación.

Si el Jacobiano también puede calcularse y el Jacobiano opción es 'on', que deforma.

options = optimset('Jacobian','on')

Entonces, la función debe devolver la diversión, en una segunda salidaargumento, el valor Jacobiano J, una matriz, a x.Tenga en cuenta que por elcontrol de la nargout valor de la función de informática puede evitar J funcuando se llama con un único argumento de salida (en el caso en que elalgoritmo de optimización sólo necesita el valor de F, pero no J).

function [F,J] = myfun(x)(x) = F ... función objetivo de los valores a x sinargout> 1 de la producción de dos argumentos J = ... % Jacobiano% de losevaluados en función de x final

Si la fun devuelve un vector (matriz) de m componentes y ha longitud x n,donde n es la longitud de x0, entonces el Jacobiano J es una mxn matriz donde J(i, j) es la derivada parcial de F (I) con respecto a x (j).(Tenga en cuenta que elJacobiano J es la transposición de la gradiente de F.)

Opciones Options ofrece la función de los detalles específicos de las opciones valores.

Page 61: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 61 de 98

Objetivo La función objetivo

X0 Punto inicial para x

lb Vector de límites más bajos

ub Vector de límites superior

Solver 'Lsqnonlin'

Problema

options Options de la estructura creada con optimset

4.2.1.4 Argumentos de salida.

Función de argumentos contiene descripciones generales de los argumentos devueltos porlsqnonlin. Esta sección proporciona la función de los detalles específicos para exitflag,lambda, y de salida:

Exitflag Sirve para identificar la razón porque ha terminado el algoritmo. La siguiente esuna lista de los valores de exitflag y los correspondientes motivos, el algoritmofinalizados:

1 Función convergido a una solución x.

2 Cambio en la x era inferior a la tolerancia especificada.

3 Cambio en el residual era menos de la tolerancia especificada.

4 Magnitud de la búsqueda dirección fue menor que la toleranciaespecificada.

0 Número de iteraciones superado options.MaxIter o el número deevaluaciones de la función superado options.FunEvals.

-1 Algoritmo fue rescindido por la salida de la función.

-2 Problema es: los límites lb y ub son incompatibles.

-4 Línea de búsqueda no puede disminuir suficientemente el residualde búsqueda a lo largo de la actual dirección.

Lambda Estructura que contiene los multiplicadores de Lagrange en la solución x

(separados por tipo de limitación).Los campos son

lower Lower lb límite bajo

upper Upper ub límite alto

Output Estructura que contiene información acerca de la optimización.Los campos de laestructura son

Page 62: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 62 de 98

firstorderopt Medida de primer orden de optimalidad (en gran escala algoritmo,

[] para otros)

iterations Número de iteraciones adoptadas

funcCount El número de función de las evaluaciones

cgiterations Número total de iteraciones PCG (algoritmo de gran escala, para

los demás []))

Stepsize Final desplazamiento en x (mediana escala algoritmo solamente)

Algorithm Algoritmo de optimización utilizado

Message Salir mensaje

Nota La suma de los cuadrados no debe ser formado explícitamente. En cambio, su funcióndebe devolver un vector de la función de los valores.

4.2.1.5. Opciones.

Optimization options. Puede configurar o cambiar los valores de estas opciones utilizandola función optimset. Algunas opciones se aplican a todos los algoritmos, algunos son sólorelevantes cuando se utiliza el algoritmo de gran escala, y otros son sólo relevantes cuandose utiliza el algoritmo de mediana escala.

La opción LargeScale especifica una preferencia por que el algoritmo a utilizar. Es sólouna preferencia, porque deben cumplirse algunas condiciones para el uso en gran escala omediana escala algoritmo. Para el algoritmo de gran escala, el sistema de ecuaciones nolineales no se puede indeterminar, es decir, el número de ecuaciones (el número deelementos de F devuelto por función) debe ser de al menos tanto como la longitud de x.Además, sólo la gran escala algoritmo maneja obligado limitaciones:

LargeScale Uso de gran escala, es posible cuando el algoritmo establecido para 'activar'.

Uso de mediana escala algoritmo cuando esta en 'off'.

El algoritmo de gran escala es un algoritmo más moderno que el algoritmo de medianaescala.

4.2.1.4.1. Algoritmos de mediana i larga escala.

Estas opciones son utilizadas por ambas:

Page 63: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 63 de 98

DerivativeCheck Comparar el usuario suministra derivados (Jacobiano) finito-diferenciando a los derivados.

Diagnostics Mostrar información de diagnóstico acerca de la función que se reducenal mínimo.

DiffMaxChange Máximo cambio en las variables de diferenciando finito.

DiffMinChange Mínimo cambio en las variables de diferenciando finito.

Display Nivel de la pantalla. "Off" muestra ninguna salida; 'iter' muestra laproducción en cada iteración; 'final' (por defecto) muestra sólo elproducto final.

Jacobina Si 'on’, lsqnonlin utiliza un Jacobiano definidas por el usuario (definidoen la fun o Jacobiano información (cuando se usa JacobMult), de lafunción objetivo. Si "off", se aproxima a la lsqnonlin Jacobiano usandodiferencias finitas.

MaxFunEvals El número máximo de la función evaluaciones permitido.

MaxIter Número máximo de iteraciones permitido.

OutputFcn Especifique una o más funciones definidas por el usuario que unallamada a función de optimización en cada iteración. Vease la función desalida.

PlotFcns Plotea diversas medidas de progreso mientras se ejecuta el algoritmo,seleccione una de las parcelas predefinidos o crear uno propio. lots thestep size;@optimplotfirstorderopt plots the first-order of optimality.Especificar @ optimplotx parcelas de la actual punto;@ optimplotfunccount parcelas de la función de contar;@ optimplotfval parcelas el valor de la función;@ optimplotresnorm parcelas en la norma de los residuos;@ optimplotstepsize dimensiones de los pasos de las parcelas;@ optimplotfirstorderopt las parcelas de primer orden de optimalidad.

TolFun Rescisión tolerancia en el valor de la función.

TolX Tolerancia. x

TypicalX Típico x valores.

4.2.1.4.1.1. Solo algoritmo de larga escala.

Estas opciones sólo se utilizan por la gran escala algoritmo:

JacobMult Función para manejar Jacobiano multiplicar función. Para gran escalaestructurada problemas, esta función calcula la matriz productoJacobiano J * Y, J '* Y, J o' * (J * Y), pero sin que formen J. La

Entorno MATLAB

Page 64: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 64 de 98

función es de la forma

W = jmfun(Jinfo,Y,flag,p1,p2,...) W = jmfun (Jinfo, Y, bandera, p1,p2 ,...)

Donde Jinfo y los parámetros adicionales p1, p2, ... contener lasmatrices utilizadas para calcular J * Y (o J '* Y, J o' * (J * Y)). Elprimer argumento Jinfo debe ser el mismo que el segundo argumentodevuelto por la función objetivo la diversión, por ejemplo,

[F,Jinfo] = fun(x) [F, Jinfo] = fun (x)

Y es una matriz que tiene el mismo número de filas, ya que haydimensiones en el problema. También determina que para calcular elproducto:

Si flag== 0 entonces W = J '* (J * Y). Si flag> 0 entonces W = J * Sí. Si flag <0 entonces W = J '* Sí.

En cada caso, no está formado J explícitamente. Lsqnonlin usos Jinfopara calcular la preconditioner. Los parámetros opcionales p1, p2, ...puede ser cualquier parámetros adicionales necesarios por jmfun.

Nota 'Jacobiano' debe estar configurado para 'activar' para Jinfo que se pasó de fun ajmfun.

JacobPattern Patrón de la Jacobiano para diferenciado finito. Si no es convenientepara calcular la matriz Jacobiano J, en la fun, lsqnonlin puedeaproximar a través de J escasa diferencias finitas, a condición de laestructura de J, es decir, lugares de la nonzeros, se presenta en el valorde JacobPattern. En el peor de los casos, si la estructura esdesconocida, se puede establecer que JacobPattern es una densamatriz y una plena aproximación por diferencias finitas, se calcula encada iteración (esto es el valor por defecto si no se estableceJacobPattern).Esto puede ser muy costoso para los grandes problemas,por lo que está vale la pena el esfuerzo para determinar la estructurade la escasez.

MaxPCGIter El número máximo de PCG (gradiente precondicionado conjugado)iteraciones.

PrecondBandWidth El valor por defecto es PrecondBandWidth 'Inf », que significa unadirecta factorización (Cholesky) se utiliza en lugar de los gradientesconjugados (CG). La factorización directa es computacionalmentemás dificil que el CG, pero produce una mejor calidad paso hacia lasolución. Set PrecondBandWidth to 0 para precondicionamientodiagonal (ancho de banda de 0).Para algunos problemas, un ancho debanda intermedia reduce el número de iteraciones PCG.

TolPCG Rescisión tolerancia en el PCG iteración.

Entorno MATLAB

Page 65: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 65 de 98

4.2.1.4.1.2 Solo para algoritmo de mediana escala.

Estas opciones sólo se utilizan por el algoritmo de mediana escala:

LevenbergMarquardt Elija Levenberg-Marquardt más de algoritmo de Gauss-Newton.

LineSearchType Línea algoritmo de búsqueda elección.

4.2.1.4.2. Ejemplos.

Buscar x que minimiza

Comenzando en el punto x = [0,3, 0,4].

Porque lsqnonlin asume que la cantidad de plazas no está explícitamente formada en lafunción definida por el usuario, la función pasa a lsqnonlin debe calcular el vector-valoradafunción

Para k = 1 a 10 (es decir, M debería haber k componentes).

En primer lugar, escribir un M-archivo para calcular el componente de vectores k-F.

function F = myfun(x) k = 1:10;

F = 2 + 2*k-exp(k*x(1))-exp(k*x(2));

Myfun función F = (x) k = 1:10;

F = 2 + 2 * k-exp (k * x (1))-exp (k * x (2));

A continuación, invocar una rutina de optimización.

x0 = [0,3 0,4]%

A partir fun [x, resnorm] = lsqnonlin (@ myfun, x0)% optimizadorDespués de cerca de 24 evaluaciones de la función, este ejemplo le da la soluciónX = 0,2578 0,2578% resnorm residual o suma de los cuadrados resnorm = 124,3622

Entorno MATLAB

Page 66: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 66 de 98

4.2.1.4.2.1 Optimización de gran escala.

Por defecto lsqnonlin elige el algoritmo de gran escala. Este algoritmo es un subespacioconfianza de la región y el método se basa en el método Newton reflexivo interior que sedescribe en 1 y 2 Cada iteración implica la solución aproximada de un gran sistema linealmediante el método de gradientes precondicionada conjugada (PCG).

4.2.1.4.2.2 Optimización mediana escala.

Si establece la opción de LargeScale 'off' con optimset, lsqnonlin utiliza el método deLevenberg-Marquardt con la línea de búsqueda [4], [5] y [6]. Si lo prefiere, puedeseleccionar un método de Gauss-Newton [6] con la línea de búsqueda mediante elestablecimiento de la LevenbergMarquardt opción de 'off' (y LargeScale a "off") con

optimset. El método de Gauss-Newton es generalmente más rápido en el residualpequeño.

4.2.1.4.3 Limitaciones.

Las funciones que se reduzcan al mínimo deben ser continuas. Lsqnonlin sólo puede darsoluciones locales.

Lsqnonlin sólo se ocupa de las variables reales. Cuando x tiene variables complejas, lasvariables deben ser divididas en partes real e imaginaria.

4.2.1.4.3.1. Optimización a gran escala.

El método a gran escala para lsqnonlin no resuelve indeterminados sistemas, requiere queel número de ecuaciones (es decir, el número de elementos de F) ser al menos tan grandecomo el número de variables. En el caso indeterminado, el algoritmo de mediana escala seutiliza en su lugar. (Si existen limitaciones vinculadas, se emite una advertencia y seresuelve el problema con los límites ignorados.) Véase problema grande de cobertura yrequisitos para obtener más información sobre qué problema formulaciones están cubiertosy el tipo de información que debe proporcionarse.

El precondicionadores utilizados en el gradiente conjugado previamente parte de la granescala de las formas método J T J (donde J es la matriz Jacobiano) precondicionó antes dela computación, por lo que una fila de J con muchas nonzeros, lo que resulta en una densacerca de producto J T J, puede conducir a un costoso proceso de solución para los grandesproblemas.

Si los componentes de x no tienen superior (o inferior) límites, entonces lsqnonlin prefiereque los correspondientes componentes de la ub (o lb) a establecer que inf (o-inf paralímites inferiores), frente a una arbitrariedad muy grande, pero positivo (o negativo Paralos límites inferiores)

4.2.1.4.3.2. Optimización de mediana escala.

Entorno MATLAB

Page 67: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 67 de 98

El algoritmo de mediana escala no maneja obligado limitaciones. Debido a la gran escalaalgoritmo no maneja indeterminados sistemas y el algoritmo de mediana escala no manejaobligados los obstáculos, los problemas con estas dos características no pueden serresueltos por lsqnonlin.

Entorno MATLAB

Page 68: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 68 de 98

5. Medidas experimentales.

En la segunda planta en el laboratorio 234 he estado trabajando en la adquisición demuestras para la comprobación del comportamiento óptico de diversos materiales. Entreellos he realizado pruebas de transmitancia i reflectancia a materiales tales como laAlumina i el oro. Siempre en finas capas.

Para medida de frecuencias comprendidas entre 450nm i 1100nm hemos utilizado elespectrofotómetro siguiente:

Figura 5.1.

Los materiales experimentales son los siguientes:Alumina:

Muestra 1

Figura 5.2. capa de alumina densa

Monocromador

Lámpara detungsteno

Cámara demedidas ópticas

Medidas experimentales

Page 69: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 69 de 98

Muestra 3

Figura 5.3. capa de alumina poco densa

Muestra 4

Figura 5.4. muestra de alumina con capa de aluminio pegada

Estas muestras han sido elegidas de entre varias muestras mas por considerarse losuficiente significativas.

Figura 5.5. placa de petri con muestras de Alumina

También se ha experimentado con otros materiales como el oro:

Medidas experimentales

Page 70: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 70 de 98

Figura 5.6. placas de petri con diversas placas de oro de diversa densidad

5.1. Espectrofotómetro de Infrarrojo por transformada de Fourier VERTEX 70.

El Vertex 70 es un espectrofotómetro FT-IR totalmente digital usado para medicionesmediante funciones automáticas que permiten reconocer parámetros químicos de manerarápida.

Sus componentes ópticos tales como la fuente, el detector y el separador de haz de luz,están controlados electrónicamente de modo que el firmware del espectrofotómetro puedereconocerlos.

Esta información se pasa al software de la aplicación que a su tiempo carga los parámetrosexperimentales apropiados automáticamente. El chequeo permanente online de loscomponentes del espectrofotómetro facilita información continuada por defecto.

Figura 5.7.

La adquisición de datos se basa en un convertidor A/D de 24 bits de rango dinámico. Elconvertidor A/D esta integrado en su detector electrónico de preamplificación. Latecnología DigiTec asegura una transmisión de señal libre de interferencias y garantiza elmayor proporción signal-to-noise ratio.

Medidas experimentales

Page 71: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 71 de 98

El Vertex 70 se controla por un equipo en el que su sistema operativo es MicrosftWindows y tiene instalado el software espectroscópico OPUS. La conexión Ethernetpermite la posibilidad de controlar el espectrofotómetro vía Internet

La configuración estándar del espectrofotómetro esta pensada para la adquisición de datosen la región media del IR. Opcionalmente, el Vertex 70 puede ser equipado con ópticaadicional para cubrir todo el rango espectral desde el infrarrojo lejano a 30 cm-1 hasta elcanal visible a 25000 cm-1. El rango espectral puede ser cambiado fácilmente gracias a loscomponentes ópticos prealineados y al espectrofotómetro alineado permanentemente.

5.1.1. Características VERTEX 70.

El es un espectrofotómetro versátil para aplicaciones exigentes en laboratorios analíticos yde investigación.

Su rango estándar es de 7.800cm-1 a 370cm-1 con posibilidad de expansión a IR lejano ycercano de 25.000cm-1 a 30cm-1.

Su resolución es de 0,5cm-1 con opción para 0,2cm-1 . Con 8 velocidades de barrido delespejo móvil seleccionadas mediante OPUS.Su opción "Rapid-scan" permite realizar hasta 40 espectros por segundo a 8cm-1 deresolución.Posee la opción de "Step scan" para experimentos de modulación de fase y resolucióntemporal.El equipo incluye una conexión ethernet con el PC de control del laboratorio.Admite hasta dos detectores MCT en el compartimiento de detectores y dispone decompartimentos internos para fuentes y divisores de haz.

Figura 5.8. Vertex 70

Para la experimentación en un rango mas alto de frecuencias tenemos que irnos a unespectrofotómetro que sea capaz de realizar esas muestras en las frecuencias comprendidasentre 1000nm i los 4000nm. lse ha procedido a la realización de las medidas

Medidas experimentales

Page 72: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 72 de 98

experimentales utilizando el correspondiente software OPUS for QA/QC y elespectrofotómetro vertex 70 de Bruker.

Figura 5.9. espectrofotómetro VERTEX

Ambos aparatos van acompañados de un software específico para la captura de losexperimentos realizados. Mediante el puerto serie RS-232 se realiza la captura de datosdesde los dos espectrofotómetros. Una vez capturadas las muestras experimentales con loscomportamientos de los materiales se realiza una manipulación de los datos para obtenerlos valores en relación a las magnitudes buscadas i no en relación a la intensidad de luz.Primero de nada es imprescindible realizar una muestra en vacío para que nos sirva depatrón a posteriori. Así el error incorporado por el medidor será siempre proporcional ypodremos eliminarlo para la obtención del resultado buscado, es lo nombramos línea debase.

Figura 5.10 espectrofotómetro preparado para transmisión

Medidas experimentales

Page 73: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 73 de 98

En función del comportamiento del cristal que queramos encontrar necesitaremosconfigurar también los elementos de colocación de los cristales dentro de la cámara. Esdecir, que necesitaremos parar el muestreo y colocar el mecanismo interno necesario parapoder medir por ejemplo reflectancia en vez de transmitancia. En la figura de arribapodemos ver el aparato preparado para la medición de transmitancia. También esimportante pensar en el lugar mas adecuado para la colocación de la pieza a medir ya queno obtendremos los mismos resultados si la colocamos en la parte de detrás del mecanismoque si la ponemos delante.A continuación muestro el comportamiento de diversos materiales muestreados con elespectrofotómetro VERTEX y el software de aplicación OPUS.

5.1.2. Puesta a punto del sistema de medida con el espectrofotómetro IR del DEEEA.

5.1.2.1. Información Espectral.

El diseño de la mayoría de interferómetros que se usan para la espectrometría IR estánbasados en el interferómetro original de dos rayos de luz originalmente diseñado porMichelson en 1891. Muchos otros interferómetros de dos rayos de luz han sido diseñadossubsecuencialmente desde entonces y muy seguramente estos hayan sido dotados de mayorfuncionalidad y aplicabilidad que el interferómetro original de Michelson.La forma mas simple del interferómetro de Michelson se muestra en la siguientefigura.

Figura 5.11 Interferómetro de Michelson

Consta de dos espejos perpendiculares. El espejo móvil se puede mover sobre el ejeparalelo al plano del espejo fijo. El espejo móvil se mueve a una velocidad constante o seposiciona en diversos puntos sobre su eje durante periodos cortos de tiempo pasando deunos a otros a gran velocidad. Entre el espejo fijo y el móvil se encuentra el separador deluz, donde un haz de luz IR procedente de una fuente externa se refleja parcialmente haciael espejo fijo (F). El resto de la luz se transmite parcialmente al espejo móvil (M). Cuandolos haces de luz retornan al separador de luz, estos interfieren y son reflejados ytransmitidos parcialmente.A causa del efecto de la interferencia, la intensidad del haz de luz que llega al detector y laintensidad del haz de luz que se devuelve a la fuente depende de la distancia que recorrenlos haces en los dos brazos del interferómetro. La variación entre la intensidad del haz de

Medidas experimentales

Page 74: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 74 de 98

luz que llega al detector y la intensidad del haz de luz que retorna a la fuente como funciónde la distancia recorrida produce la información espectral.La información espectral se ve concretada en los espectros. Un espectro es el conjunto deondas o más concretamente, la radiación lumínica que transmite la sustancia analizada.Dicha radiación puede ser usada para identificar la sustancia analizada. Los espectros sepueden observar mediante espectroscopios basados en el interferómetro original deMichelson que, además de permitirnos observar el espectro, permite realizar medidas sobreéste, como la longitud de onda o la frecuencia de la radiación.Desde la creación del primer interferómetro, a principios del siglo XX, se ha producido undesarrollo tecnológico rápido y considerable. Los espectrofotómetros de primerageneración eran todos dispersivos. Inicialmente, los elementos dispersivos eran prismas, yposteriormente se cambiaron por rejillas.A mitad de los años 60, la espectroscopia IR fue testigo de un mejoría puesto a que seempezó a utilizar la espectroscopia IR por transformada de Fourier (FT-IR). Esosfueron los espectrofotómetros de segunda generación. En su interior estaban provistos deun interferómetro de Michelson. Estaban dotados de grandes ventajas respecto a losespectrofotómetros dispersivos.Ventajas del FT-IR sobre los Dispersivos:- Mayor velocidad y sensibilidad. Un espectro completo se puede obtener mediante un solobarrido, ya que el detector observa todas las frecuencias de manera simultanea.- Láser interno de referencia. La utilización de un láser de helio-neon como referenciainterna proporciona una calibración automática con exactitud superior a 0.01 cm-1.Estoevita la necesidad de utilizar una calibración externa.- Sistema de diseño sencillo, con pocas partes en movimiento que minimizan el desgaste.- Elimina la mayor parte de las interferencias obteniéndose unos espectros mucho máslimpios.- Poseen sistemas informáticos con librerías y con procesamiento de datos rápido y eficaz.Hoy en día, todos los espectroscopios que realizan espectroscopia en el infrarrojo cercanolo hacen por transformada de Fourier. Su uso esta destinado a campos como la químicaanalítica, la ciencia de la vida, procesos y muchos otros campos más.

5.2. Software OPUS 5.0 for QA/QC.

El software OPUS ofrece un sistema extenso de rutinas útiles para proceso espectrales talescomo calculadora de espectro, rutina de conversión de la absorbencia a transmitancia,rutina de corrección automática de la línea de fondo, rutina de búsqueda de máximos ymínimos y el muchísimos más.Todas las funciones pueden ser usadas para espectros múltiples y se pueden manipular almismo tiempo. El rastreo y el manejo de los datos espectrales obtenidos en el laboratoriodel DEEEA es muy sencillo y útil y este software posee una variedad de funcionesinteractivas que hacen del OPUS la herramienta ideal a parte de ser extremadamente fácilde utilizar.Las funciones básicas de manipulación y de evaluación de los espectros, tales comoselección de máximos y de mínimos, corrección de la línea de fondo, integración ysubstracción espectral para el trabajo cuantitativo de zonas de los espectros, sonherramientas que se han usado a la hora de extraer la características de los espectrosobtenidos.El OPUS ha proporcionado las rutinas de proceso que han resuelto las demandas en ellaboratorio.En la siguiente captura se puede ver el comportamiento de la Alumina y de una capa devidrio a la transmisión para longitudes de onda de entre 1000nm y 4000nm.

Medidas experimentales

Page 75: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 75 de 98

Figura 5.12 Pantalla del software aplicativo OPUS adquiriendo de muestras

Medidas experimentales

Page 76: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 76 de 98

6. Programa principal.

6.1 Menu principal.

Figura 6.1

El menu principal tiene dos partes muy marcas. En gris oscuro tenemos todo el panel decontrol y en gris claro tenemos las visualizaciones de las muestras obtenidas. Acontinuación vamos a comentar mas detenidamente el panel de control del programa.Angulo de incidencia

Figura 6.2

Nuestros cristales son muestreados a diferentes ángulos para detectar que comportamientoóptico tienen los diversos materiales con los que trabajamos. Las muestras obtenidas son a12º y obtenemos la respuesta a la reflexión ópticaNumero de bicapas

Figura 6.3

Podemos determinar el numero de bicapas de las que consta el experimento.

Programa principal

Page 77: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 77 de 98

Figura 6.4En la figura anterior podemos ver el aspecto que tendrá el programa si ponemos unexperimento que consta de 3 bicapas. Estas salen de manera emergente en el menuprincipal.Datos a grafiar

Figura 6.5

Figura 6.6

Programa principal

Page 78: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 78 de 98

En la figura anterior podemos ver que a partir de este menu desplegable podemos elegir eltipo de dato a trabajar. Es decir, si trabajaremos con resultados de reflexión, transmitanciao absorbancia. También podemos combinarlos entre ellos como se puede apreciar en elmenú emergente.

Figura 6.7

Este cuadro del menu principal nos permite fijar los índices de reflexión del substrato y delmedio donde realizamos el experimento.Rango de longitud de onda

Figura 6.8

En cada experimento estamos trabajando entre varias longitudes de onda para ver elcomportamiento de los cristales a estas longitudes. También en el cuadro menú fijamoscada cuanto se realizará la medida del comportamiento de los cristales.parámetros de optimización del índice de refracción.

Figura 6.9

A partir de la elección de una de estas dos opciones el programa podrá pasar al ajuste delíndice de refracción a partir de un sistema de mínimos cuadrados para la obtención de laaproximación al índice de refracción mas optimo a partir del experimento capturado.Para ello lo hacemos con los parámetros de dispersión de Sellmeier o de Cauchy

Figura 6.10

Este cuadro nos sirve para fijar los parámetros tanto de Cauchy como de Sellmeier. Son losdatos de inicio del cálculo de optimización del programa. Estos parámetros hacenreferencia a las dos siguientes expresiones matemáticas:Cauchy:

Sellmeier:

Tratamiento de datos

Programa principal

Page 79: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 79 de 98

Figura 6.11

En el menu también tenemos la posibilidad sumar dos respuestas, guardar los datosobtenidos en formato txt y ponerle un encabezamiento al fichero. Para la optimización deresultados es necesario tener activada la opción siguiente load dates.

Figura 6.12

Por ultimo en el panel de control de nuestro menú principal tenemos la posibilidad defiltrar los datos que entramos para que en la optimización el proceso vaya mas rápido ytambién tenemos que indicar de cuantas capas consta el experimento realizado. Hemostrabajado básicamente con capas simples pero también en alguna ocasión se realizaronoptimizaciones en doble capa.

Para hacer funcionar el programa en optimización tenemos que dejar pulsados las opcionesde Cauchy o Sellmeier valors i el load dates. Es aconsejable poner valores a los parámetrosde Cauchy o Sellmeier que estén cerca de los valores deseados así la optimización seráexitosa.En la parte derecha del programa tenemos las gráficas resultantes de los datos obtenidos:Error, TM, TE y n().

6.2 Funcionamiento del programa.

El programa funciona de la siguiente manera modular:

Figura 6.13

Programa principal

Page 80: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 80 de 98

En la figura anterior tenemos de forma modular el funcionamiento del programa. Primerole introducimos los parámetros de entrada. También tenemos que leer el fichero de datosexperimental para el posterior tratamiento de datos.

Una vez tenemos estos datos leídos y almacenados en la variable matriun21. De estavariable tipo matriz sacamos los datos de la primera columna para el cálculo nos da losdatos de la longitud de onda capturada de los datos experimentales y la segunda columnaes la reflectividad.

Con la primera columna calcularemos y guardaremos los datos tanto en la funciónSellmeier como en la función Cauchy. Calculamos en la columna 2 de la variable matrizmatriun21teorica el índice de dispersión de Cauchy o de Sellmeier según se haya fijado enel menú principal. Con esta variable i la anterior trabajaremos en la funcióncalculartransmisión-i-reflexión.

En la función calcular transmisión y reflexión se le introducen los parámetros de entradanecesarios para le calculo y nos devuelve calculados la reflectividad i la transmitancia.Una vez calculadas estas variables se llevan los valores a la optimización mediante unbucle se calculan los valores óptimos de las variables A B C I D y del espesor del material.Se vuelve a calcular Cauchy o Sellmeier y se vuelve a calcular la transmitancia y lareflectancia. Así lo ira haciendo hasta que lleguemos a la tolerancia error ajustada en lafunción de ajuste optimo por mínimos cuadrados para funciones no lineales utilizado.Esta función es el lsqnonlin. A esta función le tenemos que pasar un función a optimizar eneste caso serán las funciones Sellmeier, Cauchy y el desfase provocado por el grosor de lacapa que nos permite tener esta formula relacionada la variable grosor de capa. De estamanera se vuelve a calcular por mínimos cuadrados hasta que se obtienen los valoresóptimos de las variables buscadas.

Durante la elaboración del proyecto hemos ido contemplando como el ajuste de lasvariables se acercaba bastante a los valores predefinidos por diseño por lo tanto estamosdelante de un sistema de optimización fiable para márgenes de funcionamiento conocidos.

Por ultimo sobre el menú principal se hace un volcado de los datos calculados a partir decuatro graficas que nos permiten ver la reflectancia, el índice de refracción n(lambda) y elerror obtenido a lo largo de las medidas.

Programa principal

Page 81: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 81 de 98

7 Resultados obtenidos.

7.1 Pruebas con una sola lámina de cristal.

CauchyMuestra 9a: n=1.99 d=1.30 um

Ajuste a 4 variables, optimizando también el espesor de la capa.

Resultados obtenidos

Page 82: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 82 de 98

SellmeierMuestra 9a: n=1.99 d=1.30 um

Ajuste a 4 variables, optimizando también el espesor de la capa.

Resultados obtenidos

Page 83: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 83 de 98

CauchyMuestra 9b: n=1.99 d=0.92 um

Ajuste a 4 variables, optimizando también el espesor de la capa

Resultados obtenidos

Page 84: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 84 de 98

SellmeierMuestra 9b: n=1.99 d=0.92 um

Ajuste a 4 variables, optimizando también el espesor de la capa

Resultados obtenidos

Page 85: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 85 de 98

CauchyMuestra 9c: n=1.99 d=1.72 um

Ajuste a 4 variables, optimizando también el espesor de la capa

Resultados obtenidos

Page 86: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 86 de 98

SellmeierMuestra 9c: n=1.99 d=1.72 um

Ajuste a 4 variables, optimizando también el espesor de la capa

Resultados obtenidos

Page 87: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 87 de 98

CauchyMuestra 10c: n=2.09 d=1.36 um

Ajuste a 4 variables, optimizando también el espesor de la capa

Resultados obtenidos

Page 88: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 88 de 98

SellmeierMuestra 10c: n=2.09 d=1.36 um

Ajuste a 4 variables, optimizando también el espesor de la capa

Resultados obtenidos

Page 89: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 89 de 98

CauchyMuestra 10a: naprox=1.91 grueso=2.44 um

Ajuste a 4 variables, optimizando también el espesor de la capa

Resultados obtenidos

Page 90: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 90 de 98

SellmeierMuestra 10a: naprox=1.91 grueso=2.44 um

Ajuste a 4 variables, optimizando también el espesor de la capa

Resultados obtenidos

Page 91: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 91 de 98

Cauchy10b naprox=1.72 grueso=3.28 um

Ajuste a 4 variables, optimizando también el espesor de la capa

Resultados obtenidos

Page 92: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 92 de 98

Sellmeier10b naprox=1.72 grueso=3.28 um

Ajuste a 4 variables, optimizando también el espesor de la capa

Resultados obtenidos

Page 93: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 93 de 98

Cauchy11a naprox=1.47 grueso=3.5-3.7 um (valor de n aproximado) Ns=3,6

Ajuste a 4 variables, optimizando también el espesor de la capa

Resultados obtenidos

Page 94: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 94 de 98

Sellmeier11a naprox=1.47 grueso=3.5-3.7 um (valor de n aproximado) Ns=3,6

Ajuste a 4 variables, optimizando también el espesor de la capa

Resultados obtenidos

Page 95: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 95 de 98

Cauchy12d naprox=1.47 espesor de capa=2.28um (valor de n aproximado)

Sellmeier12d naprox=1.47 espesor de capa=2.28um (valor de n aproximado)

Resultados obtenidos

Page 96: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 96 de 98

7.2 Optimizacion de doble capa.

11bcauchyN1=1.82 D1=620nmN2=1.49 D2= 1290nm

SellmeierN1=1.82 D1=620nmN2=1.49 D2= 1290nm

Resultados obtenidos

Page 97: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 97 de 98

Cauchy:11cN2=1.82 D2=620nmN1=1.49 D1= 1290nm

Sellmeier11cN2=1.82 D2=620nmN1=1.49 D1= 1290nm

Resultados obtenidos

Page 98: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

PFC: OPTIMIZACIÓN Y EXTRACCIÓN DE PARAMETROS ÓPTICOS DE ESTRUCTURAS MULTICAPA

PROYECTO FINAL DE CARRERA página 98 de 98

8. Referencias bibliográficas.1. J. D. Jackson, Classical Electrodynamics.2. M. Brédov, V. Rumiántsev y I. Toptiguin, Electrodinámica clásica (Mir, Moscú, 1986).4. S. Adachi, Optical Properties of Crystalline and Amorphous Semiconductors (Kluwer,Boston, 1999).5. N. W. Ashcroft and N. D. Mermin, Solid State Physics (Thomson, New York, 1976).6. M. Born and E. Wolf, Principles of optics (Pergamon Press, Oxford, 1965).7. R. M. A. Azzam and N. M. Bashara, Ellipsometry and Polarized Light (North-Holland,Amsterdam, 1977).8. E. Burnstein, en Elementary excitations in solids, editado por A. A. Maradudin y G.F. Nardelli, (New York, Plenum Press, 1969).10. F. Abeles (ed.), Optical Properties of Solids (North Holland, Amsterdam, 1972).11. Artículos.visualizados por Internet.12. Aprenda Matlab 7.0 como si estuviera en primero Javier García de Jalón, José IgnacioRodríguez, Jesús Vidal.13.Manual de GUIDE de matlab bajado de la pagina www.lawebdelprogramador.com.

Referencias bibliográficas

Page 99: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 1 de 72

Codigo del programa

Multilayers.mfunction varargout = Multilayers(varargin)% MULTILAYERS M-file for Multilayers.fig% MULTILAYERS, by itself, creates a new MULTILAYERS or raises theexisting% singleton*.%% H = MULTILAYERS returns the handle to a new MULTILAYERS or thehandle to% the existing singleton*.%% MULTILAYERS('CALLBACK',hObject,eventData,handles,...) calls thelocal% function named CALLBACK in MULTILAYERS.M with the given inputarguments.%% MULTILAYERS('Property','Value',...) creates a new MULTILAYERSor raises the% existing singleton*. Starting from the left, property valuepairs are% applied to the GUI before Multilayers_OpeningFunction getscalled. An% unrecognized property name or invalid value makes propertyapplication% stop. All inputs are passed to Multilayers_OpeningFcn viavarargin.%% *See GUI Options on GUIDE's Tools menu. Choose "GUI allowsonly one% instance to run (singleton)".%% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help Multilayers

% Last Modified by GUIDE v2.5 06-May-2008 22:27:51%********v2

% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name', mfilename, ...

'gui_Singleton', gui_Singleton, ...'gui_OpeningFcn', @Multilayers_OpeningFcn, ...'gui_OutputFcn', @Multilayers_OutputFcn, ...'gui_LayoutFcn', [] , ...'gui_Callback', []);

if nargin & isstr(varargin{1})gui_State.gui_Callback = str2func(varargin{1});

end

if nargout[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});

elsegui_mainfcn(gui_State, varargin{:});

end% End initialization code - DO NOT EDIT

% --- Executes just before Multilayers is made visible.

Page 100: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 2 de 72

function Multilayers_OpeningFcn(hObject, eventdata, handles, varargin)% This function has no output args, see OutputFcn.% hObject handle to figure% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% varargin command line arguments to Multilayers (see VARARGIN)handles.data_n21 = 1;handles.var_n21=0;handles.data_n31 = 1;handles.var_n31=0;

handles.data_un21 = 0;handles.var_un21=0;handles.data_bn21 = 0;handles.var_bn21=0;handles.data_cn21 = 0;handles.var_cn21=0;

handles.data_n22 = 1;handles.var_n22=0;handles.data_n32 = 1;handles.var_n32=0;

handles.data_n23 = 1;handles.var_n23=0;handles.data_n33 = 1;handles.var_n33=0;

handles.DataP=1;handles.nestruc=1;

handles.n21string = 'a';handles.n31string = 'a';handles.n22string = 'a';handles.n32string = 'a';handles.n23string = 'a';handles.n33string = 'a';

set(handles.text123,'Visible','off');set(handles.text124,'Visible','off');set(handles.k23_input,'Visible','off');set(handles.k33_input,'Visible','off');set(handles.text125,'Visible','off');set(handles.text126,'Visible','off');

set(handles.n22_input,'Visible','off');set(handles.n32_input,'Visible','off');set(handles.k22_input,'Visible','off');set(handles.k32_input,'Visible','off');set(handles.h22_input,'Visible','off');set(handles.h32_input,'Visible','off');set(handles.n22varpop_input,'Visible','off');set(handles.n32varpop_input,'Visible','off');set(handles.N2_input,'Visible','off');set(handles.text76,'Visible','off');set(handles.text77,'Visible','off');set(handles.text78,'Visible','off');set(handles.text79,'Visible','off');set(handles.text80,'Visible','off');set(handles.text81,'Visible','off');set(handles.text82,'Visible','off');

Page 101: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 3 de 72

set(handles.text83,'Visible','off');

set(handles.frame26,'Visible','off');

set(handles.n23_input,'Visible','off');set(handles.n33_input,'Visible','off');set(handles.h23_input,'Visible','off');set(handles.h33_input,'Visible','off');set(handles.n23varpop_input,'Visible','off');set(handles.n33varpop_input,'Visible','off');set(handles.N3_input,'Visible','off');set(handles.text84,'Visible','off');set(handles.text85,'Visible','off');set(handles.text86,'Visible','off');set(handles.text87,'Visible','off');set(handles.text88,'Visible','off');set(handles.text89,'Visible','off');set(handles.text108,'Visible','off');set(handles.text115,'Visible','off');set(handles.frame21,'Visible','off');

% Choose default command line output for Multilayershandles.output = hObject;

% Update handles structureguidata(hObject, handles);

% UIWAIT makes Multilayers wait for user response (see UIRESUME)% uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.function varargout = Multilayers_OutputFcn(hObject, eventdata,handles)% varargout cell array for returning output args (see VARARGOUT);% hObject handle to figure% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Get default command line output from handles structurevarargout{1} = handles.output;

% --- Executes on button press in Calculate.function Calculate_Callback(hObject, eventdata, handles)

% ini variablesglobal n21global tet2global matriun21global Parametresglobal lnostraglobal longglobal lleguirglobal D1Mglobal var21global slcauchyglobal slsellmeierglobal matriun21teoricaglobal matriun22teoricaglobal matriun31global matriun22global var22global var32

Page 102: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 4 de 72

global var23global var31global nestruc;global var33;global matriun33;global rugoso;global phi1;global DsM;global ns;global phis;global n1;global D1E;global DsE;global RE;global un21;global bn21;global cn21;global dn21;global un22;global bn22;global cn22;global dn22;global polnum;global h21global n31global phi2global n1

cla(handles.TEaxes);cla(handles.TMaxes);cla(handles.NLAMaxes);cla(handles.ERRORaxes);

matriun31=0;matriun22=0;var22=0;var32=0;var31=0;nestruc=0;var33=0;matriun33=0;rugoso=0;phi1=0;DsM=0;ns=0;phis=0;n1=0;D1E=0;DsE=0;un21 = str2double(get(handles.un21_input,'String'));bn21 = str2double(get(handles.bn21_input,'String'));cn21 = str2double(get(handles.cn21_input,'String'));dn21 = str2double(get(handles.dn21_input,'String'));

un22 = str2double(get(handles.un22,'String'));bn22 = str2double(get(handles.bn22,'String'));cn22 = str2double(get(handles.cn22,'String'));dn22 = str2double(get(handles.dn22,'String'));

fd = str2double(get(handles.filtrodatos,'String'));polnum = str2double(get(handles.polnum,'String'));slcauchy=get(handles.slcauchy,'Value');

Page 103: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 5 de 72

slsellmeier=get(handles.slsellmeier,'Value');lleguir=get(handles.loaddates,'Value');n21Re = str2double(get(handles.n21_input,'String'));k21 = str2double(get(handles.k21_input,'String'));n21=n21Re+i*k21;h21 = str2double(get(handles.h21_input,'String'));h21=h21*1e-9;n31Re = str2double(get(handles.n31_input,'String'));k31 = str2double(get(handles.k31_input,'String'));n31=n31Re+i*k31;h31 = str2double(get(handles.h31_input,'String'));h31=h31*1e-9;N1 = str2double(get(handles.N1_input,'String'));

n22Re = str2double(get(handles.n22_input,'String'));k22 = str2double(get(handles.k22_input,'String'));n22=n22Re+i*k22;h22 = str2double(get(handles.h22_input,'String'));h22=h22*1e-9;n32Re = str2double(get(handles.n32_input,'String'));k32 = str2double(get(handles.k32_input,'String'));n32=n32Re+i*k32;h32 = str2double(get(handles.h32_input,'String'));h32=h32*1e-9;N2 = str2double(get(handles.N2_input,'String'));

n23Re = str2double(get(handles.n23_input,'String'));k23 = str2double(get(handles.k23_input,'String'));n23=n23Re+i*k23;h23 = str2double(get(handles.h23_input,'String'));h23=h23*1e-9;n33Re = str2double(get(handles.n33_input,'String'));k33 = str2double(get(handles.k33_input,'String'));n33=n33Re+i*k33;h33 = str2double(get(handles.h33_input,'String'));h33=h33*1e-9;N3 = str2double(get(handles.N3_input,'String'));

lambdai = str2double(get(handles.lambdai_input,'String'));lambdainicial=lambdai;lambdai=lambdai*1e-9;lambdaf = str2double(get(handles.lambdaf_input,'String'));lambdafinal=lambdaf;lambdaf=lambdaf*1e-9;angle = str2double(get(handles.angle_input,'String'));n1 = str2double(get(handles.nambient_input,'String'));ns = str2double(get(handles.nsubs_input,'String'));

step = str2double(get(handles.step_input,'String'));stepini=step;

step=step*1e-9;

%inicialitzar variables matriusfile=[];pathname=[];

Page 104: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 6 de 72

%Llegir les dades en un fitxer de textif lleguir==1

[col1,col2]=lectura;end

%modificacion del programa principal para la realizacion de lagrafica

%de la n(lambda) en funcion de las variables A B i C.if (slcauchy==1)

[matriun21,matriun21teorica,matriun22teorica]=calcularncauchy(fd,col1,col2,un21,bn21,cn21,dn21,un22,bn22,cn22,dn22);

axes(handles.NLAMaxes)%figure(7);hold on;plot(matriun21teorica(:,1),matriun21teorica(:,2));xlabel('\lambda (nm)')

set(handles.NLAMaxes,'XMinorTick','on');set(handles.NLAMaxes,'YMinorTick','on');set(handles.NLAMaxes,'XLimMode','manual');set(handles.NLAMaxes,'XLim',[(lambdai/1e-9) (lambdaf/1e-9)]);set(handles.NLAMaxes,'YLimMode','auto');%set(handles.NLAMaxes,'YLim',[0 0.5]);n21= matriun21teorica(1,2);grid onhold off;axes(handles.NLAMaxes)hold on;plot(matriun22teorica(:,1),matriun22teorica(:,2));xlabel('\lambda (nm)')set(handles.NLAMaxes,'XMinorTick','on');set(handles.NLAMaxes,'YMinorTick','on');set(handles.NLAMaxes,'XLimMode','manual');set(handles.NLAMaxes,'XLim',[(lambdai/1e-9) (lambdaf/1e-9)]);set(handles.NLAMaxes,'YLimMode','auto');%set(handles.NLAMaxes,'YLim',[0 0.5]);grid onhold off;

endif (slsellmeier==1)

[matriun21,matriun21teorica,matriun22teorica]=calcularnsellmeier(fd,col1,col2,un21,bn21,cn21,dn21,un22,bn22,cn22,dn22);

%figure(7);axes(handles.NLAMaxes)hold on;plot(matriun21teorica(:,1),matriun21teorica(:,2));xlabel('\lambda (nm)')set(handles.NLAMaxes,'XMinorTick','on');set(handles.NLAMaxes,'YMinorTick','on');set(handles.NLAMaxes,'XLimMode','manual');set(handles.NLAMaxes,'XLim',[(lambdai/1e-9) (lambdaf/1e-9)]);set(handles.NLAMaxes,'YLimMode','auto');%set(handles.NLAMaxes,'YLim',[0 0.5]);grid onhold off;axes(handles.NLAMaxes)hold on;plot(matriun22teorica(:,1),matriun22teorica(:,2));xlabel('\lambda (nm)')set(handles.NLAMaxes,'XMinorTick','on');

Page 105: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 7 de 72

set(handles.NLAMaxes,'YMinorTick','on');set(handles.NLAMaxes,'XLimMode','manual');set(handles.NLAMaxes,'XLim',[(lambdai/1e-9) (lambdaf/1e-9)]);set(handles.NLAMaxes,'YLimMode','auto');%set(handles.NLAMaxes,'YLim',[0 0.5]);grid onhold off;n21= matriun21teorica(1,2);

end

%Calcul del desfas optic produit en funcio de d el espesor de lacapa

for h=1:1:length(matriun21)phi1=angle*pi/180; %angle incidenciaphi2=asin((n1/matriun21teorica(h,2))*(sin(phi1)));p2=n21*cos(phi2);k2x=(2*pi*matriun21teorica(h,2)*cos(phi2))/(1E-9*matriun21(h,1));tet2(h)=k2x*h21;end

%nestruc=str2double(get(handles.nestruc_input,'String'))nestruc=handles.nestruc;rugoso=zeros(1,nestruc);p1=[n21 h21 n31 h31 N1];p2=[n22 h22 n32 h32 N2];p3=[n23 h23 n33 h33 N3];

Parametres=zeros(nestruc,5);

switch (nestruc)case 1

Parametres=[p1];case 2

Parametres=[p1;p2];case 3

Parametres=[p1;p2;p3];otherwise,

r=sprintf('3 is the maximum number of structures ')end

p1=n1*cos(phi1);D1M=[cos(phi1) cos(phi1);n1 -n1];D1E=[1 1;p1 -p1];

phis=asin((n1/ns)*(sin(phi1)));ps=ns*cos(phis);DsM=[cos(phis) cos(phis);ns -ns];DsE=[1 1;ps -ps];

%Ja es tenen tots els paràmetres per al càlcul de MultiYehstep = str2double(get(handles.step_input,'String'));step=step*1e-9;lnostra=lambdai:step:lambdaf;long=length(lnostra);if lleguir==1

long=length(matriun21);end

Page 106: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 8 de 72

%Mira si n es variable i en cas de que ho sigui carrega la matriude

%valors de n en funcio de lambdavar21=handles.var_n21;var31=handles.var_n31;var22=handles.var_n22;var32=handles.var_n32;var23=handles.var_n23;var33=handles.var_n33;

if var21==1if (slcauchy==0)|(slsellmeier==0)&(polnum==1)matriun21data=handles.data_n21;for h=1:1:length(matriun21data)/fd

matriun21teorica(h,1)=matriun21data(h,1); %lambdamatriun21teorica(h,2)=matriun21data(h*fd,2); %nmatriun21teorica(h,3)=matriun21data(h*fd,3); %ik

endfor h=1:1:length(matriun21data)

phi1=angle*pi/180; %angle incidenciaphi2=asin((n1/matriun21teorica(h,2))*(sin(phi1)));p2=n21*cos(phi2);k2x=(2*pi*matriun21teorica(h,2)*cos(phi2))/(1E-

9*matriun21data(h,1));tet2(h)=k2x*h21;

endend

endif var31==1

if (slcauchy==0)|(slsellmeier==0)&(polnum==2)matriun31=handles.data_n31;

endendif var22==1

matriun22=handles.data_n22;endif var32==1

matriun32=handles.data_n32;endif var23==1

matriun23=handles.data_n23;endif var33==1

matriun33=handles.data_n33;end

%****************************************************% Càlcul de la transmissió i reflexió a partir de les matrius%*****************************************************

[RE,TE,RM,TM]=calculdetransmissioireflexio(Parametres,lnostra,long,lleguir,matriun21,D1M,var21,slcauchy,matriun21teorica,matriun22teorica,matriun31,matriun22,var22,var32,var31,nestruc,var33,matriun33,rugoso,phi1,DsM,ns,phis,n1,D1E,DsE,var23);if lleguir==1[x,RE,TE,RM,TM]=fminquad(Parametres,lnostra,long,lleguir,matriun21,D1M,var21,slcauchy,matriun21teorica,matriun22teorica,matriun31,matriun22,var22,var32,var3

Page 107: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 9 de 72

1,nestruc,var33,matriun33,rugoso,phi1,DsM,ns,phis,n1,D1E,DsE,RE,TE,RM,TM,var23,polnum);

set(handles.un21_input,'string',un21);set(handles.bn21_input,'string',bn21);set(handles.cn21_input,'string',cn21);set(handles.dn21_input,'string',dn21);set(handles.un22,'string',un22);set(handles.bn22,'string',bn22);set(handles.cn22,'string',cn22);set(handles.dn22,'string',dn22);set(handles.h21_input,'string',h21*1E9);axes(handles.NLAMaxes)hold on;plot(matriun21teorica(:,1),matriun21teorica(:,2),'m');hold off;fi2=(RE')-(matriun21(:,2));errorlin=median(fi2)set(handles.error,'string',errorlin);axes(handles.ERRORaxes)hold on;plot(fi2);hold off;end

% Create TE plotvalor=handles.DataP;axes(handles.TEaxes)switch valor

case 2plot(lnostra/1e-9,TE,'r');legend('T');

case 3plot(lnostra/1e-9,RE,lnostra/1e-9,TE,'r');legend('R','T')

case 4AE=1-RE-TE;plot(lnostra/1e-9,AE,'g');legend('A')

case 5AE=1-RE-TE;plot(lnostra/1e-9,RE,lnostra/1e-9,AE,'g');legend('R','A')

case 6AE=1-RE-TE;plot(lnostra/1e-9,TE,'r',lnostra/1e-9,AE,'g');legend('T','A')

case 7AE=1-RE-TE;plot(lnostra/1e-9,RE,lnostra/1e-9,TE,'r',lnostra/1e-

9,AE,'g');legend('R','T','A')

otherwise,if lleguir ==0

plot(lnostra/1e-9,RE,'b');legend('R');

elseplot(matriun21(:,1),RE,'b')legend('R');hold on;plot(matriun21(:,1),matriun21(:,2),'m')

Page 108: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 10 de 72

legend('R');hold off;

end

endxlabel('\lambda (nm)')

% title('TE');set(handles.TEaxes,'XMinorTick','on');set(handles.TEaxes,'YMinorTick','on');set(handles.TEaxes,'XLimMode','manual');set(handles.TEaxes,'XLim',[(lambdai/1e-9) (lambdaf/1e-9)]);set(handles.TEaxes,'YLimMode','auto');%set(handles.TEaxes,'YLim',[0 0.5]);grid on

% Create TM plotaxes(handles.TMaxes)switch valor

case 2plot(lnostra/1e-9,TM,'r');legend('T');

case 3plot(lnostra/1e-9,RM,lnostra/1e-9,TM,'r');legend('R','T')

case 4AM=1-RM-TM;plot(lnostra/1e-9,AM,'g');legend('A')

case 5AM=1-RM-TM;plot(lnostra/1e-9,RM,lnostra/1e-9,AM,'g');legend('R','A')

case 6AM=1-RM-TM;plot(lnostra/1e-9,TM,'r',lnostra/1e-9,AM,'g');legend('T','A')

case 7AM=1-RM-TM;plot(lnostra/1e-9,RM,lnostra/1e-9,TM,'r',lnostra/1e-

9,AM,'g');legend('R','T','A')

otherwise,if lleguir ==0

plot(lnostra/1e-9,RM,'b');legend('R');

elseplot(matriun21(:,1),RM,'b')legend('R');hold on;plot(matriun21(:,1),matriun21(:,2),'m')legend('R');hold off;

endendxlabel('\lambda (nm)')%title('TM');

% plot(t,x)set(handles.TMaxes,'XMinorTick','on');set(handles.TMaxes,'YMinorTick','on');set(handles.TMaxes,'XLimMode','manual');

Page 109: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 11 de 72

set(handles.TMaxes,'XLim',[(lambdai/1e-9) (lambdaf/1e-9)]);set(handles.TMaxes,'YLimMode','auto');%set(handles.TMaxes,'YLim',[0 0.5]);grid on

%Figura apart o noTEaparte = get(handles.TEsep,'Value');TMaparte = get(handles.TMsep,'Value');

if (TEaparte==1) & (TMaparte==1)figure;subplot(2,1,1);switch valorcase 2

plot(lnostra/1e-9,TE,'r');legend('T');

case 3plot(lnostra/1e-9,RE,lnostra/1e-9,TE,'r');legend('R','T')

case 4AE=1-RE-TE;plot(lnostra/1e-9,AE,'g');legend('A')

case 5AE=1-RE-TE;plot(lnostra/1e-9,RE,lnostra/1e-9,AE,'g');legend('R','A')

case 6AE=1-RE-TE;plot(lnostra/1e-9,TE,'r',lnostra/1e-9,AE,'g');legend('T','A')

case 7AE=1-RE-TE;plot(lnostra/1e-9,RE,lnostra/1e-9,TE,'r',lnostra/1e-

9,AE,'g');legend('R','T','A')

otherwise,if lleguir ==0

plot(lnostra/1e-9,RE,'b');else

plot(matriun21(:,1),RE,'b')plot(matriun21(:,1),matriun21(:,2),'m')

endlegend('R');

endxlabel('Wavelength (nm)');ylabel('Reflectivity');title('TE')grid on;axis([lambdai/1e-9 lambdaf/1e-9 0 1.05]);

% ttext=sprintf('nH=%0.5g nL=%0.5g hH=%0.5g hL=%0.5gN=%0.5g',n21,n31,h21,h31,N1);% title(ttext);

subplot(2,1,2);switch valorcase 2

plot(lnostra/1e-9,TM,'r');legend('T');

case 3plot(lnostra/1e-9,RM,lnostra/1e-9,TM,'r');legend('R','T')

Page 110: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 12 de 72

case 4AM=1-RM-TM;plot(lnostra/1e-9,AM,'g');legend('A')

case 5AM=1-RM-TM;plot(lnostra/1e-9,RM,lnostra/1e-9,AM,'g');legend('R','A')

case 6AM=1-RM-TM;plot(lnostra/1e-9,TM,'r',lnostra/1e-9,AM,'g');legend('T','A')

case 7AM=1-RM-TM;plot(lnostra/1e-9,RM,lnostra/1e-9,TM,'r',lnostra/1e-

9,AM,'g');legend('R','T','A')

otherwise,plot(lnostra/1e-9,RM,'b');legend('R');

endxlabel('Wavelength (nm)');ylabel('Reflectivity');grid on;title('TM');axis([lambdai/1e-9 lambdaf/1e-9 0 1.05]);

elseif (TEaparte==1)figureswitch valorcase 2

plot(lnostra/1e-9,TE,'r');legend('T');

case 3plot(lnostra/1e-9,RE,lnostra/1e-9,TE,'r');legend('R','T')

case 4AE=1-RE-TE;plot(lnostra/1e-9,AE,'g');legend('A')

case 5AE=1-RE-TE;plot(lnostra/1e-9,RE,lnostra/1e-9,AE,'g');legend('R','A')

case 6AE=1-RE-TE;plot(lnostra/1e-9,TE,'r',lnostra/1e-9,AE,'g');legend('T','A')

case 7AE=1-RE-TE;plot(lnostra/1e-9,RE,lnostra/1e-9,TE,'r',lnostra/1e-

9,AE,'g');legend('R','T','A')

otherwise,if lleguir ==0

plot(lnostra/1e-9,RE,'b');else

plot(matriun21(:,1),RE,'b')plot(matriun21(:,1),matriun21(:,2),'m')

endlegend('R');

Page 111: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 13 de 72

endxlabel('Wavelength (nm)');ylabel('Reflectivity');title('TE');grid on;axis([lambdai/1e-9 lambdaf/1e-9 0 1.05]);

figurewavenumber=1e7./(lnostra/1e-9);plot(wavenumber,RE,'r');xlabel('wavenumber');ylabel('Reflectivity');grid on;axis([min(wavenumber) max(wavenumber) 0 1.05]);

elseif (TMaparte==1)figureswitch valorcase 2

plot(lnostra/1e-9,TM,'r');legend('T');

case 3plot(lnostra/1e-9,RM,lnostra/1e-9,TM,'r');legend('R','T')

case 4AM=1-RM-TM;plot(lnostra/1e-9,AM,'g');legend('A')

case 5AM=1-RM-TM;plot(lnostra/1e-9,RM,lnostra/1e-9,AM,'g');legend('R','A')

case 6AM=1-RM-TM;plot(lnostra/1e-9,TM,'r',lnostra/1e-9,AM,'g');legend('T','A')

case 7AM=1-RM-TM;plot(lnostra/1e-9,RM,lnostra/1e-9,TM,'r',lnostra/1e-

9,AM,'g');legend('R','T','A')

otherwise,plot(lnostra/1e-9,RM,'b');legend('R');

endxlabel('Wavelength (nm)');ylabel('Reflectivity');title('TM');grid on;axis([lambdai/1e-9 lambdaf/1e-9 0 1.05]);

end

%Fa una figura apart amb la suma de les reflectivitats de TE i TMsumaTETM = get(handles.sumaTETM_check,'Value');if sumaTETM==1

suma=0.5*RE+0.5*RM;% FigAparte = get(handles.separateFig_check,'Value');% if FigAparte==1

figure% end

% wavenum=1e7./(lnostra/1e-9);% plot(wavenum,suma);

Page 112: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 14 de 72

% xlabel('Wavenumber (cm-1)');plot(lnostra/1e-9,suma);xlabel('Wavelength (nm)');ylabel('R average');title('0.5TE+0.5TM');grid on;

% axis([min(wavenum) max(wavenum) 0 1.05]);axis([lambdai/1e-9 lambdaf/1e-9 0 1.05]);

endcabecera = get(handles.cabecera_input,'Value');escriure = get(handles.exportData,'Value');%Escriu les dades en un fitxer de text

if (escriure==1)

escriuredades(lleguir,lnostra,cabecera,valor,matriun21,matriun21teorica,RE,n23,h23,n33,h33,N3,var21,var31,nestruc,h21,h31,N1,n31,TE,TM,RM);

end

% --- Executes during object creation, after setting all properties.function nambient_input_CreateFcn(hObject, eventdata, handles)% hObject handle to nambient_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

function nambient_input_Callback(hObject, eventdata, handles)% hObject handle to nambient_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of nambient_input astext% str2double(get(hObject,'String')) returns contents ofnambient_input as a double

% --- Executes during object creation, after setting all properties.function nsubs_input_CreateFcn(hObject, eventdata, handles)% hObject handle to nsubs_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

Page 113: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 15 de 72

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

function nsubs_input_Callback(hObject, eventdata, handles)% hObject handle to nsubs_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of nsubs_input as text% str2double(get(hObject,'String')) returns contents ofnsubs_input as a double

% --- Executes during object creation, after setting all properties.function angle_input_CreateFcn(hObject, eventdata, handles)% hObject handle to angle_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

function angle_input_Callback(hObject, eventdata, handles)% hObject handle to angle_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of angle_input as text% str2double(get(hObject,'String')) returns contents ofangle_input as a double

% --- Executes during object creation, after setting all properties.function lambdai_input_CreateFcn(hObject, eventdata, handles)% hObject handle to lambdai_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));

Page 114: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 16 de 72

end

function lambdai_input_Callback(hObject, eventdata, handles)% hObject handle to lambdai_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of lambdai_input astext% str2double(get(hObject,'String')) returns contents oflambdai_input as a double

% --- Executes during object creation, after setting all properties.function lambdaf_input_CreateFcn(hObject, eventdata, handles)% hObject handle to lambdaf_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

function lambdaf_input_Callback(hObject, eventdata, handles)% hObject handle to lambdaf_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of lambdaf_input astext% str2double(get(hObject,'String')) returns contents oflambdaf_input as a double

% --- Executes during object creation, after setting all properties.function DataP_CreateFcn(hObject, eventdata, handles)% hObject handle to DataP (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

% Hint: popupmenu controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

Page 115: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 17 de 72

% --- Executes on selection change in DataP.function DataP_Callback(hObject, eventdata, handles)% hObject handle to DataP (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: contents = get(hObject,'String') returns DataP contents ascell array% contents{get(hObject,'Value')} returns selected item fromDataPval = get(hObject,'Value');str = get(hObject, 'String');switch str{val};case 'R'

handles.DataP=1;case 'T'

handles.DataP=2;case 'R and T'

handles.DataP=3;case 'A'

handles.DataP=4;case 'R and A'

handles.DataP=5;case 'T and A'

handles.DataP=6;case 'R,T and A'

handles.DataP=7;endguidata(hObject,handles)

% --- Executes during object creation, after setting all properties.function n21_input_CreateFcn(hObject, eventdata, handles)% hObject handle to n21_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

function un21_input_CreateFcn(hObject, eventdata, handles)% hObject handle to n21_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

Page 116: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 18 de 72

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

function n21_input_Callback(hObject, eventdata, handles)% hObject handle to n21_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of n21_input as text% str2double(get(hObject,'String')) returns contents ofn21_input as a doublefunction un21_input_Callback(hObject, eventdata, handles)% hObject handle to n21_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of n21_input as text% str2double(get(hObject,'String')) returns contents ofn21_input as a double

% --- Executes during object creation, after setting all properties.function h21_input_CreateFcn(hObject, eventdata, handles)% hObject handle to h21_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

function h21_input_Callback(hObject, eventdata, handles)% hObject handle to h21_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of h21_input as text% str2double(get(hObject,'String')) returns contents ofh21_input as a double

% --- Executes during object creation, after setting all properties.function n31_input_CreateFcn(hObject, eventdata, handles)% hObject handle to n31_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

Page 117: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 19 de 72

% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

function n31_input_Callback(hObject, eventdata, handles)% hObject handle to n31_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of n31_input as text% str2double(get(hObject,'String')) returns contents ofn31_input as a double

% --- Executes during object creation, after setting all properties.function N1_input_CreateFcn(hObject, eventdata, handles)% hObject handle to N1_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

function N1_input_Callback(hObject, eventdata, handles)% hObject handle to N1_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of N1_input as text% str2double(get(hObject,'String')) returns contents ofN1_input as a double

% --- Executes during object creation, after setting all properties.function h31_input_CreateFcn(hObject, eventdata, handles)% hObject handle to h31_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

Page 118: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 20 de 72

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

function h31_input_Callback(hObject, eventdata, handles)% hObject handle to h31_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of h31_input as text% str2double(get(hObject,'String')) returns contents ofh31_input as a double

% --- Executes during object creation, after setting all properties.function n21varpop_input_CreateFcn(hObject, eventdata, handles)% hObject handle to n21varpop_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

% Hint: popupmenu controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

% --- Executes on selection change in n21varpop_input.function n21varpop_input_Callback(hObject, eventdata, handles)% hObject handle to n21varpop_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)val = get(hObject,'Value');str = get(hObject, 'String');switch str{val};case 'No selection'

handles.var_n21=0;set(handles.n21_input,'String','1');set(handles.k21_input,'String','0');

case 'Ag'handles.data_n21 = IndexnAg(1);

handles.var_n21=1;set(handles.n21_input,'String','____');set(handles.k21_input,'String','____');handles.n21string='Ag';

case 'Al'handles.data_n21 = IndexnAl(1);

handles.var_n21=1;set(handles.n21_input,'String','____');set(handles.k21_input,'String','____');handles.n21string='Al';

Page 119: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 21 de 72

case 'Au'handles.data_n21 = IndexnAu(1);

handles.var_n21=1;set(handles.n21_input,'String','____');set(handles.k21_input,'String','____');handles.n21string='Au';

case 'Cu'handles.data_n21 = IndexnCu(1);

handles.var_n21=1;set(handles.n21_input,'String','____');set(handles.k21_input,'String','____');handles.n21string='Cu';

case 'H2O'handles.data_n21 = IndexnH2O(1);handles.var_n21=1;set(handles.n21_input,'String','____');set(handles.k21_input,'String','____');handles.n21string='H2O';

case 'MgF2'handles.data_n21 = IndexnMgF2(1);handles.var_n21=1;set(handles.n21_input,'String','____');set(handles.k21_input,'String','____');handles.n21string='MgF2';

case 'Ni'handles.data_n21 = IndexnNi(1);

handles.var_n21=1;set(handles.n21_input,'String','____');set(handles.k21_input,'String','____');handles.n21string='Ni';

case 'Si3N4'handles.data_n21 = IndexnSi3N4(1);

handles.var_n21=1;set(handles.n21_input,'String','____');set(handles.k21_input,'String','____');handles.n21string='Si3N4';

case 'SiO2'handles.data_n21 = IndexnSiO2(1);handles.var_n21=1;set(handles.n21_input,'String','____');set(handles.k21_input,'String','____');handles.n21string='SiO2';

otherwise,x=10000;

end

guidata(hObject,handles)

% Hints: contents = get(hObject,'String') returns n21varpop_inputcontents as cell array% contents{get(hObject,'Value')} returns selected item fromn21varpop_input

% --- Executes during object creation, after setting all properties.function n31varpop_input_CreateFcn(hObject, eventdata, handles)% hObject handle to n31varpop_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

Page 120: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 22 de 72

% Hint: popupmenu controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

% --- Executes on selection change in n31varpop_input.function n31varpop_input_Callback(hObject, eventdata, handles)% hObject handle to n31varpop_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)val = get(hObject,'Value');str = get(hObject, 'String');switch str{val};case 'No selection'

handles.var_n31=0;set(handles.n31_input,'String','1');set(handles.k31_input,'String','0');

case 'Ag'handles.data_n31 = IndexnAg(1);

handles.var_n31=1;set(handles.n31_input,'String','____');set(handles.k31_input,'String','____');handles.n31string='Ag';

case 'Al'handles.data_n31 = IndexnAl(1);

handles.var_n31=1;set(handles.n31_input,'String','____');set(handles.k31_input,'String','____');handles.n31string='Al';

case 'Au'handles.data_n31 = IndexnAu(1);

handles.var_n31=1;set(handles.n31_input,'String','____');set(handles.k31_input,'String','____');handles.n31string='Au';

case 'Cu'handles.data_n31 = IndexnCu(1);

handles.var_n31=1;set(handles.n31_input,'String','____');set(handles.k31_input,'String','____');handles.n31string='Cu';

case 'H2O'handles.data_n31 = IndexnH2O(1);handles.var_n31=1;set(handles.n31_input,'String','____');set(handles.k31_input,'String','____');handles.n31string='H2O';

case 'MgF2'handles.data_n31 = IndexnMgF2(1);handles.var_n31=1;set(handles.n31_input,'String','____');set(handles.k31_input,'String','____');handles.n31string='MgF2';

case 'Ni'

Page 121: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 23 de 72

handles.data_n31 = IndexnNi(1);handles.var_n31=1;set(handles.n31_input,'String','____');set(handles.k31_input,'String','____');handles.n31string='Ni';

case 'Si3N4'handles.data_n31 = IndexnSi3N4(1);

handles.var_n31=1;set(handles.n31_input,'String','____');set(handles.k31_input,'String','____');handles.n31string='Si3N4';

case 'SiO2'handles.data_n31 = IndexnSiO2(1);handles.var_n31=1;set(handles.n31_input,'String','____');set(handles.k31_input,'String','____');handles.n31string='SiO2';

endguidata(hObject,handles)

% Hints: contents = get(hObject,'String') returns n31varpop_inputcontents as cell array% contents{get(hObject,'Value')} returns selected item fromn31varpop_input

% --- Executes during object creation, after setting all properties.function n22_input_CreateFcn(hObject, eventdata, handles)% hObject handle to n22_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

function n22_input_Callback(hObject, eventdata, handles)% hObject handle to n22_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of n22_input as text% str2double(get(hObject,'String')) returns contents ofn22_input as a double

% --- Executes during object creation, after setting all properties.function h22_input_CreateFcn(hObject, eventdata, handles)% hObject handle to h22_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

Page 122: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 24 de 72

% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

function h22_input_Callback(hObject, eventdata, handles)% hObject handle to h22_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of h22_input as text% str2double(get(hObject,'String')) returns contents ofh22_input as a double

% --- Executes during object creation, after setting all properties.function n32_input_CreateFcn(hObject, eventdata, handles)% hObject handle to n32_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

function n32_input_Callback(hObject, eventdata, handles)% hObject handle to n32_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of n32_input as text% str2double(get(hObject,'String')) returns contents ofn32_input as a double

% --- Executes during object creation, after setting all properties.function N2_input_CreateFcn(hObject, eventdata, handles)% hObject handle to N2_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.

Page 123: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 25 de 72

if ispcset(hObject,'BackgroundColor','white');

else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

function N2_input_Callback(hObject, eventdata, handles)% hObject handle to N2_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of N2_input as text% str2double(get(hObject,'String')) returns contents ofN2_input as a double

% --- Executes during object creation, after setting all properties.function h32_input_CreateFcn(hObject, eventdata, handles)% hObject handle to h32_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

function h32_input_Callback(hObject, eventdata, handles)% hObject handle to h32_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of h32_input as text% str2double(get(hObject,'String')) returns contents ofh32_input as a double

% --- Executes during object creation, after setting all properties.function n22varpop_input_CreateFcn(hObject, eventdata, handles)% hObject handle to n22varpop_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

% Hint: popupmenu controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

Page 124: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 26 de 72

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

% --- Executes on selection change in n22varpop_input.function n22varpop_input_Callback(hObject, eventdata, handles)% hObject handle to n22varpop_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: contents = get(hObject,'String') returns n22varpop_inputcontents as cell array% contents{get(hObject,'Value')} returns selected item fromn22varpop_inputval = get(hObject,'Value');str = get(hObject, 'String');switch str{val};case 'No selection'

handles.var_n22=0;set(handles.n22_input,'String','1');set(handles.k22_input,'String','0');

case 'Ag'handles.data_n22 = IndexnAg(1);

handles.var_n22=1;set(handles.n22_input,'String','____');set(handles.k22_input,'String','____');handles.n22string='Ag';

case 'Al'handles.data_n22 = IndexnAl(1);

handles.var_n22=1;set(handles.n22_input,'String','____');set(handles.k22_input,'String','____');handles.n22string='Al';

case 'Au'handles.data_n22 = IndexnAu(1);

handles.var_n22=1;set(handles.n22_input,'String','____');set(handles.k22_input,'String','____');handles.n22string='Au';

case 'Cu'handles.data_n22 = IndexnCu(1);

handles.var_n22=1;set(handles.n22_input,'String','____');set(handles.k22_input,'String','____');handles.n22string='Cu';

case 'H2O'handles.data_n22 = IndexnH2O(1);handles.var_n22=1;set(handles.n22_input,'String','____');set(handles.k22_input,'String','____');handles.n22string='H2O';

case 'MgF2'handles.data_n22 = IndexnMgF2(1);handles.var_n22=1;set(handles.n22_input,'String','____');set(handles.k22_input,'String','____');handles.n22string='MgF2';

case 'Ni'handles.data_n22 = IndexnNi(1);

Page 125: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 27 de 72

handles.var_n22=1;set(handles.n22_input,'String','____');set(handles.k22_input,'String','____');handles.n22string='Ni';

case 'Si3N4'handles.data_n22 = IndexnSi3N4(1);

handles.var_n22=1;set(handles.n22_input,'String','____');set(handles.k22_input,'String','____');handles.n22string='Si3N4';

case 'SiO2'handles.data_n22 = IndexnSiO2(1);handles.var_n22=1;set(handles.n22_input,'String','____');set(handles.k22_input,'String','____');handles.n22string='SiO2';

otherwise,x=10000;

endguidata(hObject,handles)

% --- Executes during object creation, after setting all properties.function n32varpop_input_CreateFcn(hObject, eventdata, handles)% hObject handle to n32varpop_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

% Hint: popupmenu controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

% --- Executes on selection change in n32varpop_input.function n32varpop_input_Callback(hObject, eventdata, handles)% hObject handle to n32varpop_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)val = get(hObject,'Value');str = get(hObject, 'String');switch str{val};case 'No selection'

handles.var_n32=0;set(handles.n32_input,'String','1');set(handles.k32_input,'String','0');

case 'Ag'handles.data_n32 = IndexnAg(1);

handles.var_n32=1;set(handles.n32_input,'String','____');set(handles.k32_input,'String','____');handles.n32string='Ag';

case 'Al'handles.data_n32 = IndexnAl(1);

handles.var_n32=1;

Page 126: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 28 de 72

set(handles.n32_input,'String','____');set(handles.k32_input,'String','____');handles.n32string='Al';

case 'Au'handles.data_n32 = IndexnAu(1);

handles.var_n32=1;set(handles.n32_input,'String','____');set(handles.k32_input,'String','____');handles.n32string='Au';

case 'Cu'handles.data_n32 = IndexnCu(1);

handles.var_n32=1;set(handles.n32_input,'String','____');set(handles.k32_input,'String','____');handles.n32string='Cu';

case 'H2O'handles.data_n32 = IndexnH2O(1);handles.var_n32=1;set(handles.n32_input,'String','____');set(handles.k32_input,'String','____');handles.n32string='H2O';

case 'MgF2'handles.data_n32 = IndexnMgF2(1);handles.var_n32=1;set(handles.n32_input,'String','____');set(handles.k32_input,'String','____');handles.n32string='MgF2';

case 'Ni'handles.data_n32 = IndexnNi(1);

handles.var_n32=1;set(handles.n32_input,'String','____');set(handles.k32_input,'String','____');handles.n32string='Ni';

case 'Si3N4'handles.data_n32 = IndexnSi3N4(1);

handles.var_n32=1;set(handles.n32_input,'String','____');set(handles.k32_input,'String','____');handles.n32string='Si3N4';

case 'SiO2'handles.data_n32 = IndexnSiO2(1);handles.var_n32=1;set(handles.n32_input,'String','____');set(handles.k32_input,'String','____');handles.n32string='SiO2';

otherwise,x=10000;

endguidata(hObject,handles)

% Hints: contents = get(hObject,'String') returns n32varpop_inputcontents as cell array% contents{get(hObject,'Value')} returns selected item fromn32varpop_input

% --- Executes during object creation, after setting all properties.function n23_input_CreateFcn(hObject, eventdata, handles)% hObject handle to n23_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB

Page 127: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 29 de 72

% handles empty - handles not created until after all CreateFcnscalled

% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

function n23_input_Callback(hObject, eventdata, handles)% hObject handle to n23_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of n23_input as text% str2double(get(hObject,'String')) returns contents ofn23_input as a double

% --- Executes during object creation, after setting all properties.function h23_input_CreateFcn(hObject, eventdata, handles)% hObject handle to h23_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

function h23_input_Callback(hObject, eventdata, handles)% hObject handle to h23_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of h23_input as text% str2double(get(hObject,'String')) returns contents ofh23_input as a double

% --- Executes during object creation, after setting all properties.function n33_input_CreateFcn(hObject, eventdata, handles)% hObject handle to n33_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

Page 128: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 30 de 72

% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

function n33_input_Callback(hObject, eventdata, handles)% hObject handle to n33_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of n33_input as text% str2double(get(hObject,'String')) returns contents ofn33_input as a double

% --- Executes during object creation, after setting all properties.function N3_input_CreateFcn(hObject, eventdata, handles)% hObject handle to N3_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

function N3_input_Callback(hObject, eventdata, handles)% hObject handle to N3_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of N3_input as text% str2double(get(hObject,'String')) returns contents ofN3_input as a double

% --- Executes during object creation, after setting all properties.function h33_input_CreateFcn(hObject, eventdata, handles)% hObject handle to h33_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

Page 129: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 31 de 72

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

function h33_input_Callback(hObject, eventdata, handles)% hObject handle to h33_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of h33_input as text% str2double(get(hObject,'String')) returns contents ofh33_input as a double

% --- Executes during object creation, after setting all properties.function n23varpop_input_CreateFcn(hObject, eventdata, handles)% hObject handle to n23varpop_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

% Hint: popupmenu controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

% --- Executes on selection change in n23varpop_input.function n23varpop_input_Callback(hObject, eventdata, handles)% hObject handle to n23varpop_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)val = get(hObject,'Value');str = get(hObject, 'String');switch str{val};case 'No selection'

handles.var_n23=0;set(handles.n23_input,'String','1');set(handles.k23_input,'String','0');

case 'Ag'handles.data_n23 = IndexnAg(1);

handles.var_n23=1;set(handles.n23_input,'String','____');set(handles.k23_input,'String','____');handles.n23string='Ag';

case 'Al'handles.data_n23 = IndexnAl(1);

handles.var_n23=1;set(handles.n23_input,'String','____');set(handles.k23_input,'String','____');handles.n23string='Al';

Page 130: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 32 de 72

case 'Au'handles.data_n23 = IndexnAu(1);

handles.var_n23=1;set(handles.n23_input,'String','____');set(handles.k23_input,'String','____');handles.n23string='Au';

case 'Cu'handles.data_n23 = IndexnCu(1);

handles.var_n23=1;set(handles.n23_input,'String','____');set(handles.k23_input,'String','____');handles.n23string='Cu';

case 'H2O'handles.data_n23 = IndexnH2O(1);handles.var_n23=1;set(handles.n23_input,'String','____');set(handles.k23_input,'String','____');handles.n23string='H2O';

case 'MgF2'handles.data_n23 = IndexnMgF2(1);handles.var_n23=1;set(handles.n23_input,'String','____');set(handles.k23_input,'String','____');handles.n23string='MgF2';

case 'Ni'handles.data_n23 = IndexnNi(1);

handles.var_n23=1;set(handles.n23_input,'String','____');set(handles.k23_input,'String','____');handles.n23string='Ni';

case 'Si3N4'handles.data_n23 = IndexnSi3N4(1);

handles.var_n23=1;set(handles.n23_input,'String','____');set(handles.k23_input,'String','____');handles.n23string='Si3N4';

case 'SiO2'handles.data_n23 = IndexnSiO2(1);handles.var_n23=1;set(handles.n23_input,'String','____');set(handles.k23_input,'String','____');handles.n23string='SiO2';

otherwise,x=10000;

endguidata(hObject,handles)

% Hints: contents = get(hObject,'String') returns n23varpop_inputcontents as cell array% contents{get(hObject,'Value')} returns selected item fromn23varpop_input

% --- Executes during object creation, after setting all properties.function n33varpop_input_CreateFcn(hObject, eventdata, handles)% hObject handle to n33varpop_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

% Hint: popupmenu controls usually have a white background on Windows.

Page 131: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 33 de 72

% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

% --- Executes on selection change in n33varpop_input.function n33varpop_input_Callback(hObject, eventdata, handles)% hObject handle to n33varpop_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)val = get(hObject,'Value');str = get(hObject, 'String');switch str{val};case 'No selection'

handles.var_n33=0;set(handles.n33_input,'String','1');set(handles.k33_input,'String','0');

case 'Ag'handles.data_n33 = IndexnAg(1);

handles.var_n33=1;set(handles.n33_input,'String','____');set(handles.k33_input,'String','____');handles.n33string='Ag';

case 'Al'handles.data_n33 = IndexnAl(1);

handles.var_n33=1;set(handles.n33_input,'String','____');set(handles.k33_input,'String','____');handles.n33string='Al';

case 'Au'handles.data_n33 = IndexnAu(1);

handles.var_n33=1;set(handles.n33_input,'String','____');set(handles.k33_input,'String','____');handles.n33string='Au';

case 'Cu'handles.data_n33 = IndexnCu(1);

handles.var_n33=1;set(handles.n33_input,'String','____');set(handles.k33_input,'String','____');handles.n33string='Cu';

case 'H2O'handles.data_n33 = IndexnH2O(1);

handles.var_n33=1;set(handles.n33_input,'String','____');set(handles.k33_input,'String','____');handles.n33string='H2O';

case 'MgF2'handles.data_n33 = IndexnMgF2(1);handles.var_n33=1;set(handles.n33_input,'String','____');set(handles.k33_input,'String','____');handles.n33string='MgF2';

case 'Ni'handles.data_n33 = IndexnNi(1);

handles.var_n33=1;

Page 132: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 34 de 72

set(handles.n33_input,'String','____');set(handles.k33_input,'String','____');handles.n33string='Ni';

case 'Si3N4'handles.data_n33 = IndexnSi3N4(1);

handles.var_n33=1;set(handles.n33_input,'String','____');set(handles.k33_input,'String','____');handles.n33string='Si3N4';

case 'SiO2'handles.data_n33 = IndexnSiO2(1);handles.var_n33=1;set(handles.n33_input,'String','____');set(handles.k33_input,'String','____');handles.n33string='SiO2';

otherwise,x=10000;

endguidata(hObject,handles)

% Hints: contents = get(hObject,'String') returns n33varpop_inputcontents as cell array% contents{get(hObject,'Value')} returns selected item fromn33varpop_input

% --- Executes during object creation, after setting all properties.function nestruc_input_CreateFcn(hObject, eventdata, handles)% hObject handle to nestruc_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

% Hint: popupmenu controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

% --- Executes on selection change in nestruc_input.function nestruc_input_Callback(hObject, eventdata, handles)% hObject handle to nestruc_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)val = get(hObject,'Value');str = get(hObject, 'String');switch str{val};case '1'

handles.nestruc=1;case '2'

handles.nestruc=2;case '3'

handles.nestruc=3;endguidata(hObject,handles)%nestruc= str2double(get(handles.nestruc_input,'String'))

Page 133: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 35 de 72

if handles.nestruc==1set(handles.n22_input,'Visible','off');set(handles.k22_input,'Visible','off');set(handles.n32_input,'Visible','off');set(handles.k32_input,'Visible','off');set(handles.h22_input,'Visible','off');set(handles.h32_input,'Visible','off');set(handles.n22varpop_input,'Visible','off');set(handles.n32varpop_input,'Visible','off');set(handles.N2_input,'Visible','off');set(handles.text76,'Visible','off');set(handles.text77,'Visible','off');set(handles.text78,'Visible','off');set(handles.text79,'Visible','off');set(handles.text80,'Visible','off');set(handles.text81,'Visible','off');set(handles.text82,'Visible','off');set(handles.text83,'Visible','off');set(handles.text123,'Visible','off');set(handles.text124,'Visible','off');set(handles.frame26,'Visible','off');

% set(handles.rug22_check,'Visible','off');% set(handles.rug32_check,'Visible','off');% set(handles.nrug22_input,'Visible','off');% set(handles.hrug22_input,'Visible','off');% set(handles.nrug32_input,'Visible','off');% set(handles.hrug32_input,'Visible','off');% set(handles.text131,'Visible','off');% set(handles.text133,'Visible','off');% set(handles.text132,'Visible','off');% set(handles.text134,'Visible','off');

% set(handles.rug23_check,'Visible','off');% set(handles.rug33_check,'Visible','off');% set(handles.nrug23_input,'Visible','off');% set(handles.hrug23_input,'Visible','off');% set(handles.nrug33_input,'Visible','off');% set(handles.hrug33_input,'Visible','off');% set(handles.text135,'Visible','off');% set(handles.text137,'Visible','off');% set(handles.text136,'Visible','off');% set(handles.text138,'Visible','off');

set(handles.n23_input,'Visible','off');set(handles.k23_input,'Visible','off');set(handles.n33_input,'Visible','off');set(handles.k33_input,'Visible','off');set(handles.h23_input,'Visible','off');set(handles.h33_input,'Visible','off');set(handles.n23varpop_input,'Visible','off');set(handles.n33varpop_input,'Visible','off');set(handles.N3_input,'Visible','off');set(handles.text84,'Visible','off');set(handles.text85,'Visible','off');set(handles.text86,'Visible','off');set(handles.text87,'Visible','off');set(handles.text88,'Visible','off');set(handles.text89,'Visible','off');set(handles.text108,'Visible','off');set(handles.text115,'Visible','off');set(handles.text125,'Visible','off');

Page 134: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 36 de 72

set(handles.text126,'Visible','off');set(handles.frame21,'Visible','off');

% set(handles.Picl1,'Visible','on');% set(handles.Picl2,'Visible','on');% set(handles.Picl3,'Visible','on');% set(handles.Picl4,'Visible','on');% set(handles.Picl5,'Visible','on');% set(handles.Picl6,'Visible','on');% set(handles.Picl7,'Visible','on');% set(handles.Picl8,'Visible','on');% set(handles.Picl9,'Visible','on');% set(handles.Picl10,'Visible','on');% set(handles.Picl11,'Visible','on');% set(handles.Picl12,'Visible','on');% set(handles.Picl13,'Visible','on');% set(handles.Picl14,'Visible','on');% set(handles.Picl15,'Visible','on');% set(handles.Picl16,'Visible','on');% set(handles.Picl17,'Visible','on');% set(handles.Picl18,'Visible','on');% set(handles.Picl19,'Visible','on');% set(handles.Picl20,'Visible','on');% set(handles.Picl21,'Visible','on');% set(handles.Picnamb,'Visible','on');% set(handles.Picnsubs,'Visible','on');% set(handles.Pic1,'Visible','on');% set(handles.Pic2,'Visible','on');% set(handles.Pic3,'Visible','on');% set(handles.Pic4,'Visible','on');% set(handles.Pic5,'Visible','on');% set(handles.Pic6,'Visible','on');% set(handles.Pic7,'Visible','on');% % set(handles.Pic8,'Visible','on');% set(handles.Pic9,'Visible','on');% set(handles.Pic10,'Visible','on');% set(handles.Pic11,'Visible','on');% set(handles.Pic12,'Visible','on');% set(handles.Pic13,'Visible','on');% set(handles.Pic14,'Visible','on');% set(handles.Pic15,'Visible','on');% set(handles.Pic16,'Visible','on');% set(handles.Pictit,'Visible','on');

end

if handles.nestruc==2set(handles.n22_input,'Visible','on');set(handles.k22_input,'Visible','on');set(handles.n32_input,'Visible','on');set(handles.k32_input,'Visible','on');set(handles.h22_input,'Visible','on');set(handles.h32_input,'Visible','on');set(handles.n22varpop_input,'Visible','on');set(handles.n32varpop_input,'Visible','on');set(handles.N2_input,'Visible','on');set(handles.text76,'Visible','on');set(handles.text77,'Visible','on');set(handles.text78,'Visible','on');set(handles.text79,'Visible','on');set(handles.text80,'Visible','on');

Page 135: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 37 de 72

set(handles.text81,'Visible','on');set(handles.text82,'Visible','on');set(handles.text83,'Visible','on');set(handles.text123,'Visible','on');set(handles.text124,'Visible','on');set(handles.frame26,'Visible','on');

% set(handles.rug22_check,'Visible','on');% set(handles.rug32_check,'Visible','on');%% set(handles.rug23_check,'Visible','off');% set(handles.rug33_check,'Visible','off');% set(handles.nrug23_input,'Visible','off');% set(handles.hrug23_input,'Visible','off');% set(handles.nrug33_input,'Visible','off');% set(handles.hrug33_input,'Visible','off');% set(handles.text135,'Visible','off');% set(handles.text137,'Visible','off');% set(handles.text136,'Visible','off');% set(handles.text138,'Visible','off');

set(handles.n23_input,'Visible','off');set(handles.k23_input,'Visible','off');set(handles.n33_input,'Visible','off');set(handles.k33_input,'Visible','off');set(handles.h23_input,'Visible','off');set(handles.h33_input,'Visible','off');set(handles.n23varpop_input,'Visible','off');set(handles.n33varpop_input,'Visible','off');set(handles.N3_input,'Visible','off');set(handles.text84,'Visible','off');set(handles.text85,'Visible','off');set(handles.text86,'Visible','off');set(handles.text87,'Visible','off');set(handles.text88,'Visible','off');set(handles.text89,'Visible','off');set(handles.text108,'Visible','off');set(handles.text115,'Visible','off');set(handles.text125,'Visible','off');set(handles.text126,'Visible','off');set(handles.frame21,'Visible','off');

% set(handles.Picl1,'Visible','off');% set(handles.Picl2,'Visible','off');% set(handles.Picl3,'Visible','off');% set(handles.Picl4,'Visible','off');% set(handles.Picl5,'Visible','off');% set(handles.Picl6,'Visible','off');% set(handles.Picl7,'Visible','off');% set(handles.Picl8,'Visible','off');% set(handles.Picl9,'Visible','off');% set(handles.Picl10,'Visible','off');% set(handles.Picl11,'Visible','off');% set(handles.Picl12,'Visible','off');% set(handles.Picl13,'Visible','off');% set(handles.Picl14,'Visible','off');% set(handles.Picl15,'Visible','off');% set(handles.Picl16,'Visible','off');% set(handles.Picl17,'Visible','off');% set(handles.Picl18,'Visible','off');% set(handles.Picl19,'Visible','off');

Page 136: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 38 de 72

% set(handles.Picl20,'Visible','off');% set(handles.Picl21,'Visible','off');% set(handles.Picnamb,'Visible','off');% set(handles.Picnsubs,'Visible','off');% set(handles.Pic1,'Visible','off');% set(handles.Pic2,'Visible','off');% set(handles.Pic3,'Visible','off');% set(handles.Pic4,'Visible','off');% set(handles.Pic5,'Visible','off');% set(handles.Pic6,'Visible','off');% set(handles.Pic7,'Visible','off');% % set(handles.Pic8,'Visible','off');% set(handles.Pic9,'Visible','off');% set(handles.Pic10,'Visible','off');% set(handles.Pic11,'Visible','off');% set(handles.Pic12,'Visible','off');% set(handles.Pic13,'Visible','off');% set(handles.Pic14,'Visible','off');% set(handles.Pic15,'Visible','off');% set(handles.Pic16,'Visible','off');% set(handles.Pictit,'Visible','off');end

%endif handles.nestruc==3

set(handles.n22_input,'Visible','on');set(handles.k22_input,'Visible','on');set(handles.n32_input,'Visible','on');set(handles.k32_input,'Visible','on');set(handles.h22_input,'Visible','on');set(handles.h32_input,'Visible','on');set(handles.n22varpop_input,'Visible','on');set(handles.n32varpop_input,'Visible','on');set(handles.N2_input,'Visible','on');set(handles.text76,'Visible','on');set(handles.text77,'Visible','on');set(handles.text78,'Visible','on');set(handles.text79,'Visible','on');set(handles.text80,'Visible','on');set(handles.text81,'Visible','on');set(handles.text82,'Visible','on');set(handles.text83,'Visible','on');set(handles.text123,'Visible','on');set(handles.text124,'Visible','on');set(handles.frame26,'Visible','on');

% set(handles.rug22_check,'Visible','on');% set(handles.rug32_check,'Visible','on');%% set(handles.rug23_check,'Visible','on');% set(handles.rug33_check,'Visible','on');

set(handles.n23_input,'Visible','on');set(handles.k23_input,'Visible','on');set(handles.n33_input,'Visible','on');set(handles.k33_input,'Visible','on');set(handles.h23_input,'Visible','on');set(handles.h33_input,'Visible','on');set(handles.n23varpop_input,'Visible','on');set(handles.n33varpop_input,'Visible','on');

Page 137: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 39 de 72

set(handles.N3_input,'Visible','on');set(handles.text84,'Visible','on');set(handles.text85,'Visible','on');set(handles.text86,'Visible','on');set(handles.text87,'Visible','on');set(handles.text88,'Visible','on');set(handles.text89,'Visible','on');set(handles.text108,'Visible','on');set(handles.text115,'Visible','on');set(handles.text125,'Visible','on');set(handles.text126,'Visible','on');set(handles.frame21,'Visible','on');

% set(handles.Picl1,'Visible','off');% set(handles.Picl2,'Visible','off');% set(handles.Picl3,'Visible','off');% set(handles.Picl4,'Visible','off');% set(handles.Picl5,'Visible','off');% set(handles.Picl6,'Visible','off');% set(handles.Picl7,'Visible','off');% set(handles.Picl8,'Visible','off');% set(handles.Picl9,'Visible','off');% set(handles.Picl10,'Visible','off');% set(handles.Picl11,'Visible','off');% set(handles.Picl12,'Visible','off');% set(handles.Picl13,'Visible','off');% set(handles.Picl14,'Visible','off');% set(handles.Picl15,'Visible','off');% set(handles.Picl16,'Visible','off');% set(handles.Picl17,'Visible','off');% set(handles.Picl18,'Visible','off');% set(handles.Picl19,'Visible','off');% set(handles.Picl20,'Visible','off');% set(handles.Picl21,'Visible','off');% set(handles.Picnamb,'Visible','off');% set(handles.Picnsubs,'Visible','off');% set(handles.Pic1,'Visible','off');% set(handles.Pic2,'Visible','off');% set(handles.Pic3,'Visible','off');% set(handles.Pic4,'Visible','off');% set(handles.Pic5,'Visible','off');% set(handles.Pic6,'Visible','off');% set(handles.Pic7,'Visible','off');% % set(handles.Pic8,'Visible','off');% set(handles.Pic9,'Visible','off');% set(handles.Pic10,'Visible','off');% set(handles.Pic11,'Visible','off');% set(handles.Pic12,'Visible','off');% set(handles.Pic13,'Visible','off');% set(handles.Pic14,'Visible','off');% set(handles.Pic15,'Visible','off');% set(handles.Pic16,'Visible','off');% set(handles.Pictit,'Visible','off');

endguidata(hObject,handles)

% Hints: contents = get(hObject,'String') returns nestruc_inputcontents as cell array% contents{get(hObject,'Value')} returns selected item fromnestruc_input

Page 138: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 40 de 72

% --- Executes on button press in TEsep.function TEsep_Callback(hObject, eventdata, handles)% hObject handle to TEsep (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of TEsep

% --- Executes on button press in TMsep.function TMsep_Callback(hObject, eventdata, handles)% hObject handle to TMsep (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of TMsep

% --- Executes during object creation, after setting all properties.function step_input_CreateFcn(hObject, eventdata, handles)% hObject handle to step_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

function step_input_Callback(hObject, eventdata, handles)% hObject handle to step_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of step_input as text% str2double(get(hObject,'String')) returns contents ofstep_input as a double

% --- Executes on button press in exportData.function exportData_Callback(hObject, eventdata, handles)% hObject handle to exportData (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of exportData

% --- Executes during object creation, after setting all properties.function k21_input_CreateFcn(hObject, eventdata, handles)% hObject handle to k21_input (see GCBO)

Page 139: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 41 de 72

% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

function k21_input_Callback(hObject, eventdata, handles)% hObject handle to k21_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of k21_input as text% str2double(get(hObject,'String')) returns contents ofk21_input as a double

% --- Executes during object creation, after setting all properties.function k31_input_CreateFcn(hObject, eventdata, handles)% hObject handle to k31_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

function k31_input_Callback(hObject, eventdata, handles)% hObject handle to k31_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of k31_input as text% str2double(get(hObject,'String')) returns contents ofk31_input as a double

% --- Executes during object creation, after setting all properties.function k22_input_CreateFcn(hObject, eventdata, handles)% hObject handle to k22_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

Page 140: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 42 de 72

% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

function k22_input_Callback(hObject, eventdata, handles)% hObject handle to k22_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of k22_input as text% str2double(get(hObject,'String')) returns contents ofk22_input as a double

% --- Executes during object creation, after setting all properties.function k32_input_CreateFcn(hObject, eventdata, handles)% hObject handle to k32_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

function k32_input_Callback(hObject, eventdata, handles)% hObject handle to k32_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of k32_input as text% str2double(get(hObject,'String')) returns contents ofk32_input as a double

% --- Executes during object creation, after setting all properties.function k23_input_CreateFcn(hObject, eventdata, handles)% hObject handle to k23_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.

Page 141: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 43 de 72

if ispcset(hObject,'BackgroundColor','white');

else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

function k23_input_Callback(hObject, eventdata, handles)% hObject handle to k23_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of k23_input as text% str2double(get(hObject,'String')) returns contents ofk23_input as a double

% --- Executes during object creation, after setting all properties.function k33_input_CreateFcn(hObject, eventdata, handles)% hObject handle to k33_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

function k33_input_Callback(hObject, eventdata, handles)% hObject handle to k33_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of k33_input as text% str2double(get(hObject,'String')) returns contents ofk33_input as a double

% --- Executes on button press in rug21_check.% function rug21_check_Callback(hObject, eventdata, handles)% % hObject handle to rug21_check (see GCBO)% % eventdata reserved - to be defined in a future version of MATLAB% % handles structure with handles and user data (see GUIDATA)% ver= get(handles.rug21_check,'Value');% if ver==1% set(handles.nrug21_input,'Visible','on');% set(handles.hrug21_input,'Visible','on');% set(handles.text127,'Visible','on');% set(handles.text129,'Visible','on');% else

Page 142: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 44 de 72

% set(handles.nrug21_input,'Visible','off');% set(handles.hrug21_input,'Visible','off');% set(handles.text127,'Visible','off');% set(handles.text129,'Visible','off');% end

% Hint: get(hObject,'Value') returns toggle state of rug21_check

% --- Executes on button press in rug31_check.% function rug31_check_Callback(hObject, eventdata, handles)% % hObject handle to rug31_check (see GCBO)% % eventdata reserved - to be defined in a future version of MATLAB% % handles structure with handles and user data (see GUIDATA)% ver= get(handles.rug31_check,'Value');% if ver==1% set(handles.nrug31_input,'Visible','on');% set(handles.hrug31_input,'Visible','on');% set(handles.text128,'Visible','on');% set(handles.text130,'Visible','on');% else% set(handles.nrug31_input,'Visible','off');% set(handles.hrug31_input,'Visible','off');% set(handles.text128,'Visible','off');% set(handles.text130,'Visible','off');% end%% Hint: get(hObject,'Value') returns toggle state of rug31_check

% --- Executes during object creation, after setting all properties.% function nrug21_input_CreateFcn(hObject, eventdata, handles)% % hObject handle to nrug21_input (see GCBO)% % eventdata reserved - to be defined in a future version of MATLAB% % handles empty - handles not created until after all CreateFcnscalled%% % Hint: edit controls usually have a white background on Windows.% % See ISPC and COMPUTER.% if ispc% set(hObject,'BackgroundColor','white');% else%set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));% end%

% function nrug21_input_Callback(hObject, eventdata, handles)% % hObject handle to nrug21_input (see GCBO)% % eventdata reserved - to be defined in a future version of MATLAB% % handles structure with handles and user data (see GUIDATA)%% % Hints: get(hObject,'String') returns contents of nrug21_input astext% % str2double(get(hObject,'String')) returns contents ofnrug21_input as a double%%% % --- Executes during object creation, after setting all properties.

Page 143: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 45 de 72

% function nrug31_input_CreateFcn(hObject, eventdata, handles)% % hObject handle to nrug31_input (see GCBO)% % eventdata reserved - to be defined in a future version of MATLAB% % handles empty - handles not created until after all CreateFcnscalled%% % Hint: edit controls usually have a white background on Windows.% % See ISPC and COMPUTER.% if ispc% set(hObject,'BackgroundColor','white');% else%set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));% end%%%% function nrug31_input_Callback(hObject, eventdata, handles)% % hObject handle to nrug31_input (see GCBO)% % eventdata reserved - to be defined in a future version of MATLAB% % handles structure with handles and user data (see GUIDATA)%% % Hints: get(hObject,'String') returns contents of nrug31_input astext% % str2double(get(hObject,'String')) returns contents ofnrug31_input as a double%%% % --- Executes during object creation, after setting all properties.% function hrug21_input_CreateFcn(hObject, eventdata, handles)% % hObject handle to hrug21_input (see GCBO)% % eventdata reserved - to be defined in a future version of MATLAB% % handles empty - handles not created until after all CreateFcnscalled%% % Hint: edit controls usually have a white background on Windows.% % See ISPC and COMPUTER.% if ispc% set(hObject,'BackgroundColor','white');% else%set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));% end%%%% function hrug21_input_Callback(hObject, eventdata, handles)% % hObject handle to hrug21_input (see GCBO)% % eventdata reserved - to be defined in a future version of MATLAB% % handles structure with handles and user data (see GUIDATA)%% % Hints: get(hObject,'String') returns contents of hrug21_input astext% % str2double(get(hObject,'String')) returns contents ofhrug21_input as a double%%% % --- Executes during object creation, after setting all properties.% function hrug31_input_CreateFcn(hObject, eventdata, handles)

Page 144: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 46 de 72

% % hObject handle to hrug31_input (see GCBO)% % eventdata reserved - to be defined in a future version of MATLAB% % handles empty - handles not created until after all CreateFcnscalled%% % Hint: edit controls usually have a white background on Windows.% % See ISPC and COMPUTER.% if ispc% set(hObject,'BackgroundColor','white');% else%set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));% end%%%% function hrug31_input_Callback(hObject, eventdata, handles)% % hObject handle to hrug31_input (see GCBO)% % eventdata reserved - to be defined in a future version of MATLAB% % handles structure with handles and user data (see GUIDATA)%% % Hints: get(hObject,'String') returns contents of hrug31_input astext% % str2double(get(hObject,'String')) returns contents ofhrug31_input as a double%%% % --- Executes on button press in rug22_check.% function rug22_check_Callback(hObject, eventdata, handles)% % hObject handle to rug22_check (see GCBO)% % eventdata reserved - to be defined in a future version of MATLAB% % handles structure with handles and user data (see GUIDATA)% ver= get(handles.rug22_check,'Value');% if ver==1% set(handles.nrug22_input,'Visible','on');% set(handles.hrug22_input,'Visible','on');% set(handles.text131,'Visible','on');% set(handles.text133,'Visible','on');% else% set(handles.nrug22_input,'Visible','off');% set(handles.hrug22_input,'Visible','off');% set(handles.text131,'Visible','off');% set(handles.text133,'Visible','off');% end%% % Hint: get(hObject,'Value') returns toggle state of rug22_check%%% % --- Executes on button press in rug32_check.% function rug32_check_Callback(hObject, eventdata, handles)% % hObject handle to rug32_check (see GCBO)% % eventdata reserved - to be defined in a future version of MATLAB% % handles structure with handles and user data (see GUIDATA)% ver= get(handles.rug32_check,'Value');% if ver==1% set(handles.nrug32_input,'Visible','on');% set(handles.hrug32_input,'Visible','on');% set(handles.text132,'Visible','on');% set(handles.text134,'Visible','on');% else

Page 145: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 47 de 72

% set(handles.nrug32_input,'Visible','off');% set(handles.hrug32_input,'Visible','off');% set(handles.text132,'Visible','off');% set(handles.text134,'Visible','off');% end%% % Hint: get(hObject,'Value') returns toggle state of rug32_check%%% % --- Executes during object creation, after setting all properties.% function nrug22_input_CreateFcn(hObject, eventdata, handles)% % hObject handle to nrug22_input (see GCBO)% % eventdata reserved - to be defined in a future version of MATLAB% % handles empty - handles not created until after all CreateFcnscalled%% % Hint: edit controls usually have a white background on Windows.% % See ISPC and COMPUTER.% if ispc% set(hObject,'BackgroundColor','white');% else%set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));% end%%%% function nrug22_input_Callback(hObject, eventdata, handles)% % hObject handle to nrug22_input (see GCBO)% % eventdata reserved - to be defined in a future version of MATLAB% % handles structure with handles and user data (see GUIDATA)%% % Hints: get(hObject,'String') returns contents of nrug22_input astext% % str2double(get(hObject,'String')) returns contents ofnrug22_input as a double%%% % --- Executes during object creation, after setting all properties.% function nrug32_input_CreateFcn(hObject, eventdata, handles)% % hObject handle to nrug32_input (see GCBO)% % eventdata reserved - to be defined in a future version of MATLAB% % handles empty - handles not created until after all CreateFcnscalled%% % Hint: edit controls usually have a white background on Windows.% % See ISPC and COMPUTER.% if ispc% set(hObject,'BackgroundColor','white');% else%set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));% end%%%% function nrug32_input_Callback(hObject, eventdata, handles)% % hObject handle to nrug32_input (see GCBO)% % eventdata reserved - to be defined in a future version of MATLAB

Page 146: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 48 de 72

% % handles structure with handles and user data (see GUIDATA)%% % Hints: get(hObject,'String') returns contents of nrug32_input astext% % str2double(get(hObject,'String')) returns contents ofnrug32_input as a double%%% % --- Executes during object creation, after setting all properties.% function hrug22_input_CreateFcn(hObject, eventdata, handles)% % hObject handle to hrug22_input (see GCBO)% % eventdata reserved - to be defined in a future version of MATLAB% % handles empty - handles not created until after all CreateFcnscalled%% % Hint: edit controls usually have a white background on Windows.% % See ISPC and COMPUTER.% if ispc% set(hObject,'BackgroundColor','white');% else%set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));% end%%%% function hrug22_input_Callback(hObject, eventdata, handles)% % hObject handle to hrug22_input (see GCBO)% % eventdata reserved - to be defined in a future version of MATLAB% % handles structure with handles and user data (see GUIDATA)%% % Hints: get(hObject,'String') returns contents of hrug22_input astext% % str2double(get(hObject,'String')) returns contents ofhrug22_input as a double%%% % --- Executes during object creation, after setting all properties.% function hrug32_input_CreateFcn(hObject, eventdata, handles)% % hObject handle to hrug32_input (see GCBO)% % eventdata reserved - to be defined in a future version of MATLAB% % handles empty - handles not created until after all CreateFcnscalled%% % Hint: edit controls usually have a white background on Windows.% % See ISPC and COMPUTER.% if ispc% set(hObject,'BackgroundColor','white');% else%set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));% end%%%% function hrug32_input_Callback(hObject, eventdata, handles)% % hObject handle to hrug32_input (see GCBO)% % eventdata reserved - to be defined in a future version of MATLAB% % handles structure with handles and user data (see GUIDATA)

Page 147: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 49 de 72

%% % Hints: get(hObject,'String') returns contents of hrug32_input astext% % str2double(get(hObject,'String')) returns contents ofhrug32_input as a double%%% % --- Executes on button press in rug23_check.% function rug23_check_Callback(hObject, eventdata, handles)% % hObject handle to rug23_check (see GCBO)% % eventdata reserved - to be defined in a future version of MATLAB% % handles structure with handles and user data (see GUIDATA)% ver= get(handles.rug23_check,'Value');% if ver==1% set(handles.nrug23_input,'Visible','on');% set(handles.hrug23_input,'Visible','on');% set(handles.text135,'Visible','on');% set(handles.text137,'Visible','on');% else% set(handles.nrug23_input,'Visible','off');% set(handles.hrug23_input,'Visible','off');% set(handles.text135,'Visible','off');% set(handles.text137,'Visible','off');% end%% % Hint: get(hObject,'Value') returns toggle state of rug23_check%%% % --- Executes on button press in rug33_check.% function rug33_check_Callback(hObject, eventdata, handles)% % hObject handle to rug33_check (see GCBO)% % eventdata reserved - to be defined in a future version of MATLAB% % handles structure with handles and user data (see GUIDATA)% ver= get(handles.rug33_check,'Value');% if ver==1% set(handles.nrug33_input,'Visible','on');% set(handles.hrug33_input,'Visible','on');% set(handles.text136,'Visible','on');% set(handles.text138,'Visible','on');% else% set(handles.nrug33_input,'Visible','off');% set(handles.hrug33_input,'Visible','off');% set(handles.text136,'Visible','off');% set(handles.text138,'Visible','off');% end%% % Hint: get(hObject,'Value') returns toggle state of rug33_check%%% % --- Executes during object creation, after setting all properties.% function nrug23_input_CreateFcn(hObject, eventdata, handles)% % hObject handle to nrug23_input (see GCBO)% % eventdata reserved - to be defined in a future version of MATLAB% % handles empty - handles not created until after all CreateFcnscalled%% % Hint: edit controls usually have a white background on Windows.% % See ISPC and COMPUTER.% if ispc% set(hObject,'BackgroundColor','white');% else

Page 148: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 50 de 72

%set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));% end%%%% function nrug23_input_Callback(hObject, eventdata, handles)% % hObject handle to nrug23_input (see GCBO)% % eventdata reserved - to be defined in a future version of MATLAB% % handles structure with handles and user data (see GUIDATA)%% % Hints: get(hObject,'String') returns contents of nrug23_input astext% % str2double(get(hObject,'String')) returns contents ofnrug23_input as a double%%% % --- Executes during object creation, after setting all properties.% function nrug33_input_CreateFcn(hObject, eventdata, handles)% % hObject handle to nrug33_input (see GCBO)% % eventdata reserved - to be defined in a future version of MATLAB% % handles empty - handles not created until after all CreateFcnscalled%% % Hint: edit controls usually have a white background on Windows.% % See ISPC and COMPUTER.% if ispc% set(hObject,'BackgroundColor','white');% else%set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));% end%%%% function nrug33_input_Callback(hObject, eventdata, handles)% % hObject handle to nrug33_input (see GCBO)% % eventdata reserved - to be defined in a future version of MATLAB% % handles structure with handles and user data (see GUIDATA)%% % Hints: get(hObject,'String') returns contents of nrug33_input astext% % str2double(get(hObject,'String')) returns contents ofnrug33_input as a double%%% % --- Executes during object creation, after setting all properties.% function hrug23_input_CreateFcn(hObject, eventdata, handles)% % hObject handle to hrug23_input (see GCBO)% % eventdata reserved - to be defined in a future version of MATLAB% % handles empty - handles not created until after all CreateFcnscalled%% % Hint: edit controls usually have a white background on Windows.% % See ISPC and COMPUTER.% if ispc% set(hObject,'BackgroundColor','white');% else

Page 149: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 51 de 72

%set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));% end%%%% function hrug23_input_Callback(hObject, eventdata, handles)% % hObject handle to hrug23_input (see GCBO)% % eventdata reserved - to be defined in a future version of MATLAB% % handles structure with handles and user data (see GUIDATA)%% % Hints: get(hObject,'String') returns contents of hrug23_input astext% % str2double(get(hObject,'String')) returns contents ofhrug23_input as a double%%% % --- Executes during object creation, after setting all properties.% function hrug33_input_CreateFcn(hObject, eventdata, handles)% % hObject handle to hrug33_input (see GCBO)% % eventdata reserved - to be defined in a future version of MATLAB% % handles empty - handles not created until after all CreateFcnscalled%% % Hint: edit controls usually have a white background on Windows.% % See ISPC and COMPUTER.% if ispc% set(hObject,'BackgroundColor','white');% else%set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));% end%%%% function hrug33_input_Callback(hObject, eventdata, handles)% % hObject handle to hrug33_input (see GCBO)% % eventdata reserved - to be defined in a future version of MATLAB% % handles structure with handles and user data (see GUIDATA)%% % Hints: get(hObject,'String') returns contents of hrug33_input astext% % str2double(get(hObject,'String')) returns contents ofhrug33_input as a double%%% % --- Executes during object creation, after setting all properties.% function hrug33_CreateFcn(hObject, eventdata, handles)% % hObject handle to hrug33 (see GCBO)% % eventdata reserved - to be defined in a future version of MATLAB% % handles empty - handles not created until after all CreateFcnscalled%% % Hint: edit controls usually have a white background on Windows.% % See ISPC and COMPUTER.% if ispc% set(hObject,'BackgroundColor','white');% else

Page 150: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 52 de 72

%set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));% end%%%% function hrug33_Callback(hObject, eventdata, handles)% % hObject handle to hrug33 (see GCBO)% % eventdata reserved - to be defined in a future version of MATLAB% % handles structure with handles and user data (see GUIDATA)%% % Hints: get(hObject,'String') returns contents of hrug33 as text% % str2double(get(hObject,'String')) returns contents ofhrug33 as a double

% --- Executes on button press in sumaTETM_check.function sumaTETM_check_Callback(hObject, eventdata, handles)% hObject handle to sumaTETM_check (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of sumaTETM_check

% --- Executes on button press in cabecera_input.function cabecera_input_Callback(hObject, eventdata, handles)% hObject handle to cabecera_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of cabecera_input

% --- Executes during object creation, after setting all properties.function bn21_input_CreateFcn(hObject, eventdata, handles)% hObject handle to bn21_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

function bn21_input_Callback(hObject, eventdata, handles)% hObject handle to bn21_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of bn21_input as text

Page 151: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 53 de 72

% str2double(get(hObject,'String')) returns contents ofbn21_input as a double

% --- Executes during object creation, after setting all properties.function cn21_input_CreateFcn(hObject, eventdata, handles)% hObject handle to cn21_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

function cn21_input_Callback(hObject, eventdata, handles)% hObject handle to cn21_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of cn21_input as text% str2double(get(hObject,'String')) returns contents ofcn21_input as a double

function slsellmeier_Callback(hObject, eventdata, handles)% hObject handle to slcauchy (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of slcauchy% --- Executes on button press in slcauchy.function slcauchy_Callback(hObject, eventdata, handles)% hObject handle to slcauchy (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of slcauchy

% --- Executes on button press in loaddates.function loaddates_Callback(hObject, eventdata, handles)% hObject handle to loaddates (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of loaddates

% --- Executes during object creation, after setting all properties.function filtrodatos_CreateFcn(hObject, eventdata, handles)% hObject handle to filtrodatos (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB

Page 152: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 54 de 72

% handles empty - handles not created until after all CreateFcnscalled

% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

function filtrodatos_Callback(hObject, eventdata, handles)% hObject handle to filtrodatos (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of filtrodatos as text% str2double(get(hObject,'String')) returns contents offiltrodatos as a double

% --- Executes during object creation, after setting all properties.function polnum_CreateFcn(hObject, eventdata, handles)% hObject handle to polnum (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

function polnum_Callback(hObject, eventdata, handles)% hObject handle to polnum (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of polnum as text% str2double(get(hObject,'String')) returns contents of polnumas a double

% --- Executes during object creation, after setting all properties.function dn21_input_CreateFcn(hObject, eventdata, handles)% hObject handle to dn21_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

Page 153: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 55 de 72

% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

function dn21_input_Callback(hObject, eventdata, handles)% hObject handle to dn21_input (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of dn21_input as text% str2double(get(hObject,'String')) returns contents ofdn21_input as a double

% --- Executes on button press in visualitzacio.function visualitzacio_Callback(hObject, eventdata, handles)% hObject handle to visualitzacio (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)[col1,col2]=lectura;

figure(5);hold on;plot(col1,col2);

end

% --- Executes during object creation, after setting all properties.function error_CreateFcn(hObject, eventdata, handles)% hObject handle to error (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

function error_Callback(hObject, eventdata, handles)% hObject handle to error (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of error as text% str2double(get(hObject,'String')) returns contents of erroras a double

Page 154: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 56 de 72

% --- Executes during object creation, after setting all properties.function un22_CreateFcn(hObject, eventdata, handles)% hObject handle to un22 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

function un22_Callback(hObject, eventdata, handles)% hObject handle to un22 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of un22 as text% str2double(get(hObject,'String')) returns contents of un22 asa double

% --- Executes during object creation, after setting all properties.function bn22_CreateFcn(hObject, eventdata, handles)% hObject handle to bn22 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

function bn22_Callback(hObject, eventdata, handles)% hObject handle to bn22 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of bn22 as text% str2double(get(hObject,'String')) returns contents of bn22 asa double

% --- Executes during object creation, after setting all properties.

Page 155: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 57 de 72

function cn22_CreateFcn(hObject, eventdata, handles)% hObject handle to cn22 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

function cn22_Callback(hObject, eventdata, handles)% hObject handle to cn22 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of cn22 as text% str2double(get(hObject,'String')) returns contents of cn22 asa double

% --- Executes during object creation, after setting all properties.function dn22_CreateFcn(hObject, eventdata, handles)% hObject handle to dn22 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcnscalled

% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc

set(hObject,'BackgroundColor','white');else

set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end

function dn22_Callback(hObject, eventdata, handles)% hObject handle to dn22 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of dn22 as text% str2double(get(hObject,'String')) returns contents of dn22 asa double

% --- Executes on button press in alumina.function alumina_Callback(hObject, eventdata, handles)% hObject handle to alumina (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB

Page 156: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 58 de 72

% handles structure with handles and user data (see GUIDATA)open grosorlayers.fig

lectura.m

function [col1,col2]=lectura[file,pathname] = uigetfile('*.*');%Pide el fichero a abrirfile_dades=[pathname file];%Guardem l'arxiu a llegir i el camidados=fopen(file_dades,'r');[col1, col2] =

textread(file_dades,'%f%f%*[^\n]','delimiter',',');

end

calcularncauchy.m

function[matriun21,matriun21teorica,matriun22teorica]=calcularncauchy(fd,col1,col2,un21,bn21,cn21,dn21,un22,bn22,cn22,dn22);

m=length(col1);for h=1:1:m/fd

matriun21(h,1)=10000000/col1(h*fd); %lambda nmmatriun21(h,2)=col2(h*fd); %Reflectancia

%matriun21teorica(h,2)=un21+(bn21/(matriun21(h,1)*matriun21(h,1)))+(cn21/(matriun21(h,1)*matriun21(h,1)*matriun21(h,1)*matriun21(h,1)));

%matriun21teorica(h,2)=un21+(bn21/(matriun21(h,1).^2))+(cn21/(matriun21(h,1).^4));

matriun21teorica(h,2)=un21+(bn21/(matriun21(h,1).^2))+(cn21/(matriun21(h,1).^4))+(dn21/(matriun21(h,1).^8));

matriun22teorica(h,2)=un22+(bn22/(matriun21(h,1).^2))+(cn22/(matriun21(h,1).^4))+(dn22/(matriun21(h,1).^8));

matriun21teorica(h,1)=matriun21(h,1);matriun22teorica(h,1)=matriun21(h,1);

Ko=10E-3;Di=2000E-9;matriun21(h,3)=0;matriun21teorica(h,3)=Ko*exp(Di/matriun21(h,1));matriun22teorica(h,3)=0;

end

calcularnsellmeier.mfunction[matriun21,matriun21teorica,matriun22teorica]=calcularncauchy(fd,col1,col2,un21,bn21,cn21,dn21,un22,bn22,cn22,dn22)

m=length(col1);for h=1:1:m/fd

matriun21(h,1)=10000000/col1(h*fd);matriun21(h,2)=col2(h*fd);

matriun21teorica(h,2)=sqrt((1+(un21*matriun21(h,1).^2)/((matriun21(h,1).^2)-bn21)+(cn21*matriun21(h,1).^2)/((matriun21(h,1).^2)-dn21)));

matriun22teorica(h,2)=sqrt((1+(un22*matriun21(h,1).^2)/((matriun21(h,1).^2)-bn22)+(cn22*matriun21(h,1).^2)/((matriun21(h,1).^2)-dn22)));

Page 157: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 59 de 72

matriun21teorica(h,1)=matriun21(h,1);matriun22teorica(h,1)=matriun21(h,1);matriun21(h,3)=0;matriun21teorica(h,3)=0;matriun22teorica(h,3)=0;

end

calculartransmisioreflexio.m

%****************************************************% Càlcul de la transmissió i reflexió a partir de les matrius%*****************************************************function [RE,TE,RM,TM]=calculdetransmissioireflexio(Parametres,lnostra,long,lleguir,matriun21,D1M,var21,slcauchy,matriun21teorica,matriun22teorica,matriun31,matriun22,var22,var32,var31,nestruc,var33,matriun33,rugoso,phi1,DsM,ns,phis,n1,D1E,DsE,var23)inc=1;global slsellmeier;global polnum;global un21global bn21global cn21global dn21global un22global bn22global cn22global dn22global tet2global h21global n21global n1global h21

for cont=1:1:longif (lleguir==1)l=matriun21(cont,1)*1E-9;

elsel=lnostra(cont);

endlambda=l/1e-9;%Càlcul de TMMtotM=inv(D1M);%Inicialització de les matriusif ((var21==1)|(slcauchy==1)|(slsellmeier==1))&(polnum==1)if (slcauchy==1)|(slsellmeier==1)

Parametres(1,1)=Calculan(matriun21(cont,1),matriun21teorica);else

Parametres(1,1)=Calculan(matriun21(cont,1),matriun21teorica);end

endif ((var31==1)|(slcauchy==1)|(slsellmeier==1))&(polnum==2)

if (slcauchy==1)|(slsellmeier==1)

Parametres(1,3)=Calculan(matriun21(cont,1),matriun22teorica);else Parametres(1,3)=Calculan(lambda,matriun31);end

end

if nestruc==2

Page 158: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 60 de 72

if var22==1Parametres(2,1)=Calculan(lambda,matriun22);

endif var32==1

Parametres(2,3)=Calculan(lambda,matriun32);end

elseif nestruc==3if var22==1

Parametres(2,1)=Calculan(lambda,matriun22);endif var32==1

Parametres(2,3)=Calculan(lambda,matriun32);endif var23==1

Parametres(3,1)=Calculan(lambda,matriun23);endif var33==1

Parametres(3,3)=Calculan(lambda,matriun33);end

end

for val=1:1:nestruc%Parametres(val,3)=1;%Parametres(val,4)=1;%Parametres(val,5)=1;

% Parametres(val,1)=nag;if rugoso(val)==1

MM=CalculaMBragMRug(n1,phi1,Parametres(val,1),Parametres(val,2),Parametres(val,3),Parametres(val,4),Parametres(val,5),l,rug2(val),nrug2(val),hrug2(val),rug3(val),nrug3(val),hrug3(val));

else

MM=CalculaMBragM(n1,phi1,Parametres(val,1),Parametres(val,2),Parametres(val,3),Parametres(val,4),Parametres(val,5),l,tet2(cont));

endMtotM=MtotM*MM;

end

MtotM=MtotM*DsM;

M21M=MtotM(2,1);M11M=MtotM(1,1);

rM=M21M/M11M;tM=1/M11M;

ReflectanceM=(abs(rM))^2;TransmittanceM=((ns*cos(phis))/(n1*cos(phi1)))*((abs(tM))^2);RM(cont)=ReflectanceM;TM(cont)=TransmittanceM;

%Càlcul de TEMtotE=inv(D1E);

for val=1:1:nestrucif rugoso(val)==1

ME=CalculaMBragERug(n1,phi1,Parametres(val,1),Parametres(val,2),Parametres(val,3),Parametres(val,4),Parametres(val,5),l,rug2(val),nrug2(val),hrug2(val),rug3(val),nrug3(val),hrug3(val));

Page 159: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 61 de 72

else

ME=CalculaMBragE(n1,phi1,Parametres(val,1),Parametres(val,2),Parametres(val,3),Parametres(val,4),Parametres(val,5),l,tet2(cont));

endMtotE=MtotE*ME;

end

MtotE=MtotE*DsE;

M21E=MtotE(2,1);M11E=MtotE(1,1);

rE=M21E/M11E;tE=1/M11E;

ReflectanceE=(abs(rE))^2;TransmittanceE=((ns*cos(phis))/(n1*cos(phi1)))*((abs(tE))^2);RE(cont)=ReflectanceE;TE(cont)=TransmittanceE;

endend

fminquad.m% inicio del archivo fminquad.m%% codigo para calcular los coeficientes de una funcion% por el metodo de minimos cuadrados% 2.8 del libro de Edgar, Himmelblau & Lasdon (2001)% optimization of chemical processes%function [x,RE,TE,RM,TM]=fminquad(Parametres,lnostra,long,lleguir,matriun21,D1M,var21,slcauchy,matriun21teorica,matriun22teorica,matriun31,matriun22,var22,var32,var31,nestruc,var33,matriun33,rugoso,phi1,DsM,ns,phis,n1,D1E,DsE,RE,TE,RM,TM,var23,polnum);global tet2;global matriun21global Parametresglobal lnostraglobal longglobal lleguirglobal D1Mglobal var21global slcauchyglobal slsellmeierglobal matriun21teoricaglobal matriun22teoricaglobal matriun31global matriun22global var22global var23global var32global var31global nestrucglobal var33global matriun33global rugosoglobal phi1global DsMglobal ns

Page 160: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 62 de 72

global phisglobal n1global D1Eglobal DsEglobal REglobal un21;global bn21;global cn21;global dn21;global un22;global bn22;global cn22;global dn22;global polnum;global h21global n31global phi2global n1global n21

if (polnum==2)x0=[un21 bn21 cn21 dn21 un22 bn22 cn22 dn22 h21];lb = [1 0 0 0 1 0 0 0 0];ub = [700 100000 100000 100000 700 100000 100000 100000 2000];options=optimset('LargeScale','on','Display','iter','MaxFunEvals',1000,'TolFun',1e-20,'TolX',1e-20);%[x,resnorm,residual,exitflag,output,lambda,jacobian]=lsqnonlin(fun,x0,lb,ub,options)[x,funx2,fun,flag,output,lambda,jacobian]=lsqnonlin(@xyquad2,x0,lb,ub,options);c0=x(1);c1=x(2);c2=x(3);c3=x(4);c4=x(5);c5=x(6);c6=x(7);c7=x(8);% reasignacion de parametrosc8=x(9);elsex0=[un21 bn21 cn21 dn21 h21];lb = [1 0 0 0 0];ub = [700 100000 100000 100000 2000];options=optimset('LargeScale','on','Display','iter','MaxFunEvals',1000,'TolFun',1e-18,'TolX',1e-18);%[x,resnorm,residual,exitflag,output,lambda,jacobian]=lsqnonlin(fun,x0,lb,ub,options)[x,funx2,fun,flag,output,lambda,jacobian]=lsqnonlin(@xyquad2,x0,lb,ub,options);c0=x(1);c1=x(2);c2=x(3);c3=x(4);c4=x(5);endif (slcauchy==1)

for h=1:1:length(matriun21)

matriun21teorica(h,2)=c0+(c1/(matriun21(h,1).^2))+(c2/(matriun21(h,1).^4))+(c3/(matriun21(h,1).^8));

if (polnum==2)

Page 161: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 63 de 72

matriun22teorica(h,2)=c4+(c5/(matriun21(h,1).^2))+(c6/(matriun21(h,1).^4))+(c7/(matriun21(h,1).^8));

endend

end

if (slsellmeier==1)for h=1:1:length(matriun21)

matriun21teorica(h,2)=sqrt((1+(c0*matriun21(h,1).^2)/((matriun21(h,1).^2)-c1)+(c2*matriun21(h,1).^2)/((matriun21(h,1).^2)-c3)));

if (polnum==2)

matriun22teorica(h,2)=sqrt((1+(c4*matriun21(h,1).^2)/((matriun21(h,1).^2)-c5)+(c6*matriun21(h,1).^2)/((matriun21(h,1).^2)-c7)));

endend

endif (polnum==2)

for conta=1:1:length(matriun21)phi2=asin((n1/matriun21teorica(conta,2))*(sin(phi1)));p2=n21*cos(phi2);k2x=(2*pi*matriun21teorica(conta,2)*cos(phi2))/(1E-

9*matriun21(conta,1));tet2(conta)=k2x*c8;end

elsefor conta=1:1:length(matriun21)phi2=asin((n1/matriun21teorica(conta,2))*(sin(phi1)));p2=n21*cos(phi2);k2x=(2*pi*matriun21teorica(conta,2)*cos(phi2))/(1E-

9*matriun21(conta,1));tet2(conta)=k2x*c4;end

end

un21=x(1);bn21=x(2);cn21=x(3);dn21=x(4);h21= x(5);if (polnum==2)un22=x(5);bn22=x(6);cn22=x(7);dn22=x(8);h21=x(9);end

[RE,TE,RM,TM]=calculdetransmissioireflexio(Parametres,lnostra,long,lleguir,matriun21,D1M,var21,slcauchy,matriun21teorica,matriun22teorica,matriun31,matriun22,var22,var32,var31,nestruc,var33,matriun33,rugoso,phi1,DsM,ns,phis,n1,D1E,DsE,var23);% fin del archivo fminquad.m

Xyquad2.m% inicio del archivo xyquad.m% codigo para calcular los coeficientes de una funcion% por el metodo de minimos cuadrados% 2.8 del libro de Edgar, Himmelblau & Lasdon (2001)

Page 162: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 64 de 72

% optimization of chemical processes%function[fi2]=xyquad(x,Parametres,lnostra,long,lleguir,matriun21,D1M,var21,slcauchy,matriun21teorica,matriun22teorica,matriun31,matriun22,var22,var32,var31,nestruc,var33,matriun33,rugoso,phi1,DsM,ns,phis,n1,D1E,DsE,var23);global h21global tet2global matriun21global Parametresglobal lnostraglobal longglobal lleguirglobal D1Mglobal var21global slcauchyglobal slsellmeierglobal matriun21teoricaglobal matriun22teoricaglobal matriun31global matriun22global var22global var23global var32global var31global nestruc;global var33;global matriun33;global rugoso;global phi1;global DsM;global ns;global phis;global n1;global D1E;global DsE;32global RE;global un21;global bn21;global cn21;global dn21;global un22;global bn22;global cn22;global dn22;global polnum;global n31;global phi2;global n1global n21

if (polnum==2)c0=x(1); c1=x(2); c2=x(3); c3=x(4);c4=x(5); c5=x(6); c6=x(7); c7=x(8);c8= x(9);elsec0=x(1); c1=x(2); c2=x(3); c3=x(4);c4=x(5);endif (slcauchy==1)

if (polnum==1)for h=1:1:length(matriun21)

Page 163: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 65 de 72

matriun21teorica(h,2)=c0+(c1/(matriun21(h,1).^2))+(c2/(matriun21(h,1).^4))+(c3/(matriun21(h,1).^8));

endelse

for h=1:1:length(matriun21)

matriun21teorica(h,2)=c0+(c1/(matriun21(h,1).^2))+(c2/(matriun21(h,1).^4))+(c3/(matriun21(h,1).^8));

matriun22teorica(h,2)=c4+(c5/(matriun21(h,1).^2))+(c6/(matriun21(h,1).^4))+(c7/(matriun21(h,1).^8));

endend

end

if (slsellmeier==1)for h=1:1:length(matriun21)

matriun21teorica(h,2)=sqrt((1+(c0*matriun21(h,1).^2)/((matriun21(h,1).^2)-c1)+(c2*matriun21(h,1).^2)/((matriun21(h,1).^2)-c3)));

if (polnum==2)

matriun22teorica(h,2)=sqrt((1+(c4*matriun21(h,1).^2)/((matriun21(h,1).^2)-c5)+(c6*matriun21(h,1).^2)/((matriun21(h,1).^2)-c7)));

endend

end

%calcul de tetha en funcio del espesor de la capaif (polnum==2)

for conta=1:1:length(matriun21)phi2=asin((n1/matriun21teorica(conta,2))*(sin(phi1)));p2=n21*cos(phi2);k2x=(2*pi*matriun21teorica(conta,2)*cos(phi2))/(1E-

9*matriun21(conta,1));tet2(conta)=k2x*c8;end

elsefor conta=1:1:length(matriun21)phi2=asin((n1/matriun21teorica(conta,2))*(sin(phi1)));p2=n21*cos(phi2);k2x=(2*pi*matriun21teorica(conta,2)*cos(phi2))/(1E-

9*matriun21(conta,1));tet2(conta)=k2x*c4;end

end

[RE,TE,RM,TM]=calculdetransmissioireflexio(Parametres,lnostra,long,lleguir,matriun21,D1M,var21,slcauchy,matriun21teorica,matriun22teorica,matriun31,matriun22,var22,var32,var31,nestruc,var33,matriun33,rugoso,phi1,DsM,ns,phis,n1,D1E,DsE,var23);

fi2=(RE')-(matriun21(:,2));% fin del archivo xyquad.m

calculaMbragE.m

function MNperE=CalculaMBragE(n1,phi1,n2,h2,n3,h3,N,l,tet2)

Page 164: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 66 de 72

global polnumM2E=CalculaMTE(n1,phi1,n2,h2,l,tet2);

if polnum==2M3E=CalculaMTE(n1,phi1,n3,h3,l,tet2);elseM3E=[1 0;0 1];endM1perE=M2E*M3E;MNperE=(M1perE)^N;

calculaMbragM.m

function MNperM=CalculaMBragM(n1,phi1,n2,h2,n3,h3,N,l,tet2)global polnum

M2M=CalculaMTM(n1,phi1,n2,h2,l,tet2);if polnum==2M3M=CalculaMTM(n1,phi1,n3,h3,l,tet2);elseM3M=[1 0;0 1];end

M1perM=M2M*M3M;MNperM=(M1perM)^N;

CalculaMTE.m

function M=CalculaMTE(n1,phi1,n2,h2,l,tet2)global polnum

phi2=asin((n1/n2)*(sin(phi1)));p2=n2*cos(phi2);if polnum==2k2x=(2*pi*n2*cos(phi2))/l;tet2=k2x*h2;endD2=[1 1;p2 -p2];

P211=exp(i*tet2);P222=exp(-i*tet2);P2mat=[P211 0;0 P222];

M=D2*P2mat*(inv(D2));

CalculaMTM.m

function M=CalculaMTM(n1,phi1,n2,h2,l,tet2)global polnumphi2=asin((n1/n2)*(sin(phi1)));p2=n2*cos(phi2);%k2x=(2*pi*n2*cos(phi2))/l;%tet2=k2x*h2;if polnum==2k2x=(2*pi*n2*cos(phi2))/l;tet2=k2x*h2;endD2=[cos(phi2) cos(phi2);n2 -n2];

P211=exp(i*tet2);P222=exp(-i*tet2);P2mat=[P211 0;0 P222];

Page 165: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 67 de 72

M=D2*P2mat*(inv(D2));

Calculan.m

function n3=Calculan(lambda,matriun3)

%Lambda en nm%Se le pasa la tabla donde la primera columna es lambda y la segunda y%tercera son la n y la k respectivamente y te devuelve la n=n-iK%correspondiente a la lambda que le pides (util para las tablas dePAlik)

long2=length(matriun3);var=1;

while ((matriun3(var,1)<lambda)&(var<long2))var=var+1;

endif (matriun3(var,1))==lambda

n3=matriun3(var,2)-i*matriun3(var,3);elseif (((var==long2)&(matriun3(var,1)<lambda)))|(var==1)

n3=matriun3(var,2)-i*matriun3(var,3);else

a=matriun3(var-1,1);b=matriun3(var,1);c=matriun3(var-1,2);d=matriun3(var,2);n=c+(((d-c)*(lambda-a))/(b-a));

c=matriun3(var-1,3);d=matriun3(var,3);k=c+(((d-c)*(lambda-a))/(b-a));n3=n-i*k;

end

escriuredades.mfunction

escriuredades(lleguir,lnostra,cabecera,valor,matriun21,matriun21teorica,RE,n23,h23,n33,h33,N3,var21,var31,nestruc,h21,h31,N1,n31,TE,TM,RM)

%if escriure==1[OutputFile path]=uiputfile('*.dat','Save as',' .dat');if OutputFile==0

return; % if no chosen fileelse,

InFilePath=[path, OutputFile];end,

InPath=path;if length(path)>3,

InPath(end)=32; %erase the backslash at the endInPath=setstr(InPath);

end,cd (InPath);[fid, message]=fopen(InFilePath,'w');if fid<0

ErrorH=errordlg( ['Can not write to file:',upper(InFilePath)], 'ERROR!', 'modal');

uiwait(ErrorH);return;

Page 166: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 68 de 72

else,

if cabecera==1% if strcmp(modeSaving,'with'),

fprintf(fid,'\r\nSimulation of the multilayerstructure\n');

fprintf(fid,'\r\n\r\nParameters: ');switch (nestruc)

case 1if (var21==1) & (var31==1)

fprintf(fid,'\r\n Bilayer structure 1: n1st layer= %s h 1st layer= %g nm n 2nd layer= %s h 2nd layer= %g nmperiods: %g ', handles.n21string,h21,handles.n31string,h31,N1 );

elseif var21==1fprintf(fid,'\r\n Bilayer structure 1: n

1st layer= %s h 1st layer= %g nm n 2nd layer= %g h 2nd layer= %g nmperiods: %g ', handles.n21string,h21,n31,h31,N1 );

elseif var31==1fprintf(fid,'\r\n Bilayer structure 1: n

1st layer= %g h 1st layer= %g nm n 2nd layer= %s h 2nd layer= %g nmperiods: %g ', n21,h21,handles.n31string,h31,N1 );

elsefprintf(fid,'\r\n Bilayer structure 1: n

1st layer= %g h 1st layer= %g nm n 2nd layer= %g h 2nd layer= %g nmperiods: %g ', n21,h21,n31,h31,N1 );

endcase 2

if (var21==1) & (var31==1)fprintf(fid,'\r\n Bilayer structure 1: n

1st layer= %s h 1st layer= %g nm n 2nd layer= %s h 2nd layer= %g nmperiods: %g ', handles.n21string,h21,handles.n31string,h31,N1 );

elseif var21==1fprintf(fid,'\r\n Bilayer structure 1: n

1st layer= %s h 1st layer= %g nm n 2nd layer= %g h 2nd layer= %g nmperiods: %g ', handles.n21string,h21,n31,h31,N1 );

elseif var31==1fprintf(fid,'\r\n Bilayer structure 1: n

1st layer= %g h 1st layer= %g nm n 2nd layer= %s h 2nd layer= %g nmperiods: %g ', n21,h21,handles.n31string,h31,N1 );

elsefprintf(fid,'\r\n Bilayer structure 1: n

1st layer= %g h 1st layer= %g nm n 2nd layer= %g h 2nd layer= %g nmperiods: %g ', n21,h21,n31,h31,N1 );

endif (var22==1) & (var32==1)

fprintf(fid,'\r\n Bilayer structure 2: n1st layer= %s h 1st layer= %g nm n 2nd layer= %s h 2nd layer= %g nmperiods: %g ', handles.n22string,h22,handles.n32string,h32,N2 );

elseif var22==1fprintf(fid,'\r\n Bilayer structure 2: n

1st layer= %s h 1st layer= %g nm n 2nd layer= %g h 2nd layer= %g nmperiods: %g ', handles.n22string,h22,n32,h32,N2 );

elseif var32==1fprintf(fid,'\r\n Bilayer structure 2: n

1st layer= %g h 1st layer= %g nm n 2nd layer= %s h 2nd layer= %g nmperiods: %g ', n22,h22,handles.n32string,h32,N2 );

elsefprintf(fid,'\r\n Bilayer structure 2: n

1st layer= %g h 1st layer= %g nm n 2nd layer= %g h 2nd layer= %g nmperiods: %g ', n22,h22,n32,h32,N2 );

end

Page 167: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 69 de 72

case 3if (var21==1) & (var31==1)

fprintf(fid,'\r\n Bilayer structure 1: n1st layer= %s h 1st layer= %g nm n 2nd layer= %s h 2nd layer= %g nmperiods: %g ', handles.n21string,h21,handles.n31string,h31,N1 );

elseif var21==1fprintf(fid,'\r\n Bilayer structure 1: n

1st layer= %s h 1st layer= %g nm n 2nd layer= %g h 2nd layer= %g nmperiods: %g ', handles.n21string,h21,n31,h31,N1 );

elseif var31==1fprintf(fid,'\r\n Bilayer structure 1: n

1st layer= %g h 1st layer= %g nm n 2nd layer= %s h 2nd layer= %g nmperiods: %g ', n21,h21,handles.n31string,h31,N1 );

elsefprintf(fid,'\r\n Bilayer structure 1: n

1st layer= %g h 1st layer= %g nm n 2nd layer= %g h 2nd layer= %g nmperiods: %g ', n21,h21,n31,h31,N1 );

endif (var22==1) & (var32==1)

fprintf(fid,'\r\n Bilayer structure 2: n1st layer= %s h 1st layer= %g nm n 2nd layer= %s h 2nd layer= %g nmperiods: %g ', handles.n22string,h22,handles.n32string,h32,N2 );

elseif var22==1fprintf(fid,'\r\n Bilayer structure 2: n

1st layer= %s h 1st layer= %g nm n 2nd layer= %g h 2nd layer= %g nmperiods: %g ', handles.n22string,h22,n32,h32,N2 );

elseif var32==1fprintf(fid,'\r\n Bilayer structure 2: n

1st layer= %g h 1st layer= %g nm n 2nd layer= %s h 2nd layer= %g nmperiods: %g ', n22,h22,handles.n32string,h32,N2 );

elsefprintf(fid,'\r\n Bilayer structure 2: n

1st layer= %g h 1st layer= %g nm n 2nd layer= %g h 2nd layer= %g nmperiods: %g ', n22,h22,n32,h32,N2 );

endif (var23==1) & (var33==1)

fprintf(fid,'\r\n Bilayer structure 3: n1st layer= %s h 1st layer= %g nm n 2nd layer= %s h 2nd layer= %g nmperiods: %g ', handles.n23string,h23,handles.n33string,h33,N3 );

elseif var23==1fprintf(fid,'\r\n Bilayer structure 3: n

1st layer= %s h 1st layer= %g nm n 2nd layer= %g h 2nd layer= %g nmperiods: %g ', handles.n23string,h23,n33,h33,N3 );

elseif var33==1fprintf(fid,'\r\n Bilayer structure 3: n

1st layer= %g h 1st layer= %g nm n 2nd layer= %s h 2nd layer= %g nmperiods: %g ', n23,h23,handles.n33string,h33,N3 );

elsefprintf(fid,'\r\n Bilayer structure 3: n

1st layer= %g h 1st layer= %g nm n 2nd layer= %g h 2nd layer= %g nmperiods: %g ', n23,h23,n33,h33,N3 );

endend

switch valorcase 1

fprintf(fid,'\r\n\r\n Wavelength (nm)Reflectivity (TE) Reflectivity (TM) ');

fprintf(fid,'\r\n------------------------------------------------------------------------------------------------------------\r\n\r\n');

Page 168: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 70 de 72

if (lleguir==1)wavelen=matriun21(:,1);elsewavelen=lnostra/1e-9;end

for contpos=1:1:length(wavelen)fprintf(fid,' %12.3f %5.4f

%5.4f',wavelen(contpos),RE(contpos),RM(contpos));fprintf(fid,'\r\n');

endcase 2

fprintf(fid,'\r\n\r\n Wavelength (nm)Transmission (TE) Transmission (TM) ');

fprintf(fid,'\r\n------------------------------------------------------------------------------------------------------------\r\n\r\n');

if (lleguir==1)wavelen=matriun21(:,1);elsewavelen=lnostra/1e-9;end

for contpos=1:1:length(wavelen)fprintf(fid,' %12.3f %5.4f

%5.4f',wavelen(contpos),TE(contpos),TM(contpos));fprintf(fid,'\r\n');

endcase 3

fprintf(fid,'\r\n\r\n Wavelength (nm)Reflectivity (TE) Reflectivity (TM) Transmission (TE) Transmission(TM)');

fprintf(fid,'\r\n------------------------------------------------------------------------------------------------------------\r\n\r\n');

if (lleguir==1)wavelen=matriun21(:,1);elsewavelen=lnostra/1e-9;end

for contpos=1:1:length(wavelen)fprintf(fid,' %12.3f %5.4f

%5.4f %5.4f%5.4f',wavelen(contpos),RE(contpos),RM(contpos),TE(contpos),TM(contpos));

fprintf(fid,'\r\n');end

case 4fprintf(fid,'\r\n\r\n Wavelength (nm)

Absorption (TE) Absorption (TM) ');fprintf(fid,'\r\n------------------------------

------------------------------------------------------------------------------\r\n\r\n');

if (lleguir==1)wavelen=matriun21(:,1);elsewavelen=lnostra/1e-9;end

for contpos=1:1:length(wavelen)fprintf(fid,' %12.3f %5.4f

%5.4f',wavelen(contpos),AE(contpos),AM(contpos));fprintf(fid,'\r\n');

end

Page 169: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 71 de 72

case 5fprintf(fid,'\r\n\r\n Wavelength (nm)

Reflectivity (TE) Reflectivity (TM) Absorption (TE) Absorption(TM)');

fprintf(fid,'\r\n------------------------------------------------------------------------------------------------------------\r\n\r\n');

if (lleguir==1)wavelen=matriun21(:,1);elsewavelen=lnostra/1e-9;end

for contpos=1:1:length(wavelen)fprintf(fid,' %12.3f %5.4f

%5.4f %5.4f%5.4f',wavelen(contpos),RE(contpos),RM(contpos),AE(contpos),AM(contpos));

fprintf(fid,'\r\n');end

case 6fprintf(fid,'\r\n\r\n Wavelength (nm)

Transmission (TE) Transmission (TM) Absorption (TE) Absorption (TM)');

fprintf(fid,'\r\n------------------------------------------------------------------------------------------------------------\r\n\r\n');

if (lleguir==1)wavelen=matriun21(:,1);elsewavelen=lnostra/1e-9;end

for contpos=1:1:length(wavelen)fprintf(fid,' %12.3f %5.4f

%5.4f %5.4f%5.4f',wavelen(contpos),TE(contpos),TM(contpos),AE(contpos),AM(contpos));

fprintf(fid,'\r\n');end

case 7fprintf(fid,'\r\n\r\n Wavelength (nm)

Reflectivity (TE) Reflectivity (TM) Transmission (TE) Transmission(TM) Absorption (TE) Absorption (TM)');

fprintf(fid,'\r\n------------------------------------------------------------------------------------------------------------------------------\r\n\r\n');

if (lleguir==1)wavelen=matriun21(:,1);elsewavelen=lnostra/1e-9;end

for contpos=1:1:length(wavelen)fprintf(fid,' %12.3f %5.4f

%5.4f %5.4f %5.4f %5.4f%5.4f',wavelen(contpos),RE(contpos),RM(contpos),TE(contpos),TM(contpos),AE(contpos),AM(contpos));

fprintf(fid,'\r\n');end

endfclose(fid);

else %Slo para (Rte+Rtm)*0.5if (lleguir==1)

Page 170: TITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...sauron.etse.urv.es/public/PROPOSTES/pub/pdf/739pub.pdfTITULO DEL PROYECTO: OPTIMIZACIÓN Y EXTRACCIÓN DE ...

Anexo PFC

Pagina: 72 de 72

wavelen=matriun21(:,1);else

wavelen=lnostra/1e-9;endfor contpos=1:1:length(wavelen)

fprintf(fid,'%12.6f\t%5.6f',wavelen(contpos),(0.5*RE(contpos)+0.5*RM(contpos)));

fprintf(fid,'\r\n');endfclose(fid);

end

endend