Guia Practicas MATLAB

GUÍA DE PRÁCTICAS DE MATLAB CÁLCULO VECTORIAL 0. PROCESO DE INSTALACION MATLAB R2010a Ing. Teddy Negrete Página 1 In

Views 203 Downloads 2 File size 38MB

Report DMCA / Copyright

DOWNLOAD FILE

Recommend stories

Citation preview

GUÍA DE PRÁCTICAS DE MATLAB CÁLCULO VECTORIAL 0. PROCESO DE INSTALACION MATLAB R2010a

Ing. Teddy Negrete

Página 1

Ing. Teddy Negrete

Página 2

Ing. Teddy Negrete

Página 3

Ing. Teddy Negrete

Página 4

Ing. Teddy Negrete

Página 5

1. FILE INSTALLATION KEY – LICENSE

we offer you two ways to license matlab r2010a:

standalone 1) choose "install manually without using the internet" 2) enter the "file installation key" 55013-56979-18948-50009-49060 3) use "license_standalone.dat" when asked for license file network 1) choose "install manually without using the internet" 2) enter the "file installation key" 42149-27753-04517-22198-03397 3) if neccessary install "license manager" 4) use "license_server.dat" when asked for license file enjoy !

Ing. Teddy Negrete

Página 6

Ing. Teddy Negrete

Página 7

Ing. Teddy Negrete

Página 8

Ing. Teddy Negrete

Página 9

Ing. Teddy Negrete

Página 10

Ing. Teddy Negrete

Página 11

Ing. Teddy Negrete

Página 12

Ing. Teddy Negrete

Página 13

Ing. Teddy Negrete

Página 14

Ing. Teddy Negrete

Página 15

Ing. Teddy Negrete

Página 16

2. AYUDA EN MATLAB: >>doc

Ing. Teddy Negrete

Página 17

>>help >> helpwin Retorna: M-File Help: Default Topics DEMOS:

C:\Program Files\MATLAB\R2010a\toolbox\matlab\demos\html\GettingStartedwithMATLAB.html

Ing. Teddy Negrete

Página 18

3. UNIDAD # 0: INTRODUCCIÓN AL ENTORNO MATLAB EL SOFTWARE:

MATLAB es una de las aplicaciones más útiles que existen para poner a punto métodos numéricos en distintas asignaturas de ingeniería. Por ser una herramienta de alto nivel, el desarrollo de programas numéricos con MATLAB puede requerir hasta un orden de magnitud menos de esfuerzo que con lenguajes de programación convencionales, como Fortran, Pascal, C/C++, Java o Visual Basic. El escritorio de MATLAB, tiene 4 ventanas: 1. COMMAND WINDOW (La ventana de comandos) 2. WORKSPACE (El espacio de trabajo) 3. CURRENT FOLDER (El directorio actual) 4. COMMAND HISTORY (La historia de comandos)

Ing. Teddy Negrete

Página 19

Actualización de su directorio personal: Por ejemplo: “E:\MATLAB_2013”

Ejecute los siguientes comandos en el PROMPT de la ventana de comandos: dir help dir ls clc clear clear all close

Ing. Teddy Negrete

close all date clock help clock 3-2 15/6 3-1,4*5

sqrt(2) 5^3 3; pi/4 8*9 flecha direccional ↑ exit

Página 20

ARCHIVO M-File

Haga clic en el botón “Página en Blanco” llamada “New M-File” del TOOLBAR, y se mostrará el “Editor de MATLAB, tal como se muestra en la figura adyacente.

En este editor escriba aquí las siguientes líneas:

Ing. Teddy Negrete

Página 21

%PRÁCTICA DE VARIOS COMANDOS GENERALES %inicio de bloque help dir 3+5 3*5 clear all date clock help clock %fin de bloque

Este archivo se puede ejecutar de las siguientes formas: Haga clic en el botón de “Save and run”, en el TOOLBAR, antes de la ejecución, el programa le pedirá guardar el archivo, debe ponerle el nombre comandos_generales.m. lo guarda e inmediatamente se ejecuta, debe verificar la ejecución regresando al escritorio de MATLAB, en la ventana de comandos, si tiene errores el programa emitirá un sonido. Otra forma es: Seleccione todas las líneas de edición y luego pulse la tecla funcional [F9], en este caso se ejecuta y no se guarda. Para guardarlo debe dar un clic en el botón “Diskette”, que es “Save”, escriba el nombre antes indicado.

Ing. Teddy Negrete

Página 22

NOTA: Como una norma de programación vamos a documentar los ejercicios indicando que hacen o cuál es el objetivo de la práctica, además en la primera línea de cada programa se debe escribir su nombre, la fecha y el número del ejercicio. Recuerde los comentarios en MATLAB empiezan con el símbolo %.

EJERCICIOS DE COMANDOS GENERALES: 1. Aumente los siguientes comandos al archivo anterior, a partir de la línea 11, y comente el bloque de instrucciones después de la ejecución del mismo, cada comentario debe empezar con el signo %. (Se sugiere ejecutar cada uno de los bloques de instrucciones, analizar cuáles son los resultados y luego realizar el comentario por bloque).

Ing. Teddy Negrete

Página 23

NOTA: La numeración se asocia al número de archivos M-File que se van desarrollando en esta parte de la guía, con el fin de llevar un control del número de archivos que se deben registrar y guardar.

%inicio de bloque rand rand(1) rand(2) rand(3) %fin de bloque

%inicio de bloque realmin realmax intmin intmax roots([1 2 1]) roots([1 -2 1]) %fin de bloque

%inicio de bloque dir *.mat type matlab.mat %¿Por qué se presenta error? %fin de bloque

%inicio de bloque save dir type matlab.mat %fin de bloque

Ing. Teddy Negrete

Página 24

%inicio de bloque mkdir SU_NOMBRE cd SU_NOMBRE save archivo_texto.txt save archivo_excel.xls dir pwd cd .. pwd %fin de bloque

(Recuerde que tiene una ayuda usando el comando “help + COMANDO”, donde COMANDO es la función de MATLAB que usted quiere conocer).

2. Elabore otro archivo, verifique que se guarde en su carpeta personal, con el nombre constantes.m, usando el Editor de archivos M-File y ejecute las siguientes líneas de programación, comente cada línea explicando el significado del resultado:

%inicio de bloque %Números reales 1/2 + 3/4 2+3*4-6/5^2+1 2e3 2*10^3 4e-1 4*10^-1 sqrt(3)/pi exp(1) %fin de bloque

Ing. Teddy Negrete

Página 25

%inicio de bloque %Números complejos 2i*(5-4i) (2-i)/(6i-4) sqrt(1-i) (1-5i)^2 (1+5i)^3 3*exp(i) 2*exp(i*pi) 4*exp(i*pi/4) %fin de bloque

%inicio de bloque %Formas simbólicas 1/0 -5/0 inf Inf inf+inf 0/inf inf/0 %fin de bloque

%inicio de bloque %Formas indeterminadas nan NaN inf*0 0*inf 0/0 0^0 inf^0 inf/inf inf-inf 1^inf %fin de bloque

Ing. Teddy Negrete

Página 26

%inicio de bloque %Forma infinitesimal eps sin(0)/0 sin(eps)/eps %fin de bloque

Recordemos la expresión de cálculo diferencial

f ( x) − L < ε , ε > 0 ¿En qué casos usaríamos este valor real, que más parece variable? En matemáticas, si escribimos → 0, x se acerca a cero pero no es cero. En programación, si escribimos 0, x toma el valor de cero.

Entonces en programación podríamos escribir , que significaría que x tiende a cero pero no es cero, es decir estaríamos utilizando una variable infinitesimal (que aqui es una constante) para resolver un problema de asignación en programación.

%IMPORTANTE: i es un número, que representa al igual que eps, pi, e, exp, un valor, por lo tanto no pueden ser usados como nombres de variables. Además los nombres de formas simbólicas o indeterminadas como inf, Inf, nan, NaN tampoco pueden ser usados como variables. %Formato de los números %inicio de bloque format short 5/7 Format long 5/7 format short 1/2 + 3/4 format rat 1/2 + 3/4 %fin de bloque

Ing. Teddy Negrete

Página 27

%inicio de bloque format short 10.239 + 23.89675 format bank 10.239 + 23.89675 format short %dejemos este estándar de formato numérico %fin de bloque

NOTA IMPORTANTE: REPASE conceptos de aritmética tales como: números decimales, números racionales, números irracionales, cifras significativas, notación científica y notación punto flotante.

Ejercicios usando: clear, close, who, whos. 3. Elabore un archivo, verifique que se guarde en su carpeta personal, con el nombre que_variable_limpiar_cerrar.m, usando el Editor de archivos M-File, ejecute los siguientes comandos, interprete resultados:

%PRUEBAS CON CLOSE - CLOSE ALL %inicio de bloque clear all who whos %fin de bloque

%inicio de bloque a=2+3 b=2*3 c=2/3 d=3\2 e= 2' date who whos %fin de bloque

Ing. Teddy Negrete

Página 28

%inicio de bloque clear b ans who whos %fin de bloque %inicio de bloque sqrt(8) 8^(1/2) who whos %fin de bloque %inicio de bloque clear all nthroot(27,3) who whos %fin de bloque

%PRUEBAS CON VENTANAS TÍTULOS, GRILLAS Y CERRAR %inicio de bloque clc figure figure close figure(3) close figure %fin de bloque %inicio de bloque close figure %¿Por qué se presenta error? close figure(1) %¿Por qué se presenta error? %fin de bloque

Ing. Teddy Negrete

Página 29

%inicio de bloque close(1) figure close all close all clc f1=figure(1) f2=figure(2) close(f1) %fin de bloque

%inicio de bloque close all clear all who figure(10) title('UPS - GUAYAQUIL') grid %fin de bloque

Los nombres de las variables no pueden ser comandos, funciones o nombres de valores definidos en MATLAB. No se puede usar espacios en blanco. Los nombres de variables se diferencian entre MAYÚSCULAS y minúsculas. El nombre “ans” no debe usarse como variable, ya que este nombre se asigna a la respuesta de una operación ejecutada. Los nombres de las variables deben empezar con caracteres, es decir letras.

Cómo se realizan en otros programas o lenguajes de programación, se suelen declarar las variables y el tipo de variables que se utilizarán, sin embargo en MATLAB, NO se requiere declarar las variables numéricas ni las alfanuméricas, solo se requiere diferenciar las numéricas entre sí, esto es escalar, vector o matriz.

4. Elabore otro archivo, verifique que se guarde en su carpeta personal, con el nombre variables.m. Usando el Editor de archivos M-File, ejecute y comente cada bloque de instrucciones:

Ing. Teddy Negrete

Página 30

ECALARES, VECTORES Y MATRICES %Variables, nombres, tipo %Tipos: %Numéricas o escalares %Vectores numéricos %Matrices numéricas %inicio de bloque a=4*5 A=2*3 aA=a+A aB=a-A v1=[1 2 3 4] v2=[5 6 7 8] v3=v1+v2 v4=v1-v2 Ma=[1 2;3 4] MA=[5 6;7 8] MaA=Ma+MA MaB=Ma-MA %fin de bloque

NOTA IMPORTANTE: En el editor de MATLAB, los caracteres o las cadenas de caracteres deben estar encerrados entre los ‘apóstrofes’ (tecla [? ‘]). La cadena toma, de un color ROJO (al abrirla) a un color VIOLETA (al cerrarla). Esta indicación le servirá para aplicar el ‘apóstrofe’ correcto usado por MATLAB.

CADENAS DE CARACTERES O STRINGS %Caracteres %Cadena de caracteres, equivalente a vector de caracteres %Matrices de cadenas %inicio de bloque clear all a=34 a=a a='a' b='b' Ing. Teddy Negrete

Página 31

a+b %¿Qué significa este resultado? double(a) double(b) double(a+b) % %Este es el mismo resultado anterior, pero no se unen los caracteres %fin de bloque

%inicio de bloque c='u' d='p' e='s' strcat(c,d,e) c+d+e %fin de bloque

%inicio de bloque f='matlab ups' g=' oso' h=' ups' strcat(f,g,h) f+g %¿Por qué se produce un error? %fin de bloque

%inicio de bloque f+h %¿Por qué se produce un error? %fin de bloque

%inicio de bloque g+h %¿Por qué NO sale error, ahora? strcat(f,g) strcat(f,h) %fin de bloque

Ing. Teddy Negrete

Página 32

%inicio de bloque Ma=['ab' 'cd';'ef' 'gh'] Mb=['teddy ' 'jhennse ';'negrete ' 'peña ' ] %¿Por qué se produce un error? %fin de bloque %inicio de bloque Mc=['teddy ' 'jhenn ';'negre ' 'peña_ ' ] %¿Por qué no sale error, ahora? %fin de bloque

NOTA IMPORTANTE: El estudio de caracteres – cadenas será más profundo en capítulos posteriores, por ahora solo es una introducción al concepto de variables. Así mismo también se analizará en detalle los conceptos de vectores y matrices en otro capítulo.

GENERALIDADES: COMANDOS VARIOS UTILIZADOS EN MATLAB 5. Elabore un archivo, verifique que se guarde en su carpeta personal, con el nombre EJEMPLO_#_01.m, usando el Editor de archivos M-File, ejecute los siguientes comandos, interprete resultados:

% EJEMPLO # 01 %inicio de bloque %comandos varios dir clock date rand magic(4) pascal(5) %fin de bloque %F9 - para ejecutar %inicio de bloque x=linspace(0,20)%este el dominio de x plot(x,x.^2) %este es el grafico de la función cuadrática grid %fin de bloque

Ing. Teddy Negrete

Página 33

OPERACIONES ARITMÉTICAS:

Con la tabla y los ejemplos dados a continuación vamos a comprender las operaciones de los vectores y matrices en MATLAB. Se definirán 2 operaciones nuevas que no se conocían en algebra común, la DIVISIÓN VECTORIAL. Esta operación será analizada posteriormente como funciona matemáticamente, pero por ahora, con los ejemplo analizaremos la dimensión de los resultados y la compatibilidad de los operandos.

ESCALAR

MATRIZ

VECTOR

DESCRIPCIÓN

+ * ^ / \ ‘

+ * ^ / \ ‘

+ .* .^ ./ .\ .’

Adición Sustracción Multiplicación Potencia División hacia la derecha División hacia la izquierda Transposición

%OPERADOR .* %inicio de bloque a=5,a^2 b=rand(2) b^2 c=1:5 c^2 % ??? Error using ==> mpower % Inputs must be a scalar and a square matrix. c=1:5 c.^2 d=[1 2;3 4],d.^2 d^2 %fin de bloque %inicio de bloque %Resolución de un sistema de ecuaciones 2x2 A=[1 2;-1 4] B=[2;3] linsolve(A,B) %fin de bloque

Ing. Teddy Negrete

Página 34

%inicio de bloque format rat ans format short 5/6 x=A^(-1)*B x=A^(-1)*B x=A\B %fin de bloque %inicio de bloque %La inversa de una matriz c=[1 2;3 4],c.^(-1) format rat ans %fin de bloque %inicio de bloque %division por la derecha y por la izquierda rand(2,3)*rand(3,4) rand(2,2)/rand(2,2) rand(2,2)\rand(2,2) rand(2,3)\rand(3,1) %??? Error using ==> mldivide %Matrix dimensions must agree. %fin de bloque

%inicio de bloque %division por la derecha y por la izquierda rand(2,3)\rand(2,1) rand(2,3)/rand(2,3) rand(2,4)/rand(4,4) rand(3,4)\rand(3,6) %fin de bloque

VARIABLES LOGICAS (BOOLEANAS) 6. Elabore otro archivo, verifique que se guarde en su carpeta personal, con el nombre logicas.m, comente cada línea explicando el significado de la ejecución y concluya en forma general por cada bloque:

Ing. Teddy Negrete

Página 35

Es importante que usted revise y memorice las reglas de las operaciones lógicas básicas: Negación, Conjunción, Disyunción. Así como también propiedades y leyes, por ejemplo Ley de "D'Morgan", la propiedad de la Identidad, etc.

%inicio de bloque clc %El ASCII de ~ es 126, es decir debe pulsar las teclas [ALT]+[126] ~1 ~0 0&0 1|0 %fin de bloque

%inicio de bloque clc La=51 Lc=3==(1+2) %Explique la diferencia entre el operador = y el == %Revise lo que es un operador relacional, aritmético y lógico Ld=not(Lc) Le=and(La,Lb) Lf=or(La,Lb) %fin de bloque

%inicio de bloque clc Lg=false if(Lg) ver='verdadero' else ver='falso' end %fin de bloque

Ing. Teddy Negrete

Página 36

%inicio de bloque Lh=true if(Lh) anotar='verdadero' else anotar='falso' end %fin de bloque %inicio de bloque clc n=input('ingrese un número positivo: ') if(n>det([-1 2 0 1;0 -1 0 1;-3 2 0 0;1 1 2 1]) >>det([1 -2 3 4 5;0 -1 0 2 0;0 0 1 1 0;-1 0 0 0 2;3 0 -2 0 0]) >>A=[1 0 1 2 -1;2 1 2 0 0;3 -1 1 1 1;4 0 0 0 -1;5 0 0 1 0], det(A)

10. UNIDAD # 3: VECTORES R2: PARTE1 %inicio de bloque %GRAFICOS DE VECTORES EN EL PLANO %USANDO LA FUNCIÓN feather % close feather([1 2 3],[1 1 1]) grid %v1=i+j, con el origen en el punto (1,0) %v2=2i+j, con el origen en el punto (2,0) %v3=3i+j, con el origen en el punto (3,0) %fin de bloque

%inicio de bloque close feather([2 4 1],[2 1 5]) grid %v1=2i+2j, con el origen en el punto (1,0) %v2=4i+1j, con el origen en el punto (2,0) %v3=1i+5j, con el origen en el punto (3,0) %fin de bloque

Ing. Teddy Negrete

Página 56

%inicio de bloque close feather(2,2) hold on feather(4,1) feather(1,5) hold off grid %v1=2i+2j, con el origen en el punto (1,0) %v2=4i+1j, con el origen en el punto (1,0) %v3=1i+5j, con el origen en el punto (1,0) %fin de bloque

%inicio de bloque %esta es la mejor forma de graficar close compass([2 4 1],[2 1 5]) %v1=2i+2j, con el origen en el punto (0,0) %v2=4i+1j, con el origen en el punto (0,0) %v3=1i+5j, con el origen en el punto (0,0) %fin de bloque

%inicio de bloque %esta forma no es apropiada close compass(2,2) hold on compass(4,1) compass(1,5) hold off %v1=2i+2j, con el origen en el punto (0,0) %v2=4i+1j, con el origen en el punto (0,0) %v3=1i+5j, con el origen en el punto (0,0) %fin de bloque

En conclusión, ambos “feather y compass” son funciones para graficar números complejos representados en la forma rectangular, sin embargo, “feather” usa el plano rectangualar y “compass” usa el plano polar.

Ing. Teddy Negrete

Página 57

11.

UNIDAD # 3: VECTORES R2 Y EN R3: PARTE2

%PRODUCTO PUNTO %inicio de bloque dot([2 -1 3],[0 2 1]) %fin de bloque

%PRODUCTO CRUZ %inicio de bloque cross([2 -1 3],[0 2 1]) %fin de bloque

12.

UNIDAD # 4: ESPACIOS VECTORIALES

Ejecute en la "Línea de Comandos" las siguientes instrucciones: >>eig([0 2;3 5]) >>A=fix(10*rand(2)),eig(A) Recordemos la ecuación polinómica característica p( λ ) = det( A − λI ) = 0, en donde los valores λ se conocen como EIGENVALORES.

%inicio de bloque syms x p=det([0 2;3 5]-x*[1 0;0 1]) solve(p) %fin de bloque

Ing. Teddy Negrete

Página 58

Ing. Teddy Negrete

Página 59

TEMA #4 (4 Puntos)

Dada la matriz

− 3 − 5 4    A=  2 − 3 − 5  6 − 1 2  Obtenga: a) b) c) d)

El determinante de A. La matriz de los cofactores o matriz adjunta. Obtenga la inversa de A (A-1). Realice la comprobación (A)(A-1)= I.

TEMA #5 (4 Puntos)

Dados los vectores:

V1(-11,20) V2(13,-17) V3(5,8) Obtenga: a) Los escalares h y k tales que hV1+kV2=V3 b) Los escalares h y k tales que V2=hV3-kV1

Ing. Teddy Negrete

Página 60

%EXAMEN PARCIAL 09_02 ÁLGEBRA LINEAL %inicio de bloque %Tema_2 det([10 -4 2;2 5 -2;3 -12 9]) %fin de bloque %inicio de bloque %Tema_3 ([5 -2;11 7]-[3 17;4 -8])^2 [5 -2;11 7]^2 [3 17;4 -8]^3 %fin de bloque %inicio de bloque %Tema_4 det([-3 -5 4;2 -3 -5;1 -1 2]) %fin de bloque

Ing. Teddy Negrete

Página 61

13.

CONTENIDO DE LA ASIGNATURA

CÁLCULO DIFERENCIAL ASIGNATURA: CÁLCULO DIFERENCIAL DESCRIPTOR Geometría Analítica, Números Reales, Funciones y Límites, La Derivada, Aplicaciones de la Derivada.

Denominación de la Asignatura: CÁLCULO DIFERENCIAL Código Actual: 5756

a. Descripción de la asignatura Geometría Analítica, Números Reales, Funciones y Límites, La Derivada, Aplicaciones de la Derivada.

b. Objetivos Generales: 1. Introducir al alumno en el cálculo infinitesimal. Específicos: 1. Modelar matemáticamente la geometría plana para introducirlos en el cálculo infinitesimal. 2. Analizar las funciones, sus características y comportamiento como conceptos previos para la comprensión del cálculo diferencial. 3. Modelar matemáticamente los fenómenos físicos, eléctricos, magnéticos, mecánicos y otros mediante la aplicación del cálculo diferencial. c. Contenidos 1. GEOMETRÍA ANALITICA. 1.1. Sistema Coordenado en el plano, distancia entre dos puntos, razón, pendiente y ángulo entre dos rectas. 1.2. Ecuación de la recta: Punto pendiente, dos puntos, forma general, paralelismo y perpendicularidad. 1.3. Traslación de ejes. 1.4. Ecuación de la circunferencia: Forma ordinaria y forma general. 1.5. Ecuación de la parábola: forma ordinaria y forma general. 1.6. Ecuación de la elipse: Forma ordinaria y forma general.

Ing. Teddy Negrete

Página 62

1.7. Ecuación de la hipérbola: Forma ordinaria, asíntotas y forma general.

2. NUMEROS REALES, FUNCIONES Y LIMITES. 2.1. Números reales: Propiedades e intervalos. 2.2. Desigualdades: Propiedades y resolución de inecuaciones. 2.3. Valor absoluto: Propiedades. 2.4. Funciones en el plano: Definición, variables, operaciones y función inversa. 2.5. Funciones: Polinómicas, logarítmicas, exponenciales, trigonométricas y trigonométricas inversas. 2.6. Límites de una función: Unilaterales, infinitos, al infinito, de funciones trascendentes y formas indeterminadas. 2.7. Asíntotas de una función: Horizontales, verticales e inclinadas. 2.8. Continuidad de una función: Tipos de discontinuidad. 2.9. Gráfica de una función: Dominio, rango, cortes, simetría, signo, asíntotas y continuidad. 3. LA DERIVADA. 3.1. Incrementos y diferenciales. 3.2. La derivada: Definición e interpretación geométrica. 3.3. Reglas de derivación. Regla de la cadena. 3.4. Derivadas de funciones: Polinómicas, logarítmicas, exponenciales, trigonométricas y trigonométricas inversas. 3.5. Derivación implícita. Derivación logarítmica. 3.6. Derivadas de orden superior. 4. APLICACIONES DE LA DERIVADA. 4.1. Aplicaciones geométricas: Dirección de una curva, recta tangente y normal, longitud de la subtangente y subnormal. 4.2. Taza de variación o razón de cambio. 4.3. Rapidez de variación relacionada. 4.4. El método de Newton. 4.5. Máximos y mínimos de una función: Problemas de aplicación. 4.6. Teorema de Rolle y Teorema del Valor Medio. 4.7. La fórmula de Cauchy y la regla de L’Hôpital. 4.8. Funciones crecientes y decrecientes. Criterio de la primera derivada. 4.9. Concavidad y puntos de inflexión. Criterio de la segunda derivada. 4.10. Gráfica de una función: Comportamiento, extremos relativos y puntos de inflexión.

d. Metodología Para el desarrollo de la cátedra se pueden utilizar las siguientes metodologías de enseñanza aprendizaje: - Aprendizaje Cooperativo

Ing. Teddy Negrete

Página 63

- Estudio de Casos - Aprendizaje por proyectos - Resolución de problemas - El seminario - Prácticas de laboratorios - Prácticas de campo - Prácticas externas - Tutorías - Trabajos escritos - Clase magistral - Clases apoyadas con TIC´S

e. Recursos Material Didáctico (pizarrón, tiza liquida, borrador, etc.) Aulas Multimedia Aulas de Computo Otros…………………………………………………………….

Laboratorios de Practicas Talleres Prácticas de Campo

f. Evaluación Lo que dispone el Reglamento General de Facultad de la UPS

g. Bibliografía [1.] LEHMANN, CHARLES H., Geometría analítica/ Edit. Limusa. México. 3¦ reimpresión. 1980. 494 p. fig., tab. [2.] SWOKOWSKI, EARL W, Cálculo con geometría analítica/ Grupo Editorial Iberoamérica. México. 2a. edición. 1989. 1098 p. Fig. [3.] GRANVILLE, WILLIAM ANTHONY, Cálculo diferencial e integral/ Edit. Limusa. México. 1980. 686 p. fig.

Ing. Teddy Negrete

Página 64

[4.] LEITHOLD LOUIS, EL Cálculo / Oxford University Press. México. 7a. edición. 1998. 1358 p. Fig. [5.] PURCELL, EDWIN J.; VARBERG, DALE; RIGDON, STEVEN E; Cálculo / Person Educación. México. 2001. 796 p.

h. Datos de Docente/s Tipo de Documento de Número de Identificación Identificación Cédula Pasaporte

Apellidos y Nombres

Correo Electrónico

Teléfono

14. FUNCIONES DE MATLAB QUE SE APLICAN EN CÁLCULO DIFERENCIAL: 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23.

linspce logspace plot ezplot expand factor root poly pascal limit diff roots poly nthroot sym2poly poly2sym fzero fsolve conv deconv polyder fminbnd solve

Ing. Teddy Negrete

Página 65

15.

MATLAB

16.

SYMBOLIC MATH TOOLBOX

Ing. Teddy Negrete

Página 66

9. EJEMPLOS Y EJERCICIOS DE CÁLCULO DIFERENCIAL CON MATLAB:

17.

UNIDAD # 1: GEOMETRÍA ANALITICA.

%CONICAS: CIRCULO %inicio de bloque ezplot('x^2+y^2=9') grid axis equal %fin de bloque

%CONICAS: ELIPSE %inicio de bloque ezplot('x^2/4+y^2/9=1') grid axis equal %fin de bloque

Ing. Teddy Negrete

Página 67

%CONICAS: PARÁBOLAS %inicio de bloque ezplot('x=4*(y-2)^2') %PARÁBOLA HORIZONTAL axis equal hold on ezplot('y+4=4*(x)^2') %PARÁBOLA VERTICAL grid hold off %fin de bloque

Ing. Teddy Negrete

Página 68

18.

UNIDAD # 2: NUMEROS REALES, FUNCIONES Y LIMITES.

%GRAFICOS DE FUNCIONES %inicio de bloque clear all x=-5:.1:0 y1=x+2 plot(x,y1) hold on x=0:.1:3 y2=x.^3-1 plot(x,y2) hold on x=3:.1:5 y3=1-heaviside(x+3) plot(x,y3) grid %fin de bloque

Ing. Teddy Negrete

Página 69

%inicio de bloque % GRÁFICA Y = X + 24/X % GRAFICO SIMPLIFICADO, EN INTERVALO DE DOMINIO PARA X % GRAFICA DE UNA FUNCIÓN QUE NO EXISTE EN X=0 % NO HAY NINGÚN PROBLEMA ezplot('x+24/x',[-20,20]) grid %fin de bloque %inicio de bloque clear all x=-20:0.5:20 y=x+24./x plot(x,y) grid %fin de bloque %inicio de bloque %GRAFICA Y=sen(X)/X %LA FUNCIÓN NO SE DETERMINA PARA X=0 % ezplot('sin(x)/x',[-15,15]) grid %fin de bloque %inicio de bloque clear all x=-15:0.5:15 y=sin(x)./(x) plot(x,y) grid %fin de bloque %inicio de bloque clear all x=-15:0.5:15 y=sin(x+eps)./(x+eps) plot(x,y) grid %fin de bloque

Ing. Teddy Negrete

Página 70

Elaboración de varios gráficos dentro de una ventana, o llamados SUBPLOTS %% SUB-PLOTS %inicio de bloque close subplot(2,1,1) subplot(2,1,2) %fin de bloque %inicio de bloque close subplot(1,2,1) subplot(1,2,2) %fin de bloque

%inicio de bloque close subplot(2,2,1) subplot(2,2,2) subplot(2,2,3) subplot(2,2,4) %fin de bloque %inicio de bloque close subplot(3,2,1) subplot(3,2,2) subplot(3,2,[3 6]) %fin de bloque %inicio de bloque close subplot(3,2,2) subplot(3,2,4) subplot(3,2,6) subplot(3,2,[1 3 5]) %fin de bloque

%En una misma figura hemos realizado %varios gráficos independientes

Ing. Teddy Negrete

Página 71

%inicio de bloque close subplot(2,1,1) ezplot('y=3*sin(x)') grid subplot(2,1,2) ezplot('y=4*cos(x)') grid %fin de bloque

%En este gráfico hemos realizado %2 gráficos en la misma figura %inicio de bloque close all ezplot('y=3*sin(x)') grid on hold on ezplot('y=3*cos(x)') grid on %fin de bloque

%% EJES EN 3 DIMENSIONES:

%inicio de bloque clc close all axis([0 5 0 6 0 7]) grid axis equal %fin de bloque

%inicio de bloque close t=0:pi/20:8*pi plot3(cos(t),sin(t),t) grid axis equal %fin de bloque

Ing. Teddy Negrete

Página 72

%SIMPLIFICACIÓN TRIGONOMÉTRICA %inicio de bloque syms A B C B=(sin(A))^2+(cos(A))^2+(tan(A))^2 C=simplify(B) pretty(C) %fin de bloque %inicio de bloque N=(sin(120*pi/180))^2-3*(cos(210*pi/180))^2 D=5*(tan(315*pi/180))^2+cot(135*pi/180) R=N/D format rat R format short %fin de bloque %inicio de bloque syms x a b a=((cos(x))^2-(sin(x))^2)/(cos(3*x)-sin(x)) b=simplify(a) pretty(b) %fin de bloque %inicio de bloque syms x a b a=((cos(x))^2-(sin(x))^2)/(cos(3*x)+cos(x)) b=simplify(a) pretty(b) %fin de bloque %inicio de bloque syms x a b a=((cos(x))^2-(sin(x))^2)/(cos(3*x)+2*(cos(x))^3) b=simplify(a) pretty(b) %fin de bloque %inicio de bloque syms x a b a=(sin(x)+sin(3*x))/(cos(x)+cos(3*x)) b=simplify(a) pretty(b) %fin de bloque

Ing. Teddy Negrete

Página 73

%inicio de bloque f=inline('((cos(x))^2-(sin(x))^2)/(cos(3*x)-sin(x))') fa=inline('2*csc(x)') fb=inline('2*sin(x)') fc=inline('2*cos(x)') fd=inline('2*cot(x)') fe=inline('2*sec(x)') x=pi/3 f(x) fa(x),fb(x),fc(x),fd(x),fe(x) %fin de bloque

%GRÁFICO DE FUNCIÓN TRIGONOMETRICA %inicio de bloque clear all x=(-6*pi:6*pi) y=sin(x/3) figure(4) plot(x,y) grid title('La onda seno, y=sin(x/3)') %fin de bloque %inicio de bloque subplot(2,3,1) ezplot('sin(x)') subplot(2,3,2) ezplot('cos(x)') subplot(2,3,3) ezplot('tan(x)') subplot(2,3,4) ezplot('cot(x)') subplot(2,3,5) ezplot('sec(x)') subplot(2,3,6) ezplot('csc(x)') %fin de bloque

%inicio de bloque ezplot('atan(x)') %fin de bloque

Ing. Teddy Negrete

Página 74

%GRAFICOS DE LAS FUNCIONES TRIGONOMÉTRICAS APLICACIÓN DE LA FUNCIÓN “plot”

%inicio de bloque clear all x=-2*pi:0.01*pi:2*pi ysin=sin(x) ycos=cos(x) ytan=tan(x) ycot=cot(x) ysec=sec(x) ycsc=csc(x) subplot(2,3,1) plot(x,ysin) grid subplot(2,3,2) plot(x,ycos) grid subplot(2,3,3) plot(x,ytan) grid subplot(2,3,4) plot(x,ycot) grid subplot(2,3,5) plot(x,ysec) grid subplot(2,3,6) plot(x,ycsc) grid %fin de bloque

%FUNCIONES ESPECIALES DE UNA VARIABLE Ejecute en la "Línea de Comandos" las siguientes instrucciones: >>ezplot('heaviside(x)',[-1 1 -0.5 1.5]) >>ezplot('abs(x)') >>ezplot('sign(x)',[-1 1 -1.5 1.5]) Comente y registre los resultados obtenidos en la ejecución anterior.

Ing. Teddy Negrete

Página 75

%COMPOSICIÓN DE FUNCIONES %Ejemplos de composiciones %inicio de bloque syms x y z t u f = 1/(1 + x^2); g = sin(y); h = x^t; p = exp(-y/u); a = compose(f,g) b = compose(f,g,t) c = compose(h,g,x,z) d = compose(h,g,t,z) e = compose(h,p,x,y,z) f = compose(h,p,t,u,z) %fin de bloque Retorna después de la ejecución: a= 1/(sin(y)^2 + 1) b= 1/(sin(t)^2 + 1) c= sin(z)^t d= x^sin(z) e= exp(-z/u)^t f= x^exp(-y/z) Comente y registre los resultados obtenidos en la ejecución anterior. %INVERSA DE UNA FUNCIÓN BIYECTIVA %Ejemplos de la inversa de una función Determine la función inversa de la función trigonométrica: %inicio de bloque syms x f(x) = 1/tan(x); g = finverse(f) %fin de bloque

Ing. Teddy Negrete

Página 76

Retorna después de la ejecución: g(x) = atan(1/x) Determine la función inversa de la función trigonométrica: %inicio de bloque syms u v finverse(exp(u - 2*v), u) %fin de bloque Retorna después de la ejecución: ans = 2*v + log(u) Comente y registre los resultados obtenidos en la ejecución anterior. %LÍMITES DE UNA FUNCIÓN Ejecute en la "Línea de Comandos" las siguientes instrucciones: >>syms x,limit('sin(x)',x,0) >>limit('(x-1)/(x^2-1)',x,1) >>limit('tan(3*x)/x',x,0) Comente y registre los resultados obtenidos en la ejecución anterior. Ahora utilicemos el editor de MATLAB, para ejecutar las siguientes líneas: %% CÁLCULO DIFERENCIAL %LÍMITES syms x limit(sin(x)/x,x,pi) limit(sin(x)/x,x,pi/2) limit(sin(x)/x,x,0) f=inline(sin(x)/x) f(2), f(3), f(0) %NaN - not a number esto es 0/0 %es una indeterminación f(eps)

Ing. Teddy Negrete

Página 77

%Límites unilaterales ezplot('y=heaviside(x)') syms x limit(heaviside(x),x,0,'left') limit(heaviside(x),x,0,'right') limit(log(x),x,exp(1)) %la respuesta presentada es racional %pero aproximada %podemos utilizar algunas funciones como: %ROUND %SIMPLIFY %SIMPLE round(limit(log(x),x,exp(1)))

19.

UNIDAD # 3: LA DERIVADA.

%DERIVACIÓN DE FUNCIONES DE UNA VARIABLE Ejecute en la "Línea de Comandos" las siguientes instrucciones: >>diff(sin(x)) >>syms a, diff(sin(a*x),x) >>syms x, diff(sin(a*x),a) >>diff(x^3,2) >>diff(log(x),3) Comente y registre los resultados obtenidos en la ejecución anterior.

%inicio de bloque clear all syms a x y=a^3*exp(x)-a^2*sin(x); y_prima=diff(y) %Obtiene la derivada de una funcion y y3_prima=diff(y,3) %Deriva y TRES veces con respecto a x y_prima_a=diff(y,a) y2_prima_a=diff(y,a,2) %fin de bloque

Ing. Teddy Negrete

Página 78

%La DERIVADA de un POLINOMIO %inicio de bloque %El polinomio es: x^4+x^2+1 polyder([1 0 1 0 1]) %fin de bloque %inicio de bloque p=polyder([1 0 1 0 1]) polyval(p,1) %fin de bloque

%La DERIVADA de una EXPONENCIAL %derivadas de una variable syms x diff(exp(x)*sin(x),x) diff(exp(x)*sin(x),x,2) diff(exp(x)*sin(x),x,6) syms x a diff(exp(-a*x)*x^2,x) pretty(ans) diff(exp(-a*x)*x^2,a) %gráficos rápidos en coordenadas %rectangulares %FUNCIONES EXPLÍCITAS figure(1) %abre la figura o ventana 1 ezplot('y=4*exp(-x/3)',[-1 3 -1 6]) grid %FUNCIÓN IMPLÍCITA figure(2) %abre la figura o ventana 2 ezplot('x^2+y^2=4') axis equal %establece ejes igules clf %limpia el contenido de la última figura close all %cierra todas las figuras (ventanas) abiertas

Ing. Teddy Negrete

Página 79

20.

UNIDAD # 4: APLICACIONES DE LA DERIVADA.

VALORES EXTREMOS: MÍNIMO LOCAL %VALOR MÍNIMO syms x h=2*x^2+x-1 ezplot(h,[-2,2]) grid fminbnd('2*x^2+x-1',-2,2)

VALORES EXTREMOS %VALORES EXTREMOS syms x ezplot('y=(1-x)*(x+2)') grid diff('y=(1-x)*(x+2)') solve(ans)

Ing. Teddy Negrete

Página 80

Ing. Teddy Negrete

Página 81

%EXAMEN PARCIAL 09_01 CÁLCULO DIFERENCIAL

%Analice tema por tema de este EXAMEN PARCIAL: %Si es posible desarrolle los gráficos usando MATLAB, %Determine gráficamente los puntos y las características que piden los temas. %Los temas de límites %Utilice MATLAB para calculas los valores. %En los límites unilaterales utilice: >> syms x, limit(heaviside(x),x,0,'right') >> syms x, limit(heaviside(x),x,0,'left')

Ing. Teddy Negrete

Página 82

21.

CONTENIDO DE LA ASIGNATURA

CÁLCULO INTEGRAL ASIGNATURA: CÁLCULO INTEGRAL DESCRIPTOR Integral Indefinida, Métodos de Integración, Integral Definida, Aplicaciones de la Integral, Curvas Planas y Coordenadas Polares. Denominación de la Asignatura: CÁLCULO INTEGRAL Código Actual: 5758 a. Descripción de la asignatura Integral Indefinida, Métodos de Integración, Integral Definida, Aplicaciones de la Integral, Curvas Planas y Coordenadas Polares.

b. Objetivos Generales: 1. Conocer el caculo integral como herramienta matemática. Específicos: 1. Analizar la anti-derivada e integral indefinida. 2. Distinguir y manejar los diferentes métodos de integración. 3. Conocer la integral definida y sus características. 4. Estudiar algunas aplicaciones de la integral. 5. Manejar las curvas planas y coordenadas polares

c. Contenidos 1.INTEGRAL INDEFINIDA 1.1 Anti-derivada y constante de integración 1.2 Integración de formas elementales, cambio de variable

Ing. Teddy Negrete

Página 83

2. MÉTODOS DE INTEGRACIÓN 2.1 Integración de formas elementales: Cambio de variable 2.2 Integración por partes 2.3 Integración de diferenciales trigonométricas 2.4 Integración por sustitución trigonométrica 2.5 Integración de funciones racionales 2.6 Integración de expresiones cuadráticas 2.7 Integración por sustituciones diversas 2.8 Tabla de integración 3. INTEGRAL DEFINIDA 3.1 La notación sigma, área bajo una curva 3.2 La suma de Riemann, la integral definida 3.3 Propiedades de la integral definida 3.4 Teorema fundamental del cálculo integral 3.5 Cambio de limites correspondientes a un cambio de variable 3.6 Integración numérica: Fórmula del Trapecio, fórmula de Simpson 3.7 Integrales impropias 4. APLICACIONES DE LA INTEGRAL 4.1 Áreas: Integración respecto a X e integración respecto a Y Volúmenes 4.2 Sólidos de Revolución 4.2.1 Disco 4.2.2 Arandela 4.2.3 Envolvente 4.2.4 Cortes transversales

Ing. Teddy Negrete

Página 84

4.2 5 Longitud de arco 4.2 6 Superficies de revolución 4.3 Trabajo 4.4 Fuerza ejercida por un líquido 4.5 Momentos y centros de masa de una lamina 5. CURVAS PLANAS Y COORDENADAS POLARES 5.1 Curvas planas 5.2 Recta tangente y longitud de arco 5.3 Coordenadas polares 5.4 Integrales en coordenadas polares 5.5 Ecuaciones polares de las cónicas

d. Metodología Para el desarrollo de la cátedra se pueden utilizar las siguientes metodologías de enseñanza aprendizaje: - Aprendizaje Cooperativo - Estudio de Casos - Aprendizaje por proyectos - Resolución de problemas - El seminario - Prácticas de laboratorios - Prácticas de campo - Prácticas externas - Tutorías - Trabajos escritos - Clase magistral - Clases apoyadas con TIC´S e. Recursos Material Didáctico (pizarrón, tiza liquida, borrador, etc.) Aulas Multimedia Aulas de Computo Otros…………………………………………………………….

Laboratorios de Practicas Talleres Practicas de Campo

f. Evaluación Lo que dispone el Reglamento General de Facultad de la UPS

Ing. Teddy Negrete

Página 85

g. Bibliografía [1.] THOMAS, GEORGE B. JR.; FINNEY, ROSS L; Cálculo varias variables/ Edit. Pearson Educación. México. 9 ¦ ed. 1999. xv; 1139p.; A-8; R-31; I-7; T-5. Fig. [2.] SWOKOWSKI, EARL W. , Cálculo con geometría analítica/ Grupo Editorial Iberoamérica. México. 2a. edición. 1989. 1098 p. Fig. [3.] GRANVILLE, WILLIAM ANTHONY., Cálculo Diferencial e integral/ Edit. Limusa. México. 1980. 686 p. fig. [4.] LEITHOLD, LOUIS, El Cálculo / Oxford University Press. México. 7a. edición. 1998. 1358 p. Fig. [5.] PURCELL, EDWIN J.; VARBERG, DALE; RIGDON, STEVEN E; Cálculo / Person Educación.

h. Datos de Docente/s Tipo de Documento de Número de Identificación Identificación Cédula Pasaporte

Apellidos y Nombres

Correo Electrónico

Teléfono

22. FUNCIONES DE MATLAB QUE SE APLICAN EN CÁLCULO INTEGRAL: 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16.

plot ezplot Inf int diff trapz quad quadl dblquad symsum sqrt cart2pol polar ezpolar sinint cosint

Ing. Teddy Negrete

Página 86

23.

MATH

24.

SYMBOLIC MATH TOOLBOX

Ing. Teddy Negrete

Página 87

10.

EJEMPLOS Y EJERCICIOS DE CÁLCULO INTEGRAL CON MATLAB:

25.

UNIDAD # 1: INTEGRAL INDEFINIDA

%DESCOMPOSICIÓN EN FRACIONES PARCIALES %inicio de bloque syms x y y=simplify(1/x^2+3/x-4/(x-1)) pretty(y) %fin de bloque

%inicio de bloque syms x y y=simplify((x^4-x)/(x*(x^2-4))) pretty(y) %fin de bloque

%inicio de bloque num=[3 -1] den=[1 1 -6] [a b c]=residue(num,den) %fin de bloque

%inicio de bloque num=[1 0 0 -1 0] den=[1 0 -4 0] [a b c]=residue(num,den) [n d]=residue(a,b,c) %fin de bloque

%inicio de bloque syms x y y=simplify(x+1.75/(x-2)+2.25/(x+2)) pretty(y) %fin de bloque

Ing. Teddy Negrete

Página 88

%inicio de bloque syms x y y=simplify((-4/15)/(x+3)+(1/10)/(x-2)+(1/6)/x) pretty(y) %fin de bloque

Ejecute en el PROMPT las siguientes instrucciones: >>[a b c]=residue([-1 1],[-1 -1 6 0]) >>[a b c]=residue([1 1],[1 0 1 0]) >>[a b c]=residue([4 -3 23 -11 32],[1 0 8 0 16 0]) Comente y registre los resultados obtenidos en la ejecución anterior.

%inicio de bloque syms x y z y=(1/x)+simplify((-1/2-1/2i)/(x-i)+(-1/2+1/2i)/(x+i)) pretty(y) z=simplify(y) pretty(z) %fin de bloque

%inicio de bloque [a b c]=residue([1 0 0 1],[1 0 4 0 4 0]) syms x y y=simplify(2/x+(2*x-3)/(x^2+4)+(-x+1)/(x^2+4)^2) pretty(y) %fin de bloque

%INTEGRACIÓN DE FUNCIONES DE UNA VARIABLE Ejecute en el PROMPT las siguientes instrucciones: >>int('cos(x)') >>int('x^2+x-2')

Ing. Teddy Negrete

Página 89

>>int('sec(x)') >>int('sqrt(sec(x))') >>int('cos(a*x)',x) >>syms x,int('cos(a*x)',x) >>syms a,int('cos(a*x)',a) Comente y registre los resultados obtenidos en la ejecución anterior.

%INTEGRACIÓN INDEFINIDA %inicio de bloque clear all syms x y1 y2 y1=int(-1*(exp(x))*cos(2*x)) y2=int(-1*(exp(x))*sin(2*x)) pretty(y1) pretty(y2) %fin de bloque %La INTEGRAL de un POLINOMIO %inicio de bloque %El polinomio es: x^5+1 polyint([1 0 0 0 0 1]) %La integral es el polinomio: x^6/6+x %En formato vectorial: [1/6 0 0 0 0 1 0] %fin de bloque

26.

UNIDAD # 2: MÉTODOS DE INTEGRACIÓN

%TÉCNICA: SUSTITUCIÓN %inicio de bloque syms x int((1+(sin(x))^2-3*(sin(x))^5)*cos(x)) %fin de bloque

Ing. Teddy Negrete

Página 90

%TÉCNICA: IDENTIDAD TRIGONOMÉTRICA %inicio de bloque syms x int(sin(3*x)*cos(5*x)) %fin de bloque %TÉCNICA: SUSTITUCIÓN TRIGONOMÉTRICA %inicio de bloque syms x int(x*(4-3*x)^(-3/2)) %fin de bloque %TÉCNICA: POR PARTES %inicio de bloque syms x int(exp(3*x)*(sin(2*x)+cos(5*x))) %fin de bloque %TÉCNICA: FRACCIONES PARCIALES %inicio de bloque syms x int((2*x+1)/((x^2-4*x-5)*(x-5))) %fin de bloque

27.

UNIDAD # 3: INTEGRAL DEFINIDA

%INTEGRAL DEFINIDA Ejecute en el PROMPT las siguientes instrucciones: >>syms x >>int(cos(x),0,pi/4) >>int(x,1,2)

Ing. Teddy Negrete

Página 91

>>int((1+x^2)^(-1),0,+inf) >>int(1/sqrt(1-x^2),0,1) Comente y registre los resultados obtenidos en la ejecución anterior. %inicio de bloque syms x f=x^2+x+2 A=int(f,0,1) %fin de bloque %inicio de bloque clear all syms x s m n f1=sin(x); f2=sin(s+2*x); integral_1=int(f1) integral_2=int(f2) integral_3=int(f2,s) %integra respecto a s int_definida1=int(f1,pi/2,pi) %fin de bloque

%METODOS DE INTEGRACIÓN NUMÉRICA

Hallar la integral



π /4

sec( x )dx, utilice el Método de Simpson con una aproximación de

0

1e(-6). Resuelva con el método analítico, aplicando la fórmula:



x2

x0

f ( x )dx =

x −x h h5 [f ( x0 ) + 4f ( x1 ) + f ( x2 )] − f ( 4) (η ), h = 2 0 3 90 2

Compruebe estos resultados con los obtenidos utilizando MATLAB:

%inicio de bloque %METODO DE SIMPSON CON ERROR DE 1e(-6) quad('sqrt(sec(x))',0,pi/4) %fin de bloque

Ing. Teddy Negrete

Página 92

x1 = x0 + h

%inicio de bloque %METODO DE CUADRATURA DE LOBATO CON ERROR DE "tol" tol=1e-6 quadl('sqrt(sec(x))',0,pi/4,tol) %fin de bloque %inicio de bloque %METODO DE CUADRATURA DE LOBATO CON ERROR DE "tol" tol=1e-16 q=quadl('sqrt(sec(x))',0,pi/4,tol) vpa(q,16) %respuesta con 16 dígitos de precisión %fin de bloque

28.

UNIDAD # 4: APLICACIONES DE LA INTEGRAL

%LONGITUD DE UN ARCO %inicio de bloque syms x y t x=cos(t) y=sin(t) l=quadl((diff(x,t))^2+(diff(y,t))^2,t,0,pi/3) %fin de bloque

29.

UNIDAD # 5: CURVAS PLANAS Y COORDENADAS POLARES

%GRÁFICO EN COORDENADAS POLARES %inicio de bloque theta=linspace(0,2*pi) rho=2*sin(4*theta); figure(5) polar(theta,rho) title('Rosa de 8 petalos 2*sin(4*theta)') %fin de bloque

Ing. Teddy Negrete

Página 93

%inicio de bloque clear all t=linspace(0,2*pi) r=4*cos(t) polar(t,r) title('CIRCUNFERENCIA, QUE PASA POR EL POLO,CON CENTRO EN EL EJE POLAR') %fin de bloque

%inicio de bloque clear all t=linspace(0,2*pi) r=-4*cos(t) polar(t,r) title('CIRCUNFERENCIA, QUE PASA POR EL POLO,CON CENTRO EN EL EJE PI') %fin de bloque %inicio de bloque clear all t=linspace(0,2*pi) r=4*sin(t) polar(t,r) title('CIRCUNFERENCIA, QUE PASA POR EL POLO,CON CENTRO EN EL EJE PI') %fin de bloque %inicio de bloque clear all t=linspace(0,2*pi) r=-4*sin(t) polar(t,r) title('CIRCUNFERENCIA, QUE PASA POR EL POLO,CON CENTRO EN EL EJE PI') %fin de bloque %inicio de bloque clear all t=linspace(0,2*pi) r1=4*cos(t) polar(t,r1) hold on r2=-4*cos(t)

Ing. Teddy Negrete

Página 94

polar(t,r2) hold on r3=4*sin(t) polar(t,r3) hold on r4=-4*sin(t) polar(t,r4) hold off %fin de bloque %inicio de bloque clear all t=0:0.1:2*pi r1=2*sec(t) polar(t,r1) %fin de bloque %inicio de bloque clear all t=0:0.1:2*pi r1=1+cos(t) polar(t,r1) title('LIMAZON CARDIOIDE') %fin de bloque %inicio de bloque ezpolar('4*cos(t)') %fin de bloque %inicio de bloque t=linspace(0,2*pi) r=4*cos(t) figure(2) polar(t,r) title('CIRCUNFERENCIA POLAR') %fin de bloque %inicio de bloque syms x, V=int((2*pi*(10-x)*(x+9-x^2+3)),-3,4) %fin de bloque

Ing. Teddy Negrete

Página 95

%GRÁFICO DE UNA ESPIRAL EXPONENCIAL %inicio de bloque t=0:pi/200:8*pi; polar(t,exp(t/8)) %fin de bloque

%GRÁFICO DE UNA ESPIRAL DE ARQUÍMEDES %inicio de bloque t=0:pi/200:8*pi; polar(t,1+2*t) %fin de bloque

Ing. Teddy Negrete

Página 96

%EXAMEN PARCIAL 09_02 CÁLCULO INTEGRAL %inicio de bloque ezpolar('3*sin(2*t)'), hold on ezpolar('(9*sin(2*t))^(1/2)'), hold off %fin de bloque

Ing. Teddy Negrete

Página 97

30.

CONTENIDO DE LA ASIGNATURA

CÁLCULO VECTORIAL ASIGNATURA: CÁLCULO VECTORIAL DESCRIPTOR Vectores y Superficies, Funciones Vectoriales, Derivadas Parciales, Integrales Múltiples, Cálculo Vectorial. Denominación de la Asignatura: CÁLCULO VECTORIAL Código Actual: 5759 a. Descripción de la asignatura Vectores y Superficies, Funciones Vectoriales, Derivadas Parciales, Integrales Múltiples, Cálculo Vectorial. b. Objetivos Generales: 1. Conocer el Cálculo Diferencial e Integral en varias variables como herramienta matemática. Específicos: 1. Realizar el estudio de curvas, planos y superficies en forma vectorial. 2. Utilizar los conceptos del Cálculo Diferencial e Integral de varias variables. 3. Integrar los conceptos Vectoriales con los del Cálculo Diferencial e Integral en procesos esecíficos. c. Contenidos 1. VECTORES Y SUPERFICIES 1.1 Rectas y planos 1.2 Superficies 1.3 Coordenadas cilíndricas y esféricas

Ing. Teddy Negrete

Página 98

2. FUNCIONES VECTORIALES 2.1 Definiciones y curvas en el espacio 2.2 Límites, derivadas e integrales 2.3 Curvatura de líneas 3. DERIVADAS PARCIALES 3.1 Funciones de varias variables 3.2 Límites y continuidad 3.3 Derivadas parciales 3.4 Interpretación geométrica de la derivada 3.5 Incrementos y diferenciales 3.6 Regla de la Cadena 3.7 Diferenciación implícita 3.8 Derivadas direccionales 3.9 Planos tangentes y rectas normales a las superficies 3.10 Máximos y mínimos de funciones de varias variables 3.11 Multiplicadores de Lagrange 4. INTEGRALES MULTIPLES 4.1 Integrales dobles 4.2 Evaluación de integrales dobles 4.3 Área y volumen 4.4 Integrales dobles en coordenadas polares 4.5 Área de una superficie 4.6 Integrales triples 4.7 Momentos y centros de masa 4.8 Integrales triples en coordenadas cilíndricas y esféricas

Ing. Teddy Negrete

Página 99

4.9 Cambio de variables en las integrales múltiples 5. CALCULO VECTORIAL 5.1 Campos Vectoriales 5.2 Integral de línea 5.3 Independencia de la trayectoria 5.4 Teorema de Green 5.5 Integrales de superficie 5.6 Teorema de la Divergencia 5.7 Teorema de Stokes d. Metodología Para el desarrollo de la cátedra se pueden utilizar las siguientes metodologías de enseñanza aprendizaje: - Aprendizaje Cooperativo - Estudio de Casos - Aprendizaje por proyectos - Resolución de problemas - El seminario - Prácticas de laboratorios - Prácticas de campo - Prácticas externas - Tutorías - Trabajos escritos - Clase magistral - Clases apoyadas con TIC´S

Ing. Teddy Negrete

Página 100

e. Recursos Material Didáctico (pizarrón, tiza liquida, borrador, etc.) Aulas Multimedia Aulas de Computo

Laboratorios de Practicas Talleres Prácticas de Campo

Otros…………………………………………………………….

f. Evaluación Lo que dispone el Reglamento General de Facultad de la UPS

g. Bibliografía [1.] THOMAS, GEORGE B. JR.; FINNEY, ROSS L; Cálculo varias variables/ Edit. Pearson Educación. México. 9 ¦ ed. 1999. xv; 1139p.; A-8; R-31; I-7; T-5. Fig. [2.] SWOKOWSKI, EARL W. , Cálculo con geometría analítica/ Grupo Editorial Iberoamérica. México. 2a. edición. 1989. 1098 p. Fig. [3.] GRANVILLE, WILLIAM ANTHONY., Cálculo diferencial e integral/ Edit. Limusa. México. 1980. 686 p. fig. [4.] LEITHOLD, LOUIS, Cálculo, El/ Oxford University Press. México. 7a. edición. 1998. 1358 p. Fig. [5.] PURCELL, EDWIN J.; VARBERG, DALE; RIGDON, STEVEN El Cálculo/ Person Educación.

h. Datos de Docente/s Tipo de Documento de Identificación

Número de Apellidos y Nombres Identificación

Cédula Pasaporte

Ing. Teddy Negrete

Página 101

Correo Electrónico

Teléfono

31. FUNCIONES DE MATLAB QUE SE APLICAN EN CÁLCULO VECTORIAL: 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35.

plot ezplot hold cart2pol cart2sph sphere cylinder ellipsoid dot cross norm plot3 ezsurf surf meshgrid xlim ylim zlim sqrt polar ezpolar Inf int diff hessian vectorPotential quad quadl dblquad jacobian hessian gradient divergence laplacian del2

Ing. Teddy Negrete

Página 102

32.

MATH

33.

SYMBOLIC MATH TOOLBOX

Ing. Teddy Negrete

Página 103

11.

EJEMPLOS Y EJERCICIOS DE CÁLCULO VECTORIAL CON MATLAB:

34.

UNIDAD # 1: VECTORES Y SUPERFICIES

%GRAFICOS DE VECTORES EN EL PLANO %USANDO LA FUNCIÓN feather

%inicio de bloque close feather([1 2 3],[1 1 1]) grid %v1=i+j, con el origen en el punto (1,0) %v2=2i+j, con el origen en el punto (2,0) %v3=3i+j, con el origen en el punto (3,0) %fin de bloque

%inicio de bloque close feather([2 4 1],[2 1 5]) grid %v1=2i+2j, con el origen en el punto (1,0) %v2=4i+1j, con el origen en el punto (2,0) %v3=1i+5j, con el origen en el punto (3,0) %fin de bloque

%inicio de bloque close feather(2,2) hold on feather(4,1) feather(1,5) hold off grid %v1=2i+2j, con el origen en el punto (1,0) %v2=4i+1j, con el origen en el punto (1,0) %v3=1i+5j, con el origen en el punto (1,0) %fin de bloque

Ing. Teddy Negrete

Página 104

%inicio de bloque %esta es la mejor forma de graficar close compass([2 4 1],[2 1 5]) %v1=2i+2j, con el origen en el punto (0,0) %v2=4i+1j, con el origen en el punto (0,0) %v3=1i+5j, con el origen en el punto (0,0) %fin de bloque %inicio de bloque %esta forma no es apropiada close compass(2,2) hold on compass(4,1) compass(1,5) hold off %v1=2i+2j, con el origen en el punto (0,0) %v2=4i+1j, con el origen en el punto (0,0) %v3=1i+5j, con el origen en el punto (0,0) %fin de bloque

%EJEMPLO DE UN CUBO (PARALELEPÍPEDO–OCTAEDRO) Y DE 6 TETRAEDROS %inicio de bloque d = [-1 1]; [x,y,z] = meshgrid(d,d,d); % un cubo x = [x(:);0]; y = [y(:);0]; z = [z(:);0]; % % [x,y,z] son las esquinas del paralelepípedo mas el centro. % dt = DelaunayTri(x,y,z); Tes = dt(:,:); X = [x(:) y(:) z(:)]; tetramesh(Tes,X); camorbit(20,0) %inicio de bloque

Ing. Teddy Negrete

Página 105

%SUPERFICIES CUÁDRICAS Y CILÍNDRICAS %inicio de bloque %esfera sphere axis equal % [x y z]=sphere surf(x,y,z) axis equal % [x y z]=sphere surf(3.*x,3.*y,3.*z) axis equal % [x y z]=sphere surf(3.*x+1,3.*y-1,3.*z+2) axis equal %La ecuación de la esfera %(x-1)^2+(y+1)^2+(z-2)^2=9 %fin de bloque

Ing. Teddy Negrete

Página 106

%esta forma de graficar esferas %nos permiten definir también un elipsoide %inicio de bloque %elipsoide help ellipsoid close all ellipsoid(0,0,0,1,2,3,20) axis equal % %una esfera usando ellipsoid close all ellipsoid(0,0,0,3,3,3) axis equal % close all ellipsoid(0,0,0,3,3,3,50) axis equal %fin de bloque %inicio de bloque %cilíndros circular clear close clc cylinder % close clear [x y z]=cylinder surf(x,y,3.*z) axis equal % close clear [x y z]=cylinder surf(3.*z,x,y) axis equal % close clear [x y z]=cylinder surf(3.*z,x+1,y+2) axis equal %fin de bloque

Ing. Teddy Negrete

Página 107

%inicio de bloque %función de variable simbólica ezsurf('4.*sin(y)') % close ezsurf('x^2+y^2',[-4*pi 4*pi -4*pi 4*pi]) %fin de bloque

%inicio de bloque %otra función que ofrece MATLAB %para gráfica funciones peaks %fin de bloque

Esta función es ideal para analizar valores extremos, como minímo local y global, o máximo local o global de la superficie z=z(x,y).

Ing. Teddy Negrete

Página 108

%inicio de bloque %uso del meshgrid para definir el dominio % de la función explícita z=z(x,y) close clc [x y]=meshgrid(-2:0.1:3,-3:0.1:2) z=exp(-x.^2-y.^2) surf(x,y,z) %fin de bloque

%SUPERFICIE EN SISTEMA RECTANGULAR

Recordemos algunas superficies cuádricas y cilíndricas estudiadas:

Cilindro :

x2 + y 2 = 1

Paraboloide : z = x + y 2

Elipsoide :

C (0,0); r = 1

2

V (0,0,0)

x + 2y + z = 1 C (0,0,0) 2

2

2

Utilicemos SUPERFICIES, para obtener el lugar geométrico de las ecuaciones:

Cilindro

Paraboloide

Ejecute en el PROMPT las siguientes instrucciones:

Ing. Teddy Negrete

Página 109

Elipsoide

>>syms x y >>cylinder >>cylinder(3) >>ezsurf('x^2+y^2') >>ezsurf('x^2+y^2',[-3 3 -3 3]) >>ellipsoid(0,0,0,1,1/sqrt(2),1,20) >>ellipsoid(0,0,0,1,1/sqrt(2),1,30) >>ellipsoid(0,0,0,1,1/sqrt(2),1,10) >>sphere >>sphere(20) Comente y registre los resultados obtenidos en la ejecución anterior.

%CONVERSION DE SISTEMAS COORDENADOS

Ejecute en la "LÍNEA DE COMANDOS": >>[x y]=pol2cart(pi/3,1) >>[x y]=pol2cart(-2*pi/3,-2) >>[t r]=cart2pol(2,2) >>pi/4 >>2*sqrt(2) >>[t r]=cart2pol(-1,sqrt(3)) >>2*pi/3 >>[x y z]=sph2cart(0,0,1) >>[x y z]=sph2cart(pi/2,0,1) >>[x y z]=sph2cart(pi/2,pi,1) >>[x y z]=sph2cart(pi/2,pi/2,1) >>[x y z]=sph2cart(3*pi/2,0,1) >>[t,f,r]=cart2sph(0,1,0) >>pi/2 >>[t,f,r]=cart2sph(1,0,0) >>[t,f,r]=cart2sph(0,0,1) >>pi/2 Analice y comente los resultados obtenidos.

Ing. Teddy Negrete

Página 110

35.

UNIDAD # 2: FUNCIONES VECTORIALES

GRAFICOS DE CURVAS PARAMETRIZADAS ES EL ESPACIO: Ejecute en el PROMPT las siguientes instrucciones: >>ezplot3('t-1','2-3*t','1') >>ezplot3('t','t^3-t^2+2','t+1') >>ezplot3('3*cos(t)','3*sin(t)','2*t') >>ezplot3('3*cos(t)','3*sin(t)','2*t',[0,5*pi]) Comente y registre los resultados obtenidos en la ejecución anterior. %% EJES EN 3 DIMENSIONES: %inicio de bloque clc close all axis([0 5 0 6 0 7]) grid, axis equal %fin de bloque %inicio de bloque close t=0:pi/20:8*pi plot3(cos(t),sin(t),t) grid, axis equal %fin de bloque Superficie CILÍNDRICA en Z, a partir de Curva PARAMETRIZADA: %inicio de bloque %Cilindro elíptico t=(0:0.1:2*pi)' h=-2:0.1:2 x=2*cos(t)*ones(size(h)) y=3*sin(t)*ones(size(h)) z=ones(1,size(t))'*h surf(x,y,z) %fin de bloque

Ing. Teddy Negrete

Página 111

36.

UNIDAD # 3: DERIVADAS PARCIALES

Superficies de FUNCIÓN EXPLÍCITA:

%inicio de bloque clc close all x=-7.5:0.5:7.5; y=x; [X,Y]=meshgrid(x,y) %El agregar eps elimina la división por cero cuando x=y=0. R=sqrt(X.^2+Y.^2)+eps %La matriz R contiene el radio de cada punto en [X,Y]. Z=sin(R)./R; %note el uso de la cosntante eps %La matriz Z contiene el seno del radio dividido por el radio para cada %punto del plano. Con el comando mesh se genera la gráfica. figure(16) surf(X,Y,Z) %Grafica de superficie hold title('Superfice de la ecuación z=[sen(x^2+y^2)]/(x^2+y^2)') %fin de bloque

%inicio de bloque close all x=-1:0.1:1; y=x; [X,Y]=meshgrid(x,y) Z=4-X.^2-Y.^2 figure(17) surf(X,Y,Z) hold Z=X.^2+Y.^2-4 surf(X,Y,Z) %fin de bloque

Ing. Teddy Negrete

Página 112

%inicio de bloque h=@(x,y)x.*y - x; ezsurf(h) ezsurf(@peaks) %fin de bloque

%inicio de bloque clear all f=@(x,y)(x^2+y^2) ezsurf(f) %fin de bloque

%inicio de bloque close all ezsurf('x^2+y^2') %fin de bloque

%inicio de bloque ezsurf('y^2+y+2') %fin de bloque

%inicio de bloque ezsurf('sqrt(x^2+y^2)') %fin de bloque

%inicio de bloque ezsurf('x*y-x') %fin de bloque

%inicio de bloque %Superficie Cílindrica Inclinada ezsurf('x^2-y') %fin de bloque

Ing. Teddy Negrete

Página 113

%inicio de bloque %Superficie Cilíndrica PARALELA AL EJE Y ezsurf('x^2') %fin de bloque

%inicio de bloque ezsurf('x^2+y^2-z^2') %¿Por qué se produce un error? %fin de bloque %inicio de bloque ezsurf('6-3*x-2*y') %fin de bloque

%Usando Función Potencia %inicio de bloque ezsurf('(x^2+y^2-1)^(1/2)',[-10,10],[-10,10]) hold on ezsurf('-(x^2+y^2-1)^(1/2)',[-10,10,-10,10]) hold off %fin de bloque

%Usando Función Raíz Cuadrada SQRT

%inicio de bloque ezsurf('sqrt(x^2+y^2-1)',[-10,10],[-10,10]) hold on ezsurf('-sqrt(x^2+y^2-1)',[-10,10,-10,10]) hold off %fin de bloque

Ing. Teddy Negrete

Página 114

%inicio de bloque ezsurf('4-(x^2+y^2)') hold on ezsurf('x^2+y^2') hold off %fin de bloque

CURVAS DE NIVEL

%inicio de bloque [x y]=meshgrid(-1:0.1:1,-1:0.1:1) z=x.^2+y.^2 contour(z) %fin de bloque

Recordemos los límites de funciones de 2 ó 3 variables:

lim

( x ,y )→(1,2 )

(x + y )

x2 − y 2 ( x ,y )→(1,1) x − y lim

lim

( x ,y )→(π /4,π /3 )

cos ( xy )

x 2 − 2y 2 ( x ,y )→(1,1) x − y lim

lim

( x ,y ,z )→(1,2,3 )

(x + y + z)

%LÍMITES DE FUNCIONES DE UNA O MAS VARIABLES Ejecute en el PROMPT las siguientes instrucciones: >>syms x y >>limit(limit(x+y,x,1),y,2) >>limit(limit(cos(x*y),pi/4),y,pi/3) >>limit(limit((x^2-y^2)/(x-y),1),1) >>limit(limit((x^2-2*y^2)/(x-y),1),1) >>limit(limit(limit(x+y+z,x,1),y,2),3) >>syms z,limit(limit(limit(x+y+z,x,1),y,2),3) Comente y registre los resultados obtenidos en la ejecución anterior.

Ing. Teddy Negrete

Página 115

Recordemos las derivadas de funciones de 2 ó 3 variables:

∂ 2  2 xy    ∂x ∂y  x − y 

∂3 e − xy + cos( xy ) ∂x ∂y 2

(

)

∂2 3y − 2x 3 ∂x 2

(

%DERIVACIÓN DE FUNCIONES DE UNA O MAS VARIABLES Ejecute en el PROMPT las siguientes instrucciones: >>syms x y z >>diff(diff(2*x*y/(x-y),x),y) >>diff(diff(exp(-x*y)+cos(x*y),y,2),x)

>>diff(3*y-2*x^3,x,2) >>diff(diff(x*y/z^2,z),x) Comente y registre los resultados obtenidos en la ejecución anterior.

%inicio de bloque syms x y z=diff(diff(2*x*y/(x-y),x),y) pretty(simplify(z)) %fin de bloque

%inicio de bloque clear all syms a x y=a^3*exp(x)-a^2*sin(x); y_prima=diff(y) %Obtiene la derivada de una funcion y y3_prima=diff(y,3) %Deriva y TRES veces con respecto a x ya_prima=diff(y,a) %Deriva y respecto a la variable a ya3_prima=diff(y,a,3) %Deriva TRES veces y con respecto a a %fin de bloque

Ing. Teddy Negrete

Página 116

)

∂ 2  xy  ∂x ∂z  z 2 

ECUACIÓN DE LAPLACE: Dada la función z =

x2 − y 2

(x

2

+ y2

)

2

comprobar que satisface la EDP

%inicio de bloque clear all syms x y z u z=(x^2-y^2)/(x^2+y^2)^2 zx2=diff(z,x,2) zy2=diff(z,y,2) u=zx2+zy2 % simplify(u) %simplifica la expresión % pretty(zx2) %mejora la presentación de la expresión algebraica pretty(zy2) %mejora la presentación de la expresión algebraica %fin de bloque

37.

UNIDAD # 4: INTEGRALES MULTIPLES

%inicio de bloque clear all syms x y z f=z*x^2+y*x+2 A=int(f,y,z) %fin de bloque

%inicio de bloque clear all syms x y z f=sin(x) A=int(f,y,z) %fin de bloque

Ing. Teddy Negrete

Página 117

∂2z ∂2z + =0 ∂x 2 ∂y 2

%inicio de bloque clear all syms x y z f=sin((x^2)*y) A=int(f,y,x,z) %fin de bloque

%inicio de bloque clear all syms x y z f=x+y+z A=int(int(int(f,z,0,1),y,0,1),x,0,1) %fin de bloque

%inicio de bloque clear all syms x y z f=1 A=int(int(int(f,z,-sqrt(9-x^2-y^2),sqrt(9-x^2-y^2)),y,-sqrt(9-x^2),sqrt(9-x^2)),x,-3,3) %fin de bloque %inicio de bloque clear all syms r t a b a=(r^3)*int((sec(t))^3,t,pi/4,atan(3/r)) b=simplify(a) pretty(b) %fin de bloque %inicio de bloque clear all syms r z b c c=2*pi*int(int(r*sqrt(r^2+z^2),z,r,3),r,0,3) b=simplify(c) pretty(b) %fin de bloque

Ing. Teddy Negrete

Página 118

%inicio de bloque clear all syms r z b c c=2*pi*int(int(r*sqrt(r^2+z^2),r,0,z),z,0,3) b=simplify(c) pretty(b) %fin de bloque

38.

UNIDAD # 5: CALCULO VECTORIAL

Película grabada con juego de cuadros. %inicio de bloque figure('Renderer','zbuffer') Z = peaks; surf(Z); axis tight set(gca,'NextPlot','replaceChildren'); % asigna previamente la “struct array” de la estructura devuelta por “getframe” F(20) = struct('cdata',[],'colormap',[]); % graba la película for j = 1:20 surf(.01+sin(2*pi*j/20)*Z,Z) F(j) = getframe; end movie(F,10) %fin de bloque

%CAMPOS VECTORIALES %GRÁFICO DE UN CAMPO VECTORIAL USANDO “coneplot” %inicio de bloque load wind xmin = min(x(:)); xmax = max(x(:)); ymin = min(y(:)); ymax = max(y(:)); zmin = min(z(:)); daspect([2,2,1])

Ing. Teddy Negrete

Página 119

xrange = linspace(xmin,xmax,8); yrange = linspace(ymin,ymax,8); zrange = 3:4:15; [cx cy cz] = meshgrid(xrange,yrange,zrange); hcones = coneplot(x,y,z,u,v,w,cx,cy,cz,5); set(hcones,'FaceColor','red','EdgeColor','none') hold on wind_speed = sqrt(u.^2 + v.^2 + w.^2); hsurfaces = slice(x,y,z,wind_speed,[xmin,xmax],ymax,zmin); set(hsurfaces,'FaceColor','interp','EdgeColor','none') hold off axis tight; view(30,40);axis off camproj perspective; camzoom(1.5) set(hsurfaces,'AmbientStrength',.6) set(hcones,'DiffuseStrength',.8) %inicio de bloque

Ing. Teddy Negrete

Página 120

%EXAMEN PARCIAL 2009_01 CÁLCULO VECTORIAL %Si es posible utilizando las funciones y comandos de MATLAB, elabore los gráficos correspondientes: %Calcule los límites y derivadas planteadas en este examen.

Ing. Teddy Negrete

Página 121

39.

CONTENIDOS DE LA ASIGNATURA

ECUACIONES DIFERENCIALES ASIGNATURA: ECUACIONES DIFERENCIALES DESCRIPTOR Ecuaciones Diferenciales de Primer Orden, Ecuaciones Diferenciales Lineales de Segundo Orden, Ecuaciones Diferenciales Lineales de Orden Superior, Soluciones en Series de Potencias de las Ecuaciones Diferenciales, La Transformada de Laplace. Denominación de la Asignatura: ECUACIONES DIFERENCIALES Código Actual: 5799 a. Descripción de la asignatura Ecuaciones Diferenciales de Primer Orden, Ecuaciones Diferenciales Lineales de Segundo Orden, Ecuaciones Diferenciales Lineales de Orden Superior, Soluciones en Series de Potencias de las Ecuaciones Diferenciales, La Transformada de Laplace. b. Objetivos Generales: 1. Resolver ecuaciones diferenciales de orden n-ésimo. Específicos: 1. Resolver ecuaciones diferenciales de orden n-ésimo para casos especiales. 2. Realizar el estudio de series, para aplicar en la resolución de ecuaciones diferenciales. 3. Utilizar el método de Transformada de Laplace para resolución de ecuaciones diferenciales de orden n-ésimo.. c. Contenidos 1. ECUACIONES DIFERENCIALES DE 1º ORDEN 1.1. Conceptos e ideas Básicas 1.2. Ecuaciones de variables separables

Ing. Teddy Negrete

Página 122

1.3. Ecuaciones convertibles a la forma de variables separables: reducibles, transformables 1.4. Ecuaciones diferenciales exactas 1.5. Factores de integración 1.6. Ecuaciones diferenciales lineales de 1º orden: y’+p(x)y=q(x) 1.7. Variación de parámetros 1.8. Aplicaciones. Modelado con ecuaciones diferenciales de 1º orden 1.8.1 Ecuaciones lineales 1.8.2 Ecuaciones no lineales 2. ECUACIONES DIFERENCIALES DE 2º ORDEN 2.1. Ecuaciones lineales de segundo orden ordinarias 2.2. Ecuaciones lineales homogéneas de segundo orden. Teorema fundamental 2.3. Reducción de orden 2.4. Ecuaciones lineales homogéneas con coeficientes constantes 2.5. Solución general. Sistema fundamental. Problemas con valor inicial 2.6. Ecuaciones de Cauchy - Euler: raíces reales, raíces complejas, raíces iguales 2.7. Existencia y unicidad de las soluciones: el Wroskiano 2.8. Ecuaciones lineales no homogéneas con coeficientes constantes 2.9. Aplicaciones. Modelado de ecuaciones diferenciales de 2º orden 3. ECUACIONES DIFERNCIALES DE ORDEN SUPERIOR 3.1. Ecuaciones lineales de n-ésimo orden 3.2. Ecuaciones lineales homogéneas con coeficientes constantes 3.3. La ecuación de Cauchy-Euler 3.4. Ecuaciones lineales no homogéneas con coeficientes constantes 3.5. Aplicaciones

Ing. Teddy Negrete

Página 123

4. SOLUCIONES EN SERIES DE POTENCIAS DE LAS ECUACIONES DIFERENCIALES 4.1. Sucesiones infinitas 4.2. Series infinitas convergentes y divergentes 4.3. Series alternantes 4.4. Series de potencia 4.5. Serie de Taylor y Maclaurin 4.6. El método de series de potencia 4.7. Bases teóricas del método de series de potencias 4.8. Ecuaciones de Legrange. Polinomios de Legendre 4.9. Método extendido de las series de potencias. Ecuaciones de índice 4.10. Ecuaciones Bessel. Funciones de Bessel de primera clase 5. LA TRANSFORMADA DE LAPLACE 5.1. Transformada de Laplace. Transformada inversa. Linealidad 5.2. La Transformada de Laplace para derivadas e integrales 5.3. Transformada de las ecuaciones diferenciales ordinarias 5.4. Fracciones parciales. Factores no repetidos 5.5. Raíces complejas únicas, múltiples, complejas múltiples 5.6. Función escalón unidad. Traslación sobre el eje “t” 5.7 Funciones periódicas d. Metodología Para el desarrollo de la cátedra se pueden utilizar las siguientes metodologías de enseñanza aprendizaje: - Aprendizaje Cooperativo - Estudio de Casos

Ing. Teddy Negrete

Página 124

- Aprendizaje por proyectos - Resolución de problemas - El seminario - Prácticas de laboratorios - Prácticas de campo - Prácticas externas - Tutorías - Trabajos escritos - Clase magistral - Clases apoyadas con TIC´S e. Recursos Material Didáctico (pizarrón, tiza liquida, borrador, etc.) Aulas Multimedia Aulas de Computo

Laboratorios de Practicas Talleres Prácticas de Campo

Otros……………………………………………………………. f. Evaluación Lo que dispone el Reglamento General de Facultad de la UPS g. Bibliografía [1.] KREYSZIG, ERWIN, Matemáticas avanzadas para ingeniería/ Edit. Limusa. México. 3¦ edición. 1979. T. I; 558 p. fig., tab. [2.] KREYSZIG, ERWIN., Matemáticas avanzadas para ingeniería/ Edit. Limusa. México. 3¦ edición. 1979. T. II;566-1060 p. fig., tab. [3.] THOMAS, GEORGE B. JR.; FINNEY, ROSS L; Cálculo varias variables/ Edit. Pearson Educación. México. 9 ¦ ed. 1999. xv; 1139p.; A-8; R-31; I-7; T-5. Fig. [4.] SWOKOWSKI, EARL W. ,Cálculo con geometría analítica/ Grupo Editorial Iberoamérica. México. 2a. edición. 1989. 1098 p. Fig. [5.] GRANVILLE, WILLIAM ANTHONY.,Cálculo diferencial e integral/ Edit. Limusa. México.

Ing. Teddy Negrete

Página 125

1980. 686 p. fig. h. Datos de Docente/s Tipo de Documento de Número de Identificación

Apellidos y Nombres

Identificación

Correo Electrónico

Teléfono

Cédula Pasaporte

40.

FUNCIONES DE MATLAB QUE SE APLICAN EN ECUACIONES DIFERENCIALES:

1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25.

int diff dsolve plot ezplot abs angle complex real imag conj roots poly factor expand sym2poly poly2sym taylor taylortool laplace ilaplace simplify pretty heaviside dirac

Ing. Teddy Negrete

Página 126

41.

MATH

42.

SYMBOLIC MATH TOOLBOX

Ing. Teddy Negrete

Página 127

12.

EJEMPLOS Y EJERCICIOS DE ECUACIONES DIFERENCIALES CON MATLAB:

43.

UNIDAD # 1: ECUACIONES DIFERENCIALES DE 1º ORDEN

%RESOLUCIÓN DE EDO DE 1º ORDEN %inicio de bloque dsolve('Dy=y/t+(y/t)^(1/2)') %fin de bloque

44.

UNIDAD # 2: ECUACIONES DIFERENCIALES DE 2º ORDEN

%RESOLUCIÓN DE EDO DE 2º ORDEN %inicio de bloque dsolve('D2y=exp(2*t)+5*Dy-4*y,y(0)=1,Dy(0)=0') %fin de bloque %inicio de bloque dsolve('D2y=exp(-t)*cos(3*t)+Dy-2*y') %fin de bloque %inicio de bloque dsolve('D2y=y+exp(2*t)*cos(3*t)') %fin de bloque %COMPARACIÓN DE RESULTADOS EFECTUADOS CON SIMULINK %3y''-2y'+4y=6*cos(t) %EDO lineal de 2º orden %de coeficientes constantes %NO homogénea %en MATLAB se usa dsolve %función de variable simbólica %1. se despeja el término de mayor orden %y''=(6*cos(t)+2y'-4y)/3 %y''= 6*cos(t)/3 + 2y'/3 - 4y/3 %y''=D2y %y'=Dy

Ing. Teddy Negrete

Página 128

%SOLUCIÓN DE LA EDO –ESPACIO VECTORIAL %inicio de bloque close, clear, clc syms t y dsolve('D2y=6*cos(t)/3+2*Dy/3-4*y/3') simplify(ans) pretty(ans) %fin de bloque

%SOLUCIÓN DE LA EDO CON VALORES INICIALES – UNA FUNCIÓN %inicio de bloque clear clc syms t y dsolve('D2y=6*cos(t)/3+2*Dy/3-4*y/3','y(0)=0','Dy(0)=0') simplify(ans) pretty(ans) ezplot(ans,[0 10]) grid %fin de bloque

Ing. Teddy Negrete

Página 129

%USANDO UN PROGRAMA EN SIMULINK

Ing. Teddy Negrete

Página 130

Despues de ejecutar la simulación de este programa encontramos el siguiente resultado:

Ing. Teddy Negrete

Página 131

45.

UNIDAD # 3: ECUACIONES DIFERNCIALES DE ORDEN SUPERIOR

%NÚMEROS COMPLEJOS %inicio de bloque clear clc x=asin(-2) y=log(-10) [z]=roots([1 0 0 0 0 4])

%fin de bloque

Ing. Teddy Negrete

Página 132

%RESOLUCIÓN DE EDO DE 3º ORDEN O SUPERIOR %inicio de bloque dsolve('D3y=sin(t)+Dy') %fin de bloque

46.

UNIDAD # 4*: SOLUCIONES EN SERIES DE POTENCIAS DE LAS ECUACIONES DIFERENCIALES

%SERIES NUMÉRICAS FINITAS %inicio de bloque syms n symsum(1/n^2,1,10) subs(ans) %fin de bloque %SERIES NUMÉRICAS INFINITAS %inicio de bloque syms x k s1 = symsum(1/k^2, 1, inf) s2 = symsum(x^k, k, 0, inf) pretty(s2) %fin de bloque

%SERIES DE POTENCIA – SERIES DE TAYLOR %inicio de bloque syms x taylor(exp(x)) %fin de bloque %inicio de bloque syms x taylor(exp(x),10) %fin de bloque

Ing. Teddy Negrete

Página 133

% SERIES DE TAYLOR Y DE MACKLAURIN %inicio de bloque syms x f = 1/(5 + 4*cos(x)); T = taylor(f, 8) pretty(T) %fin de bloque retorna T= (49*x^6)/131220 + (5*x^4)/1458 + (2*x^2)/81 + 1/9 6 4 2 49 x 5 x 2 x 1 ------ + ---- + ---- + 131220 1458 81 9 Tecnicamente, T es una serie de MACLAURIN, con base en el punto a=0

%APROXIMACIÓN DE LA SERIE A LA FUNCIÓN “exp(x*sin(x))” %inicio de bloque syms x g = exp(x*sin(x)) t = taylor(g, 12, 2); size(char(t)) %fin de bloque Retorna en t la generación de 12 términos no cero de la Serie de Taylor para la función g alrededor de x=2. ans = 1 99791 %inicio de bloque t = simplify(t); size(char(t)) %fin de bloque

Ing. Teddy Negrete

Página 134

Retorna ans = 1

12137

Para simplificar aún más t, utilice la función “simple” %inicio de bloque t = simple(t); size(char(t)) %fin de bloque Retorna ans = 1

6988

%APROXIMACIÓN GRÁFICA DE LA SERIE A LA FUNCIÓN %inicio de bloque xd = 1:0.05:3; yd = subs(g,x,xd); ezplot(t, [1, 3]); hold on; plot(xd, yd, 'r-.'), grid on title('Aproximación de Taylor vs. Función actual'); legend('Taylor','Funcion') %fin de bloque

Ing. Teddy Negrete

Página 135

47.

UNIDAD # 4: LA TRANSFORMADA DE LAPLACE

%TRANSFORMADA DE LAPLACE %inicio de bloque syms A s t F=int((exp(-s*t)*(A-t)),t,0,A)+int((exp(-s*t)),t,A,inf) simplify(F) pretty(F) %fin de bloque %inicio de bloque syms t a a=laplace(exp(-3*t)*t*cos(2*t)) b=simplify(a) pretty(b) %fin de bloque %ANTITRANSFORMADA DE LAPLACE %inicio de bloque syms s t r=ilaplace(s/((s^2+4)*(s^2+9))) %fin de bloque %inicio de bloque syms s t r1=ilaplace(3*s/((s^2+1)*(s^2+9))) r=inline(r1) t=pi/4 r(t) while t>sin(pi/4) >>sinh(1/4) >>sind(45) >>atan(1) >>atand(1) >>atanh(1/2) Identifique cada una de las funciones utilizadas en el ejemplo anterior. Para la simplificación de las expresiones trigonométricas utilizamos en MATLAB las funcines simple() o la función simplify() las mismas que se aplican sobre variables simbólicas.

%SIMPLIFICACIÓN TRIGONOMÉTRICA %inicio de bloque syms A B C B=(sin(A))^2+(cos(A))^2+(tan(A))^2 C=simplify(B) pretty(C) %fin de bloque

%inicio de bloque N=(sin(120*pi/180))^2-3*(cos(210*pi/180))^2 D=5*(tan(315*pi/180))^2+cot(135*pi/180) R=N/D format rat R format short %fin de bloque

Ing. Teddy Negrete

Página 147

%inicio de bloque syms x a b a=((cos(x))^2-(sin(x))^2)/(cos(3*x)-sin(x)) b=simplify(a) pretty(b) %fin de bloque

%inicio de bloque syms x a b a=((cos(x))^2-(sin(x))^2)/(cos(3*x)+cos(x)) b=simplify(a) pretty(b) %fin de bloque

%inicio de bloque syms x a b a=((cos(x))^2-(sin(x))^2)/(cos(3*x)+2*(cos(x))^3) b=simplify(a) pretty(b) %fin de bloque %inicio de bloque syms x a b a=(sin(x)+sin(3*x))/(cos(x)+cos(3*x)) b=simplify(a) pretty(b) %fin de bloque %inicio de bloque f=inline('((cos(x))^2-(sin(x))^2)/(cos(3*x)-sin(x))') fa=inline('2*csc(x)') fb=inline('2*sin(x)') fc=inline('2*cos(x)') fd=inline('2*cot(x)') fe=inline('2*sec(x)') x=pi/3 f(x) fa(x),fb(x),fc(x),fd(x),fe(x) %fin de bloque

Ing. Teddy Negrete

Página 148

%GRÁFICOS DE LAS FUNCIONES TRIGONOMÉTRICAS %inicio de bloque clc clear all subplot(2,3,1) ezplot('sin(x)') subplot(2,3,2) ezplot('cos(x)') subplot(2,3,3) ezplot('tan(x)') subplot(2,3,4) ezplot('cot(x)') subplot(2,3,5) ezplot('sec(x)') subplot(2,3,6) ezplot('csc(x)') %fin de bloque %inicio de bloque ezplot('atan(x)') %fin de bloque %FUNCIÓN PERÍODICA DEFINICIÓN Y GRÁFICOS %inicio de bloque f=inline('sin(t)') x=0:pi/100:pi y=f(x) plot(x,y) %fin de bloque %inicio de bloque %Función Periódica % clc clear all x=-1:.1:1 y=x.*(1-x) for n=-3:3 t=x+n*2

Ing. Teddy Negrete

Página 149

plot(t,y) hold on end grid hold off %fin de bloque %inicio de bloque t=-1:.1:1 f=dirac(t) plot(t,f) %fin de bloque %inicio de bloque t=-1:.1:1 f=heaviside(t) plot(t,f,'b+','linewidth',4) %fin de bloque %inicio de bloque t=-1:.1:1 f=sign(t) plot(t,f,'b+','linewidth',4) %fin de bloque %inicio de bloque t=-1:.1:1 f=rectpuls(t) plot(t,f,'b+','linewidth',4) t=-1:.1:1 g=rectpuls(t) %f=int(g,-inf,inf) plot(t,f,'b+','linewidth',4) %fin de bloque

%inicio de bloque t=-2*pi:.1:2*pi f=sinc(t) plot(t,f,'b+','linewidth',4) %fin de bloque

Ing. Teddy Negrete

Página 150

%AUTOR: TEDDY NEGRETE ============= EJEMPLO DE SCRIP (*.m) EN MATLAB PARA GENERAR ========== ============= LA SERIE DE FOURIER DE UNA FUNCIÓN PERIÓDICA ===========

%DADA LA FUNCIÓN PERÍODICA: Y=1, 018) disp('SI es mayor de edad') end %fin de bloque %inicio de bloque %CONDICIONAL: SI .. SINO clear all x=input('ingrese un número entero, del 1 al 10: '); if(x>=5) disp('es mayor o igual que 5') else disp('es menor que 5') end %fin de bloque %inicio de bloque %CONDICIONAL: SI ANIDADO clear all x=input('ingrese una hora desde las 7h00 hasta las 22h00: '); if x>=7 & x=12 & x=18 & x” y escriba saludo, es decir: >>saludo se ejecutará el programa que guardo en el archivo saludo.m Regresemos al archivo pendiente de corregir, el archivo número 14 (funciones.m) ahora ejecutemos el segundo bloque, note que ahora NO se presenta error, en la función saludo. Si ejecuta el tercer bloque, notará que presenta un error en la función saludos. El error que se muestra es: “??? Undefined command/function 'saludos'.”

Función creada por el usuario: saludos() 29. Cree un nuevo archivo llamado saludos.m que será la función creada por el usuario, guárdelo en “unidad:\matlab_root\work” : % %Formato: saludos(número_ingresado) % %Esta es una función que “Saluda” tal que al ingresar un número %entero positivo o negativo, presentará por pantalla el mensaje %"hola" repetido tantas veces como sea el módulo número, es decir %abs(número_ingresado) % % function y=saludos(x) i=1; Ing. Teddy Negrete

Página 215

for i=1:1:abs(x) disp('hola') end % % NOTA IMPORTANTE: Recuerde que este archivo no se ejecuta como los demas *.m, es decir con [F9], lo debe ejecutar en el prompt (en la línea de comandos), o en una línea de otro archivo *.m. Vaya al “Window command”, en la línea de comandos “>>” y escriba saludos, es decir: >>saludos se ejecutará el programa que guardo en el archivo saludos.m, pero ahora se presentará el error “??? Input argument "x" is undefined.”, esto se debe al formato de la función saludos(), esta necesita un argumento para que se ejecute correctamente.

Ahora en el prompt escriba saludos(10), note que se muestran 10 mensajes de saludos ‘hola’, la ejecución ahora es correcta. Regresemos al archivo pendiente de corregir, el archivo número 14 (funciones.m) ahora ejecutemos el tercer bloque, note que ahora NO se presenta error, en la función saludos. 30. Elabore un programa que contenga 3 números A, B y C correspondientes a los coeficientes de una Ecuación Cuadrática y que muestre por pantalla las soluciones llamadas R1 y R2, verifique que se guarde en la carpeta personal con el nombre raices.m, ejecútelo varias veces con diferentes valores de A, B, C y compruebe sus resultados. %inicio de bloque A=1 B=-2 C=1 % disp('las raices son: ') R1=(-B-sqrt(B^2-4*A*C))/(2*A) R2=(-B+sqrt(B^2-4*A*C))/(2*A) %fin de bloque Note que para hallar los resultado para diferentes ecuaciones debemos modificar continuamente 3 líneas del programa, lo cual no es muy práctico. Ahora vamos a crear una función y la ejecutaremos varias veces, desde el PROMPT. Función creada por el usuario: raices2

Ing. Teddy Negrete

Página 216

31. Cree un nuevo archivo llamado raices2.m que será la función creada por el usuario, guárdelo en “unidad:\matlab_root\work” : Función: raices2 Cree otro archivo llamado raices2.m que será la función creada: % %Formato: raices2(a,b,c) % % %Permite hallar las raíces complejas de una ecuación %cuadrática, si ingresamos los coeficientes a, b, c % function [r1 r2]=raices2(a,b,c) disp('las raices son: ') r1=(-b-sqrt(b^2-4*a*c))/(2*a); r2=(-b+sqrt(b^2-4*a*c))/(2*a);

Vaya al “Window command”, en la línea de comandos “>>”, es decir el PROMPT y escriba raices2(1, –2 , 1), se ejecutará la función y se obtendrán los resultados de la ecuación cuadrática.

Es posible que el usuario no conozca esta función entonces puede escribir en el PROMPT, >>help raices2 y recibirá una guía de su uso, usted debe documentar y explicar en forma clara y concreta su ejecución y su formato.

Otra forma de ejecutar la función raices2, es desde un archivo tipo script *.m. Agregue el siguiente bloque de instrucciones al archivo # 17, llamado raices.m, ejecútelo varias veces y comente su funcionamiento.

%inicio de bloque %Ejecución pidiendo los argumentos o parámetros %Se presentan por pantalla los resultados disp('Ingrese los coeficientes de una Ecuación Cuadrática') A=input('Ingrese el coeficiente cuadrático a: '); B=input('Ingrese el coeficiente lineal b: '); C=input('Ingrese el término independiente c: '); raices2(A,B,C) %fin de bloque

Ing. Teddy Negrete

Página 217

32. Elabore un programa que ingrese los coeficientes A, B, C de una Ecuación Cuadrática, muestre la SUMA y el PRODUCTO de las raíces R1 y R2 utilizando la función raices2.m, verifique que se guarde en la carpeta personal con el nombre suma_producto.m Compare estos resultados con las fórmulas matemáticas x1+x2 =–b/a y x1*x2=c/a %inicio de bloque %Se fija el ingreso de los argumentos o parámetros %Pero también pueden guardarse los resultados en variables %Se presentan por pantalla los resultados de SUMA Y PRODUCTO clear all A=3 B=2 C=-1 [x1,x2]=raices2(A,B,C) disp('La SUMA de las raíces son: ') x1+x2 disp('El PRODUCTO de las raíces son: ') x1*x2 %fin de bloque

Recordemos que MATLAB tiene una función muy útil que calcula las raices de un polinomio, es decir que calcula las soluciones de una Ecuación Polinómica llamada roots. La Ecuación Cuadrática es el equivalente de la Ecuación Polinómica de 2º Grado. Hay una función asociada a este calculo pero se aplica a número reales, esta función es nthroot %inicio de bloque %Función polinómica de MATLAB %A, B, C son los coeficientes de la Ecuación Cuadrática A=1,B=-2,C=1 roots([A B C]) %fin de bloque %inicio de bloque %Raíz cuadrada de 49 nthroot(49,2) % %Raíz cuarta de 81 nthroot(81,4) %fin de bloque

Ing. Teddy Negrete

Página 218

92.

OPERACIONES CON ARREGLOS

ARREGLOS (Vectores, Matrices, Hiper-matrices) EN MATLAB MATLAB trabaja esencialmente con matrices de números reales o complejos. Las matrices 1x1 son interpretadas como escalares y las matrices fila o columna como vectores. Por defecto todas las variables son matriciales y nos podemos referir a un elemento con dos índices. Aún así, conviene saber que la matriz está guardada por columnas y que nos podemos referir a un elemento empleando sólo un índice, siempre que contemos por columnas. Insistiremos bastante en este detalle, porque tiene fuertes implicaciones para entender el funcionamiento de bastantes aspectos de MATLAB.

33. Elabore otro archivo, verifique que se guarde en la carpeta personal con el nombre arreglos.m, comente las líneas de la estructura, explicando el significado de la ejecución y concluya en forma general por cada bloque:

%VECTORES EN MATLAB %inicio de bloque x=[2 4 6 8]; y=[1;2;3;4]; z=x' x(1) y(4) z(3) %fin de bloque %ESPACIAMIENTO LINEAL %inicio de bloque x=0:0.1:1 y=0:10 linspace(0,1) %fin de bloque

Ing. Teddy Negrete

Página 219

%inicio de bloque a=-1 b=4 n=50 u=linspace(a,b,n) % v=linspace(0,1,11) % %fin de bloque %ESPACIAMIENTO LOGARÍTMICO %inicio de bloque % logspace(-1,2) % %fin de bloque %inicio de bloque d1=-2.3 d2=2.1 n=30 x=logspace(d1,d2,n) % y=logspace(-1,2,35) %fin de bloque

%ELEMENTOS DE UN VECTOR %inicio de bloque %Un vector puede ser descompuesto en cada uno de sus elementos: clear all x=[1 2 3] a=x(1,1) b=x(1,2) c=x(1,3) d=a+b+c y(1,1)=a+2 y(1,2)=b*3

Ing. Teddy Negrete

Página 220

y(1,3)=c/3 y figure(1), plot(x,y), grid title('Gráfico') %fin de bloque

WORKSPACE BROWSER Y ARRAY EDITOR El espacio de trabajo de MATLAB (Workspace) es el conjunto de variables y de funciones de usuario que en un determinado momento están definidas en la memoria del programa o de la función que se está ejecutando. Para obtener información sobre el Workspace desde la línea de comandos se pueden utilizar los comandos who y whos. El segundo commando proporciona una información más detallada que el primero. Por ejemplo, una salida típica del comando whos es la siguiente:

%EXPLORADOR DEL ESPACIO-TRABAJO Y EDITOR DE ARREGLOS %inicio de bloque clear all Ma=zeros(3,3) Mb=ones(2,2) Mc=rand(2,3) whos %fin de bloque

Éstas son las variables del espacio de trabajo base (el de la línea de comandos de MATLAB). Más adelante se verá que cada función tiene su propio espacio de trabajo, con variables cuyos nombres no interfieren con las variables de los otros espacios de trabajo. Verifique que la ventana Current Directory este activa, sino haga clic en la Barra de Título de esta ventana, fíjese que en la Barra de Estado se visualicen 2 pestañas (Current Directory / Workspace), sino haga clic en el Menú Desktop (de la Barra de Menús de MATLAB) y luego un clic en la opción Workspace. En esta ventana visualizará las variables Ma, Mb y Mc, haga un doble clic en cada una de las variables, observará que aparece a la derecha el Array Editor (Editor de Arreglos). La ventana Workspace constituye un entorno gráfico para ver las variables definidas en el espacio de trabajo.

Ing. Teddy Negrete

Página 221

La Figura No. 3 muestra el aspecto inicial de la ventana Workspace cuando se ejecuta una variable o se abre un archivo desde un determinado programa. Haciendo doble clic por ejemplo, sobre la matriz Mc aparece una nueva ventana (o pestaña, si la ventana ya existía) del Array Editor, en la que se muestra el contenido de la variable (matriz Mc), nótese que pueden ser modificados los elementos de dicha matriz o de una variable cualquiera que sea editada con este programa (Array Editor). Si se desean examinar otras matrices y/o vectores, al hacer doble clic sobre ellas en el Array Editor, las muestra en la misma ventana como sub-ventanas con una pestaña diferente. Clicando con el botón derecho sobre alguna de las variables del Workspace Browser se abre un menú contextual que ofrece algunas posibilidades interesantes, como por ejemplo, la de representar gráficamente dicha variable.

Figura No3.

El Array Editor no sólo permite ver los valores de los elementos de cualquier matriz o vector definido en el programa: es también posible modificar estos valores clicando sobre la celda correspondiente. La ventana del Array Editor incluye una lista desplegable en la que se puede elegir el formato en el que se desea ver los datos.

Ing. Teddy Negrete

Página 222

%ARREGLOS EN MATLAB %inicio de bloque Mg=[1 2 3 ; 4 5 6] Mh=[1 2 3 456 7 8 9] Mi=Mg-2 Mj=2*Mg-1 %fin de bloque

%inicio de bloque Mx=[1 4 5; 3 1 6] My=[1 2 3; 4 5 6] Mz=My.*Mx Mu=My*Mx Mv=Mg*Mx' %fin de bloque

%Multiplicación termino a termino de matrices %Error de producto de matrices %Si se cumple la condición para el producto de matrices

%inicio de bloque %Genere una Matriz de 3x3 %Guarde los valores de la diagonal en un vector clear all Ma=rand(3,3) for (i=1:1:3) Vd(1,i)=Ma(i,i); end Vd %fin de bloque

%inicio de bloque %Genere una matriz de 3x3, reemplace la 2 fila por ceros clear all Ma=rand(3,3) Ma(2,:)=0 %fin de bloque

Ing. Teddy Negrete

Página 223

%inicio de bloque %Genere una matriz de 3x3, reemplace la 3 columna por unos clear all Ma=rand(3,3) Ma(:,3)=1 %fin de bloque %inicio de bloque clear all A=[1 2 3; 4 5 6; 7 8 9] B=A C=B(2:3,1:2) % B(:,2)=[] B=A B(1,:)=[]

%C es la Menor (1,3) de B %Reducción de una Matriz %Se ha eliminado la 2ª columna %Reducción de una Matriz %Se ha eliminado la 1ª fila

% D=B(:) % E=A(:) F=A(1,:) G=A(:)' %Cálculo del Determinante det(C) % det(G) %¿Por qué se produce error? % %fin de bloque %inicio de bloque %Generación por el MANEJO DE ÍNDICES clear all for (i=1:1:5) for(j=1:5) Ma(i,j)=i*j end end

Ing. Teddy Negrete

Página 224

Ma %fin de bloque %inicio de bloque %Generación por el PRODUCTO DE INTERVALOS % Mb=(5:-1:1)'*(5:-1:1) % %fin de bloque NOTA: Generalmente cuando se trabaja con arreglos complejos se presentan cada uno de los elementos en forma rectangular, aunque se pueden definir y operar arreglos complejos con elementos en forma exponencial. %ARREGLOS CON NÚMEROS COMPLEJOS

%inicio de bloque clear all a=-1:2 Va=a+i*a b=-2:1 Vb=b+i*b Vc=(a+i*a)' Mab=Vc*Vb m=det(Mab) %fin de bloque

%inicio de bloque format short g clear all a=-1:2 Va=3*a+i*a b=-2:1 Vb=b-i*2*b Vc=Va' Mab=Vc*Vb+2*i mab=det(Mab) %fin de bloque

Ing. Teddy Negrete

Página 225

%inicio de bloque format short clear all Mx=10*rand(3,3) My=10*rand(3,3) Mz=Mx+i*My Mi=int8(Mz) mz=det(Mz) re=real(mz) im=imag(mz) modu=abs(mz) z1=int8(mz) %¿Es correcto este valor? z2=int16(mz) % det(Mi) %¿Por qué se produce error? % %fin de bloque %inicio de bloque format short g clear all Mx=[5*exp(i*pi/4) 2*exp(i*2*pi/3) ; -3*exp(i*pi/6) 2*exp(i*7*pi/6)] My=[1 i -7*exp(i*5*pi/4) 9*exp(i*4*pi/3) ; 0 0 2-i 4*exp(i*5*pi/6)] Mu=Mx*My Mv=My*Mx %¿Por qué se muestra error? %fin de bloque %DIMENSIÓN Y LONGITUD DE UN ARREGLO %inicio de bloque clear all Vv=1:10 dimension=size(Vv) longitud=length(Vv) %fin de bloque

Ing. Teddy Negrete

Página 226

%inicio de bloque clear all Mm=magic(3) dimension=size(Mm) longitud=length(Mm) %fin de bloque %inicio de bloque format short clear all Mn=rand(4,7) dimension=size(Mn) longitud=length(Mn) %fin de bloque OPERACIONES ARITMETICAS CON ARREGLOS Recordemos las operaciones básicas: SUMA, DIFERENCIA, PRODUCTO MATRICIAL, PRODUCTO ELEMENTO A ELEMENTO (como producto escalar), DIVISIÓN POR LA DERECHA Y POR LA IZQUIERDA. Es importante que recordemos y entendamos las reglas dimensionales que rigen estas operaciones aritméticas en MATLAB. SUMA Y DIFERENCIA MATRICIAL: Al sumar un arreglo a un escalar, a este último MATLAB lo convierte en un arreglo con la misma dimensión del arreglo que va a sumar o restar. %inicio de bloque clc clear all Ma=rand(2,5) Mb=Ma+3 Mc=3-Ma Md=Mb+Mc %fin de bloque

Ing. Teddy Negrete

Página 227

PRODUCTO MATRICIAL: Lo conocemos muy bien y conocemos la regla dimensional. Es la misma regla aprendida por el Álgebra Básica. %inicio de bloque %ARREGLOS CUADRADOS % clc clear all Ma=rand(3,3) Mb=magic(3) Mc=Ma*Mb Md=Mb*Ma %fin de bloque %inicio de bloque %ARREGLOS NO CUADRADOS (RECTANGULARES) % clear all Ma=ones(2,4) Mb=1:4 Mc=Mb' Md=Ma*Mc Me=Mb*Mc % Mf=Mb*Ma %¿Por qué se produce error? %fin de bloque

PRODUCTO ELEMENTO A ELEMENTO DEL ARREGLO: (Como si fuera la suma de matrices, pero en su lugar es un producto escalar) Este producto NO se aplica en el Álgebra Básica. Este producto se aplica entre arreglos de la misma dimensión. El resultado se obtiene multiplicando uno a uno los elementos de los arreglos. El arreglo resultante tiene la misma dimensión de los arreglos. En MATLAB se utiliza el operador “.*”

Ing. Teddy Negrete

Página 228

%inicio de bloque % clc clear all Ma=3*ones(2,3) Mb=5*ones(2,3) Mc=Ma.*Mb % Md=Ma*Mb' Me=Ma'*Mb % Mf=Ma*Mb %¿Por qué se produce error? % %fin de bloque

DIVISIÓN MATRICIAL: POR LA DERECHA Y POR LA IZQUIERDA. Son reglas especiales aplicadas en MATLAB: Considerando, matrices cuadradas A*inv(B)=A/B inv(A)*B=A\B

La regla del producto: A(m,n)*B(n,p)=C(m,p) Condición: ÍNDICES CENTRALES IGUALES Dimensión del resultado: ÍNDICES DE LOS EXTREMOS.

REGLA DIMENSIONAL: División DERECHA (matrix right division) A/B = mrdivide(A,B) A(m,n) / B(p,n) = C(m,p) Condición: ÍNDICE DERECHA IGUALES #COLUMNAS(A) = #COLUMNAS(B) Dimensión del RESULTADO: #FILAS(A) X #FILAS(B)

Ing. Teddy Negrete

Página 229

REGLA DIMENSIONAL: División IZQUIERDA (matrix left division) A\B = mldivide(A,B) A(m,n) \ B(m,p) = C(n,p) Condición: ÍNDICE IZQUIERDA IGUALES #FILAS(A) = #FILAS(B) Dimensión del RESULTADO: #COLUMNAS(A) X #COLUMNAS(B) %ARREGLOS CUADRADOS %Considerando la división una operación impráctica, usamos la %matriz IDENTIDAD, para que sea el divisor de la operación

%inicio de bloque % clear all Ma=[2 -2;3 1] Mb=inv(Ma) Mi=Ma*Mb Mc=Ma/Mi % Md=Ma-Mc % %fin de bloque

%inicio de bloque % clear all Ma=[4 -1;2 5] Mb=inv(Ma) Mi=Ma*Mb Mc=Mi\Ma % Md=Ma-Mc % %fin de bloque

Ing. Teddy Negrete

Página 230

%inicio de bloque %Podemos usar funciones definidas en MATLAB %DIVISIÓN POR LA DERECHA Y POR LA IZQUIERDA %mldivide(A,B) A\B %mrdivide(B,A) B/A %fin de bloque

%MATRICES CUADRADAS (la misma dimensión) %inicio de bloque clear all Ma=[1 2;3 4] Mb=[5 6;7 8] Mc=Ma/Mb Md=Ma*inv(Mb) Mdd=mrdivide(Ma,Mb) Me=Ma\Mb Mf=(inv(Ma))*Mb Mg=inv(Ma)*Mb Mgg=mldivide(Ma,Mb) %fin de bloque %ARREGLOS NO CUADRADOS (RECTANGULARES) %Aunque no comprobemos los resultados numéricos que se %obtienen al realizar las estas operaciones, comprobaremos %las REGLAS DIMENSIONALES que se establecen %inicio de bloque clear all Ma=rand(3,2) Mb=rand(4,2) Mc=Ma/Mb Md=Mb/Ma Me=Ma*Mb %¿Por qué se produce error? %fin de bloque

Ing. Teddy Negrete

Página 231

%inicio de bloque % clear all Ma=rand(2,3) Mb=rand(2,4) Mc=Ma\Mb Md=Mb\Ma % Me=Ma*Mb %¿Por qué se produce error? % %fin de bloque

EJEMPLO DE APLICACIÓN: Dados 2 o más vectores concaténelos para formar una matriz. Preséntela en forma horizontal o vertical. %inicio de bloque % %los vectores A=[1 2 3 4] B=[4 5 6 2] C=[7 8 9 1] % %la matriz horizontal D=[A;B;C] % %la matriz vertical E=D' % %fin de bloque

Ing. Teddy Negrete

Página 232

FUNCIONES BÁSICAS DE LOS ARREGLOS: Las siguientes funciones sólo actúan sobre vectores (no sobre matrices, ni sobre escalares): [xm,im]=max(x) %máximo elemento de un vector. %Devuelve el valor máximo xm y la posición que ocupa im

[xm,im]=min(x) %mínimo elemento de un vector. %Devuelve el valor mínimo y la posición que ocupa

sum(x) %suma de los elementos de un vector

cumsum(x) %devuelve el vector suma acumulativa de los elementos de un vector (cada elemento del resultado es una suma de elementos del original)

mean(x) %valor medio de los elementos de un vector

std(x) %desviación típica

prod(x) %producto de los elementos de un vector

cumprod(x) %devuelve el vector producto acumulativo de los elementos de un vector

Ing. Teddy Negrete

Página 233

[y,i]=sort(x) %ordenamiento de menor a mayor de los elementos de un vector x. Devuelve el vector ordenado y, y un vector i con las posiciones iniciales en x de los elementos en el vector ordenado y. En realidad estas funciones se pueden aplicar también a matrices, pero en ese caso se aplican por separado a cada columna de la matriz, dando como valor de retorno un vector resultado de aplicar la función a cada columna de la matriz considerada como vector. Si estas funciones se quieren aplicar a las filas de la matriz basta aplicar dichas funciones a la matriz traspuesta.

%FUNCIONES BÁSICAS PARA ARREGLOS %inicio de bloque % clear all A=rand(2,2) B=rand(2,2) isequal(A,B) % %fin de bloque %FILAS Y COLUMNAS DE UN ARREGLO %inicio de bloque % clear all a=[1 4 7; 3 5 8] s=size(a) filas=s(1) columnas=s(2) % [x_filas,y_columnas]=size(a) ones(size(a)) % %fin de bloque

Ing. Teddy Negrete

Página 234

%MATRICES MENORES DE OTROS ARREGLOS %inicio de bloque % clear all A=[1 4 7 5;3 5 8 6;7 8 5 6;0 8 45 78] B=A(1:3,2:4) %B es la menor de A que se forma: %Tomando los elementos desde la 1ªfila hasta la 3ªfila %y los elementos desde la 2ªcolumna hasta la 4ªcolumna % A=[1 4 7 5;3 5 8 6;7 8 5 6;0 8 45 78] C=A(2:3,3:4) %C es la menor de A que se forma: %Tomando los elementos desde la 2ªfila hasta la 3ªfila %y los elementos desde la 3ªcolumna hasta la 4ªcolumna % A=[1 4 7 5;3 5 8 6;7 8 5 6;0 8 45 78] D=A(:,3:3) % %Explique ¿Cómo se forma D? % A=[1 4 7 5;3 5 8 6;7 8 5 6;0 8 45 78] E=[A(:,1) A(:,2)] % %Explique ¿Cómo se forma E? % %fin de bloque %INVERSIÓN POSICIONAL DE ARREGLOS %inicio de bloque % %De arriba a bajo %De izquierda a derecha % clear all A=[1 4 7 5;3 5 8 6;7 8 5 6;0 8 45 78] B=flipud(A) %invierte verticalmente una matriz %

Ing. Teddy Negrete

Página 235

A=[1 4 7 5;3 5 8 6;7 8 5 6;0 8 45 78] C=fliplr(A) %invierte horizontalmente una matriz % %fin de bloque %inicio de bloque clear all A=[1 4 7 5;3 5 8 6;7 8 5 6;0 8 45 78] B=flipud(A') C=fliplr(B) %Explique ¿Cómo se forma B y C? %fin de bloque %inicio de bloque clear all a=[1 4 7 5;3 5 8 6;7 8 5 6;0 8 45 78] b=a b(:,2)=0 c=b c(:,:)=0 columna3_matriz_a=a(:,3) columna3_matriz_a(1) flipud(columna3_matriz_a) % %fin de bloque %OPERACIONES CON RESULTADOS ESCALARES EN ARREGLOS %inicio de bloque % clear all B=[1 2 3;4 5 6;7 8 9] C=B(2:3,1:2) B(:,2)=[ ] D=B(:) length(D) size(D) % %fin de bloque

Ing. Teddy Negrete

Página 236

%OPERACIONES CON RESULTADOS LÓGICOS EN ARREGLOS %inicio de bloque % A=[1 2 3;4 5 6;7 8 9] %B=[1 2 3;4 5 6;7 8 9] B=[1 5 7;4 9 6;3 2 1] resul_compara=isequal(A,B) ismember(A,B) % %fin de bloque

%OPERACIONES DE BUSQUEDA EN ARREGLOS %inicio de bloque A=magic(3) indices=find(A>5) %Si se convierte la matriz A[3x3] en un vector vertical A[9x1] %equivalente al uso del comando A(:), luego find encontrará %los índices del vector que satisfacen la condición. %fin de bloque Hipermatrices (arrays de más de dos dimensiones) MATLAB permite trabajar con hipermatrices, es decir con matrices de más de dos dimensiones (Figura No. 4). Una posible aplicación es almacenar con un único nombre distintas matrices del mismo tamaño (resulta una hipermatriz de 3 dimensiones). Los elementos de una hipermatriz pueden ser números, caracteres, estructuras, y vectores o matrices de celdas. El tercer subíndice representa la tercera dimensión: la “profundidad” de la hipermatriz. DEFINICIÓN DE HIPERMATRICES. Las funciones para trabajar con estas hipermatrices están en el sub-directorio toolbox\matlab\datatypes. Las funciones que operan con matrices de más de dos dimensiones son análogas a las funciones vistas previamente, aunque con algunas diferencias. Por ejemplo, las siguientes sentencias generan, en dos pasos, una matriz de 2×3×2: Ejecute en la LÍNEA DE COMANDOS:

Ing. Teddy Negrete

Página 237

>> AA(:,:,1)=[1 2 3; 4 5 6] % matriz inicial AA = 123 456 >> AA(:,:,2)=[2 3 4; 5 6 7] % se añade una segunda matriz AA(:,:,1) = 123 456 AA(:,:,2) = 234 567 FUNCIONES QUE TRABAJAN CON HIPERMATRICES. Algunas funciones de MATLAB para generar matrices admiten más de dos subíndices y pueden ser utilizadas para generar hipermatrices. Entre ellas están rand(), randn(), zeros() y ones(). Por ejemplo, véase la siguiente sentencia y su resultado:

Ejecute en la LÍNEA DE COMANDOS: >> BB=randn(2,3,2) BB(:,:,1) = -0.4326 0.1253 -1.1465 -1.6656 0.2877 1.1909 BB(:,:,2) = 1.1892 0.3273 -0.1867 -0.0376 0.1746 0.7258

La función cat() permite concatenar matrices según las distintas “dimensiones”, como puede verse en el siguiente ejemplo: >> A=zeros(2,3); B=ones(2,3); i j k A(i,j,k)

Ing. Teddy Negrete

Página 238

Figura No. 4. Hipermatriz de tres dimensiones.

Figura No. 4

93.

INTRODUCCIÓN AL SIMULINK

Simulink es una herramienta interactiva para modelar, simular, y analizar dinámicamente, sistemas del multidominio. (del tiempo, la frecuencia, la posición, la energía, etc.) Le permite con precisión describir, simular, evaluar, y definir el comportamiento de un sistema, a través de un bloque de bibliotecas tradicionales y normalizadas. Los modelos (*.mdl de Simulink) tienen acceso listo a MATLAB, proporcionándole un flexible funcionamiento y un extenso rango de herramientas de análisis y diseño.

Ing. Teddy Negrete

Página 239

En pocas palabras, es un simulador integrado al MATLAB, que tiene bibliotecas normalizadas que se aplican principalmente en Ingeniería.

Figura No.1: Acceso al Simulink Library Browser

Desde el botón START, puede cargar SIMULINK, y lo primero que veremos es el explorador de las librerias para una amplia gama de áreas del conocimiento.

Simulink proporciona un entorno donde usted modela a su sistema físico y lo controla con un diagrama del bloque. Usted crea el diagrama del bloque usando el ratón para arrastrar y conectar los bloques y el teclado para editar y escribir parámetros del bloque.

Ing. Teddy Negrete

Página 240

Al dar un clic en el botón “Simulink” de la ventana principal de MATLAB obtenemos la ventana “Simulink Library Browser” que es el explorador de las Librerías de SIMULINK. Sin embargo podemos llegar al mismo explorador desde MATLAB ejecutando el comando simulink en el prompt de Command Window. Note que un resultado equivalente tendremos por el botón START, siguiendo la vía Start/Simulink/Library Browser.

Figura No.2: Librerías de Simulink

En la Figura No. 3 recordemos, el entorno gráfico de la ventana principal del programa Matlab desde donde se accede al programa Simulink de varias formas; en el menú ‘File’ (marcado en la figura como ‘Archivo’) se desprende un listado de opciones donde en la opción ‘New’ se debe elegir la sub-opción ‘Model ’, inmediatamente se abrirá otra ventana correspondiente a la Figura No. 4, la cual es la ventana principal del programa Simulink.

Ing. Teddy Negrete

Página 241

Figura No.3 Escritorio de MATLAB

Por otro lado también se puede acceder a dicho programa mediante la librería de Simulink seleccionando el icono marcado en la Figura No. 3 como ‘Librería de simulink’, se abre una ventana que corresponde a la Figura No. 4, y desde esa ventana se debe seleccionar el menú ‘Archivo’, la opción ‘New’ y sub-opción ‘Model ’, o bien pinchar directamente el icono que representa una página en blanco que se marca en la Figura No. 5 como ‘Nuevo modelo’.

Una vez que se llega al programa Simulink es importante tener claro cuales son las opciones más importantes para realizar correctamente las simulaciones.

Ing. Teddy Negrete

Página 242

La Figura No. 4 muestra la ventana principal de Simulink. En esta ventana se encuentra el icono marcado como ‘Librería de Simulink’. Haciendo clic en esta opción se abre la librería (Figura No. 5) donde se encuentran los bloques que permiten crear cualquier tipo de modelo o controlador que se desee simular.

También son importantes las opciones marcadas como ‘Activar simulación’, ‘Parar simulación’ y ‘Tiempo de simulación’ que permiten comenzar a simular cualquier archivo Simulinkr creado en esa misma ventana, parar esa simulación en cualquier momento o bien cambiar el tiempo que se desea simular correspondientemente.

Figura No.4: Ventana principal de Simulink o Editor de Simulink.

Ing. Teddy Negrete

Página 243

Debe ser aclarado que simular un sistema significa resolver unas ecuaciones que describen un sistema real o un controlador durante un periodo de tiempo, por lo que el tiempo de simulación es el periodo total de tiempo para el cual el programa resuelve las ecuaciones, siendo por lo tanto un parámetro que debe ser elegido adecuadamente para poder analizar y representar correctamente los resultados simulados.

Por otro lado la opción marcada como ‘Parámetros de simulación’ en la Figura No. 4 abre una ventana más completa donde es posible configurar parámetros más avanzados y mejorar los resultados de las simulaciones. Los parámetros básicos de la configuración de las simulaciones serán explicados detalladamente en capítulos posteriores.

Las opciones marcadas como ‘Porcentaje simulación’ y ‘Método de integración’ informan durante la simulación del sistema, en concreto de cuanto porcentaje de la simulación ha sido realizada y el métodon de integración seleccionado previamente en las opciones de la simulación.

Ing. Teddy Negrete

Página 244

Figura No.5: Explorador de Librerias de Simulink

LIBRERIAS DE SIMULINK La Figura No. 5 muestra el Explorador de las librerías de Simulink donde se encuentran los bloques que se utilizan para crear los archivos de Simulink. Como se ha comentado anteriormente desde esta librería se pueden abrir archivos Simulink y también crear nuevos archivos mediante las opciones marcadas como ‘Archivo’ y ‘Nuevo modelo’.

Ing. Teddy Negrete

Página 245

Cada uno de los bloques, algunos de los cuales serán detallados posteriormente, tienen referenciado un nombre para poder ser buscados de forma más rápida a través de la casilla marcada en la Figura No. 5 como ‘Búsqueda de bloques’, donde escribiendo el nombre y haciendo clic en el icono que representa unos binoculares se realiza la búsqueda del bloque que tenga el nombre especificado entre todos los ‘toolboxes’. Los resultados de la búsqueda se mostrarán en la sub-ventana marcada en la Figura No. 5 como ‘Listado bloques’.

En la sub-ventana marcada como ‘Libraries’ se encuentran listados todos los ‘toolboxes’, Cajas de Herramientas de Simulink disponibles para la versión instalada de Matlab. Si se hace clic en cada herramienta o ‘toolbox’ se desplegará en la sub-ventana ‘Listado de bloques’ los bloques que están dentro de ese ‘toolbox’ y que podrán ser utilizados para crear archivos de Simulink. Por último remarcar que la sub-ventana ‘Descripción de bloques’ describe los bloques que se marquen en la sub-ventana ‘Listado bloques’ y será de ayuda para entender el funcionamiento de estos mismos, describiendo la funcionalidad, las entradas y las salidas.

Las opciones ‘Help’ que aparecen en cada una de las ventanas descritas en este capítulo son de gran ayuda para profundizar en la programación de Simulink. Todas las ventanas mostradas en las figuras han sido obtenidas de la versión Matlab/Simulink 7.1, puede que difieran un poco con otras versiones pero la mayoría de las opciones pueden ser encontradas con la misma apariencia.

En Simulink se han clasificado los bloques de acuerdo con las definiciones tradicionales de las funciones y del tipo de variables que se van analizar o modelar. A continuación se presentan las Librerías de Simulink, que incluyen algunos bloques que estudiaremos y analizaremos en los siguientes ejemplos.

Ing. Teddy Negrete

Página 246

LIBRERIAS SISTEMAS LINEALES EN EL TIEMPO CONTINUO OPERACIONES MATEMÁTICAS

FUENTES

RUTAS DE SEÑALES

SUMIDERO (A LA SALIDA)

BLOQUES DERIVADOR INTEGRADOR FUNCIÓN DE TRANSFERENCIA SUMA PRODUCTO FUNCIONES CONSTANTE ESCALON RAMPA SINUSOIDAL MUX MANUAL DEMULTIPLEXOR MULTIPLEXOR ALCANCE PANTALLA AL WORKSPACE

Figura No.6: Algunas Librerias de Simulink y sus correspondientes Bloques

Ing. Teddy Negrete

Página 247

1. Elabore otro archivo, con el nombre simulink_bloques.m, tal que documente la búsqueda (vía de la LIBRERÍA donde se encuentren) los siguientes BLOQUES de Simulink y haga una breve descripción 'Block Description' del mismo. Seleccione una sóla vía.

%BLOQUE: Resistor %VÍA: Simscape/Foundation Library/Electrical/Electrical Elemens %DESCRIPCIÓN: %BLOQUE: Flip Flop %VÍA: Simulink Extras/Flip Flops %DESCRIPCIÓN: %BLOQUE: QPSK %VÍA: Communications Blockset/Digital Baseband Modulations/PM %DESCRIPCIÓN: %BLOQUE: Histogram %VÍA: Signal Processing Blockset/Statistics %DESCRIPCIÓN: %BLOQUE: Gauss (Gaussian Filter) %VÍA: Communications Blockset/Comm Filters %DESCRIPCIÓN: %BLOQUE: FFT %VÍA: SimPowerSystems/Extra Library/Discrete Measuremensts %DESCRIPCIÓN:

2.

Elabore otro archivo, con el nombre simulink_bloques_parametro.m, tal que documente una breve descripción y al menos 2 propiedades 'Block Parameters' de uno de los bloques (a su elección, si hay más de un bloque) que se encuentra en la siguiente vía de la LIBRERÍA dada.

%1_Simulink/Continuous %Block Name %Block Parameters

%2_Simulink/Math Operations %Block Name %Block Parameters

Ing. Teddy Negrete

Página 248

%3_Simulink/Sinks %Block Name %Block Parameters

%4_Simulink/Sources %Block Name %Block Parameters

%5_Communications Blockset/Equalizers %Block Name %Block Parameters

%6_Signal Processing Blockset/Statistics %Block Name %Block Parameters

%7_SimPowerSystems/Machines %Block Name %Block Parameters

%8_SimPowerSystems/Power Electronics %Block Name %Block Parameters

%9_Simscape/SimElectronics/Sensors %Block Name %Block Parameters

%10_Simulink Extras/Transformations %Block Name %Block Parameters

Ing. Teddy Negrete

Página 249

94.

APÉNDICE

INTRODUCCIÓN GENERAL. VISIÓN GLOBAL

¿Por qué estudiar MATLAB? Es una herramienta de simulación que integra muchos campos de la ciencia y la ingeniería http://www.mathworks.com/

Cuenta en MATHWORKS

Ing. Teddy Negrete

Página 250

http://www.mathworks.com/index.html

http://www.mathworks.com/solutions/

Ing. Teddy Negrete

Página 251

http://www.mathworks.com/aerospace-defense/

http://www.mathworks.com/system-design-simulation/

Ing. Teddy Negrete

Página 252

http://www.mathworks.com/computational-biology/

95.

LISTA ALFABÉTICA DE FUNCIONES DE MATLAB

Alphabetical List Function Reference ABCDEFGHIJKLMNOPQRSTUVWXYZ Arithmetic Operators + - * / \ ^ ' Relational Operators < > = == ~= Logical Operators: Elementwise & | ~ Logical Operators: Short-circuit && || capability Special Characters [ ] ( ) {} = ' . ... , ; : % !@ colon (:) loop iterators abs accumarray acos acosd acosh acot acotd acoth acsc

Ing. Teddy Negrete

Matrix and array arithmetic Relational operations Elementwise logical operations on arrays Logical operations, with short-circuiting Special characters Create vectors, array subscripting, and forAbsolute value and complex magnitude Construct array with accumulation Inverse cosine; result in radians Inverse cosine; result in degrees Inverse hyperbolic cosine Inverse cotangent; result in radians Inverse cotangent; result in degrees Inverse hyperbolic cotangent Inverse cosecant; result in radians

Página 253

acscd acsch actxcontrol window actxcontrollist controls actxcontrolselect actxGetRunningServer server actxserver addCause (MException) addevent addframe (avifile) addlistener (handle) addOptional (inputParser) addParamValue (inputParser) Parser scheme addpath addpref addprop (dynamicprops) addproperty addRequired (inputParser) addsample addsampletocollection addtodate addts object airy align axes alim all nonzero or true allchild alpha current axes alphamap amd ancestor and angle annotation ans any nonzero area Areaseries Properties arrayfun ascii asec asecd asech asin

Ing. Teddy Negrete

Inverse cosecant; result in degrees Inverse hyperbolic cosecant Create Microsoft ActiveX control in figure List currently installed Microsoft ActiveX Create Microsoft ActiveX control from GUI Handle to running instance of Automation Create COM server Record additional causes of exception Add event to timeseries object Add frame to Audio/Video Interleaved (AVI) file Create event listener Add optional argument to Input Parser scheme Add parameter name/value argument to Input Add folders to search path Add preference Add dynamic property Add custom property to COM object Add required argument to Input Parser scheme Add data sample to timeseries object Add sample to tscollection object Modify date number by field Add timeseries object to tscollection Airy functions Align user interface controls (uicontrols) and Set or query axes alpha limits Determine whether all array elements are Find all children of specified objects Set transparency properties for objects in Specify figure alphamap (transparency) Approximate minimum degree permutation Ancestor of graphics object Find logical AND of array or scalar inputs Phase angle Create annotation objects Most recent answer Determine whether any array elements are Filled area 2-D plot Define areaseries properties Apply function to each element of array Set FTP transfer type to ASCII Inverse secant; result in radians Inverse secant; result in degrees Inverse hyperbolic secant Inverse sine; result in radians

Página 254

asind asinh assert assignin atan atan2 atand atanh audiodevinfo audioplayer audiorecorder aufinfo auread auwrite avifile aviinfo file aviread axes Axes Properties axis balance accuracy bar, barh bar3, bar3h Barseries Properties TriRep method Cartesian base2dec number beep bench besselh besseli besselj besselk bessely beta betainc betaincinv betaln bicg bicgstab bicgstabl bin2dec number binary bitand bitcmp bitget bitmax integer

Ing. Teddy Negrete

Inverse sine; result in degrees Inverse hyperbolic sine Generate error when condition is violated Assign value to variable in specified workspace Inverse tangent; result in radians Four-quadrant inverse tangent Inverse tangent; result in degrees Inverse hyperbolic tangent Information about audio device Create object for playing audio Create object for recording audio Information about NeXT/SUN (.au) sound file Read NeXT/SUN (.au) sound file Write NeXT/SUN (.au) sound file Create new Audio/Video Interleaved (AVI) file Information about Audio/Video Interleaved (AVI) Read Audio/Video Interleaved (AVI) file Create axes graphics object Modify axes properties Axis scaling and appearance Diagonal scaling to improve eigenvalue Plot bar graph (vertical and horizontal) Plot 3-D bar chart Define barseries properties baryToCart Converts point coordinates from barycentric to Convert base N number string to decimal Produce beep sound MATLAB benchmark Bessel function of third kind (Hankel function) Modified Bessel function of first kind Bessel function of first kind Modified Bessel function of second kind Bessel function of second kind Beta function Incomplete beta function Beta inverse cumulative distribution function Logarithm of beta function Biconjugate gradients method Biconjugate gradients stabilized method Biconjugate gradients stabilized (l) method Convert binary number string to decimal Set FTP transfer type to binary Bitwise AND Bitwise complement Bit at specified position Maximum double-precision floating-point

Página 255

bitor bitset bitshift bitxor blanks blkdiag arguments box break brighten brush observations in graphs bsxfun two arrays with singleton expansion enabled builddocsearchdb builtin method bvp4c differential equations bvp5c differential equations bvpget created with bvpset bvpinit bvpset value problem bvpxtend value solutions calendar calllib callSoapService camdolly cameratoolbar camlight coordinates camlookat objects camorbit campan campos camproj camroll camtarget camup camva camzoom cart2pol cylindrical cart2sph cartToBary TriRep method barycentric

Ing. Teddy Negrete

Bitwise OR Set bit at specified position Shift bits specified number of places Bitwise XOR Create string of blank characters Construct block diagonal matrix from input Axes border Terminate execution of for or while loop Brighten or darken colormap Interactively mark, delete, modify, and save Apply element-by-element binary operation to Build searchable documentation database Execute built-in function from overloaded Solve boundary value problems for ordinary Solve boundary value problems for ordinary Extract properties from options structure Form initial guess for bvp4c Create or alter options structure of boundary Form guess structure for extending boundary Calendar for specified month Call function in shared library Send SOAP message to endpoint Move camera position and target Control camera toolbar programmatically Create or move light object in camera Position camera to view object or group of Rotate camera position around camera target Rotate camera target around camera position Set or query camera position Set or query projection type Rotate camera about view axis Set or query location of camera target Set or query camera up vector Set or query camera view angle Zoom in and out on scene Transform Cartesian coordinates to polar or Transform Cartesian coordinates to spherical Convert point coordinates from cartesian to

Página 256

case cast cat catch caxis cd cd (ftp) cdf2rdf diagonal form cdfepoch formatted dates cdfinfo file cdflib capabilities cdflib.close cdflib.closeVar Common Data Format (CDF) file cdflib.computeEpoch cdflib.computeEpoch16 cdflib.create cdflib.createAttr cdflib.createVar cdflib.delete cdflib.deleteAttr cdflib.deleteAttrEntry cdflib.deleteAttrgEntry cdflib.deleteVar cdflib.deleteVarRecords cdflib.epoch16Breakdown cdflib.epochBreakdown cdflib.getAttrEntry cdflib.getAttrgEntry cdflib.getAttrMaxEntry cdflib.getAttrMaxgEntry cdflib.getAttrName cdflib.getAttrNum cdflib.getAttrScope cdflib.getCacheSize cdflib.getChecksum cdflib.getCompression cdflib.getCompressionCacheSize cdflib.getConstantNames constants cdflib.getConstantValue Format (CDF) library constant cdflib.getCopyright (CDF) file cdflib.getFormat cdflib.getLibraryCopyright (CDF) library cdflib.getLibraryVersion

Ing. Teddy Negrete

Execute block of code if condition is true Cast variable to different data type Concatenate arrays along specified dimension Handle error detected in try-catch statement Color axis scaling Change current folder Change current directory on FTP server Convert complex diagonal form to real block Convert MATLAB formatted dates to CDF Information about Common Data Format (CDF) Summary of Common Data Format (CDF) Close Common Data Format (CDF) file Close specified variable from multifile format Convert time value to CDF_EPOCH value Convert time value to CDF_EPOCH16 value Create Common Data Format (CDF) file Create attribute Create new variable Delete existing Common Data Format (CDF) file Delete attribute Delete attribute entry Delete entry in global attribute Delete variable Delete range of records from variable Convert CDF_EPOCH16 value to time value Convert CDF_EPOCH value into time value Value of entry in attribute with variable scope Value of entry in global attribute Number of last entry for variable attribute Number of last entry for global attribute Name of attribute, given attribute number Attribute number, given attribute name Scope of attribute Number of cache buffers used Checksum mode Compression settings Number of compression cache buffers Names of Common Data Format (CDF) library Numeric value corresponding to Common Data Copyright notice in Common Data Format Format of Common Data Format (CDF) file Copyright notice of Common Data Format Library version and release information

Página 257

cdflib.getMajority cdflib.getName cdflib.getNumAttrEntries scope cdflib.getNumAttrgEntries cdflib.getNumAttributes cdflib.getNumgAttributes cdflib.getReadOnlyMode cdflib.getStageCacheSize cdflib.getValidate cdflib.getVarAllocRecords cdflib.getVarBlockingFactor cdflib.getVarCacheSize cdflib.getVarCompression variable cdflib.getVarData cdflib.getVarMaxAllocRecNum cdflib.getVarMaxWrittenRecNum cdflib.getVarName cdflib.getVarNum cdflib.getVarNumRecsWritten cdflib.getVarPadValue cdflib.getVarRecordData cdflib.getVarReservePercent cdflib.getVarSparseRecords records cdflib.getVersion and release information cdflib.hyperGetVarData cdflib.hyperPutVarData cdflib.inquire (CDF) file cdflib.inquireAttr cdflib.inquireAttrEntry scope cdflib.inquireAttrgEntry scope cdflib.inquireVar cdflib.open cdflib.putAttrEntry scope cdflib.putAttrgEntry scope cdflib.putVarData cdflib.putVarRecordData cdflib.renameAttr cdflib.renameVar cdflib.setCacheSize cdflib.setChecksum cdflib.setCompression cdflib.setCompressionCacheSize

Ing. Teddy Negrete

Majority of variables Name of Common Data Format (CDF) file Number of entries for attribute with variable Number of entries for attribute with global scope Number of attributes with variable scope Number of attributes with global scope Read-only mode Number of cache buffers for staging Library validation mode Number of records allocated for variable Blocking factor for variable Number of multifile cache buffers Information about compression used by Single value from record in variable Maximum allocated record number for variable Maximum written record number for variable Variable name, given variable number Variable number, given variable name Number of records written to variable Pad value for variable Entire record for variable Compression reserve percentage for variable Information about how variable handles sparse Common Data Format (CDF) library version Read hyperslab of data from variable Write hyperslab of data to variable Basic characteristics of Common Data Format Information about attribute Information about entry in attribute with variable Information about entry in attribute with global Information about variable Open existing Common Data Format (CDF) file Write value to entry in attribute with variable Write value to entry in attribute with global Write single value to variable Write entire record to variable Rename existing attribute Rename existing variable Specify number of dotCDF cache buffers Specify checksum mode Specify compression settings Specify number of compression cache buffers

Página 258

cdflib.setFormat file cdflib.setMajority cdflib.setReadOnlyMode cdflib.setStageCacheSize Common Data Format (CDF) file cdflib.setValidate cdflib.setVarAllocBlockRecords variable cdflib.setVarBlockingFactor cdflib.setVarCacheSize variable cdflib.setVarCompression cdflib.setVarInitialRecs variable cdflib.setVarPadValue cdflib.SetVarReservePercent cdflib.setVarsCacheSize variables cdflib.setVarSparseRecords cdfread file cdfwrite ceil cell cell2mat cell2struct celldisp cellfun cellplot cellstr cgs char checkin platforms) checkout platforms) chol cholinc Infinity factorizations cholupdate circshift TriRep method cla clabel class classdef clc clear system memory clear (serial) workspace

Ing. Teddy Negrete

Specify format of Common Data Format (CDF) Specify majority of variables Specify read-only mode Specify number of staging cache buffers for Specify library validation mode Specify range of records to be allocated for Specify blocking factor for variable Specify number of multi-file cache buffers for Specify compression settings used with variable Specify initial number of records written to Specify pad value used with variable Specify reserve percentage for variable Specify number of cache buffers used for all Specify how variable handles sparse records Read data from Common Data Format (CDF) Write data to Common Data Format (CDF) file Round toward positive infinity Construct cell array Convert cell array of matrices to single matrix Convert cell array to structure array Cell array contents Apply function to each cell in cell array Graphically display structure of cell array Create cell array of strings from character array Conjugate gradients squared method Convert to character array (string) Check files into source control system (UNIX Check files out of source control system (UNIX Cholesky factorization Sparse incomplete Cholesky and CholeskyRank 1 update to Cholesky factorization Shift array circularly circumcenters Circumcenters of specified simplices Clear current axes Contour plot elevation labels Determine class name of object Class definition keywords Clear Command Window Remove items from workspace, freeing up Remove serial port object from MATLAB

Página 259

clearvars clf clipboard clipboard clock function Tiff method close (avifile) close (ftp) closereq cmopts cmpermute cmunique grayscale or truecolor image to indexed image colamd permutation colorbar colordef color schemes colormap colormapeditor ColorSpec (Color Specification) colperm count comet comet3 commandhistory already open commandwindow open compan compass complex imaginary components computer software is running computeStrip Tiff method coordinate computeTile Tiff method coordinates cond condeig condest coneplot conj containers.Map continue loop contour contour3

Ing. Teddy Negrete

Clear variables from memory Clear current figure window Copy and paste strings to and from system Current time as date vector close Remove specified figure Close Tiff object Close Audio/Video Interleaved (AVI) file Close connection to FTP server Default figure close request function Name of source control system Rearrange colors in colormap Eliminate duplicate colors in colormap; convert Column approximate minimum degree Colorbar showing color scale Set default property values to display different Set and get current colormap Start colormap editor Color specification Sparse column permutation based on nonzero 2-D comet plot 3-D comet plot Open Command History window, or select it if Open Command Window, or select it if already Companion matrix Plot arrows emanating from origin Construct complex data from real and Information about computer on which MATLAB Index number of strip containing specified

Index number of tile containing specified Condition number with respect to inversion Condition number with respect to eigenvalues 1-norm condition number estimate Plot velocity vectors as cones in 3-D vector field Complex conjugate Construct containers.Map object Pass control to next iteration of for or while Contour plot of matrix 3-D contour plot

Página 260

contourc contourf Contourgroup Properties contourslice contrast conv conv2 DelaunayTri method convhull convhulln convn copyfile copyobj corrcoef cos cosd cosh cot cotd coth cov cplxpair pairs cputime create (RandStream) createClassFromWsdl document createCopy (inputParser) createSoapMessage cross csc cscd csch csvread csvwrite ctranspose (timeseries) cumprod cumsum cumtrapz curl field currentDirectory Tiff method customverctrl platforms) cylinder daqread daspect datacursormode cursor mode datatipinfo

Ing. Teddy Negrete

Low-level contour plot computation Filled 2-D contour plot Define contourgroup properties Draw contours in volume slice planes Grayscale colormap for contrast enhancement Convolution and polynomial multiplication 2-D convolution convexHull Convex hull Convex hull N-D convex hull N-D convolution Copy file or folder Copy graphics objects and their descendants Correlation coefficients Cosine of argument in radians Cosine of argument in degrees Hyperbolic cosine Cotangent of argument in radians Cotangent of argument in degrees Hyperbolic cotangent Covariance matrix Sort complex numbers into complex conjugate Elapsed CPU time Create random number streams Create MATLAB class based on WSDL Create copy of inputParser object Create SOAP message to send to server Vector cross product Cosecant of argument in radians Cosecant of argument in degrees Hyperbolic cosecant Read comma-separated value file Write comma-separated value file Transpose timeseries object Cumulative product Cumulative sum Cumulative trapezoidal numerical integration Compute curl and angular velocity of vector

Index of current IFD Allow custom source control system (UNIX Generate cylinder Read Data Acquisition Toolbox (.daq) file Set or query axes data aspect ratio Enable, disable, and manage interactive data Produce short description of input variable

Página 261

date datenum datestr datetick datevec dbclear dbcont dbdown dblquad rectangle dbmex dbquit dbstack dbstatus dbstep breakpoint dbstop dbtype dbup while in debug mode dde23 constant delays ddeget equations options structure ddesd general delays ddeset options structure deal deblank dec2base dec2bin dec2hex string decic ode15i deconv del2 delaunay delaunay3 delaunayn DelaunayTri class constructor delete delete (COM) delete (ftp) delete (handle) delete (serial) delete (timer)

Ing. Teddy Negrete

Current date string Convert date and time to serial date number Convert date and time to string format Date formatted tick labels Convert date and time to vector of components Clear breakpoints Resume execution Reverse workspace shift performed by dbup, while in debug mode Numerically evaluate double integral over Enable MEX-file debugging (on UNIX platforms) Quit debug mode Function call stack List all breakpoints Execute one or more lines from current Set breakpoints List text file with line numbers Shift current workspace to workspace of caller, Solve delay differential equations (DDEs) with Extract properties from delay differential Solve delay differential equations (DDEs) with Create or alter delay differential equations Distribute inputs to outputs Strip trailing blanks from end of string Convert decimal to base N number in string Convert decimal to binary number in string Convert decimal to hexadecimal number in Compute consistent initial conditions for Deconvolution and polynomial division Discrete Laplacian Delaunay triangulation 3-D Delaunay tessellation N-D Delaunay tessellation Delaunay triangulation in 2-D and 3-D Contruct Delaunay triangulation Remove files or graphics objects Remove COM control or server Remove file on FTP server Handle object destructor function Remove serial port object from memory Remove timer object from memory

Página 262

deleteproperty delevent timeseries object delsample delsamplefromcollection demo depdir depfun det detrend detrend (timeseries) time series deval problem diag dialog diary diff diffuse dir dir (ftp) disp disp (memmapfile) disp (MException) disp (serial) disp (timer) display dither resolution by dithering divergence dlmread matrix dlmwrite dmperm doc docsearch dos dot double dragrect drawnow dsearch dsearchn dynamicprops dynamic properties echo echodemo Window edgeAttachments

Ing. Teddy Negrete

Remove custom property from COM object Remove tsdata.event objects from Remove sample from timeseries object Remove sample from tscollection object Access product demos via Help browser List dependent folders for function or P-file List dependencies of function or P-file Matrix determinant Remove linear trends Subtract mean or best-fit line and all NaNs from Evaluate solution of differential equation Diagonal matrices and diagonals of matrix Create and display empty dialog box Save session to file Differences and approximate derivatives Calculate diffuse reflectance Folder listing Directory contents on FTP server Display text or array Information about memmapfile object Display MException object Serial port object summary information Information about timer object Display text or array (overloaded method) Convert image, increasing apparent color Compute divergence of vector field Read ASCII-delimited file of numeric data into Write matrix to ASCII-delimited file Dulmage-Mendelsohn decomposition Reference page in Help browser Help browser search Execute DOS command and return result Vector dot product Convert to double precision Drag rectangles with mouse Flush event queue and update figure window Search Delaunay triangulation for nearest point N-D nearest point search Abstract class used to derive handle class with Display statements during function execution Run scripted demo step-by-step in Command

Página 263

TriRep method edges TriRep method edit eig eigs ellipj ellipke kind ellipsoid else elseif true enableNETfromNetworkDrive network drive enableservice Automation server end index eomday eps eq eq (MException) erf, erfc, erfcx, erfinv, erfcinv error errorbar Errorbarseries Properties errordlg etime etree etreeplot eval evalc evalin workspace event.EventData listeners event.listener event.PropertyEvent event.proplistener eventlisteners COM object events events events (COM) Execute server exifread image files exist class exit exp

Ing. Teddy Negrete

Simplices attached to specified edges Triangulation edges Edit or create file Eigenvalues and eigenvectors Largest eigenvalues and eigenvectors of matrix Jacobi elliptic functions Complete elliptic integrals of first and second Generate ellipsoid Execute statements if condition is false Execute statements if additional condition is Enable access to .NET commands from Enable, disable, or report status of MATLAB Terminate block of code, or indicate last array Last day of month Floating-point relative accuracy Test for equality Compare MException objects for equality Error functions Display message and abort function Plot error bars along curve Define errorbarseries properties Create and open error dialog box Time elapsed between date vectors Elimination tree Plot elimination tree Execute string containing MATLAB expression Evaluate MATLAB expression with capture Execute MATLAB expression in specified Base class for all data objects passed to event Class defining listener objects Listener for property events Define listener object for property events List event handler functions associated with Event names List of events COM object can trigger Execute MATLAB command in Automation Read EXIF information from JPEG and TIFF Check existence of variable, function, folder, or Terminate MATLAB program (same as quit) Exponential

Página 264

expint expm expm1 values of x export2wsdlg eye ezcontour ezcontourf ezmesh ezmeshc ezplot ezplot3 ezpolar ezsurf ezsurfc faceNormals TriRep method factor factorial false fclose fclose (serial) feather featureEdges TriRep method feof ferror feval Feval (COM) server fft fft2 fftn fftshift spectrum fftw tuning control fgetl characters fgetl (serial) terminator fgets fgets (serial) terminator fieldnames object figure Figure Properties figurepalette File Formats fileattrib filebrowser already open

Ing. Teddy Negrete

Exponential integral Matrix exponential Compute exp(x)-1 accurately for small Export variables to workspace Identity matrix Easy-to-use contour plotter Easy-to-use filled contour plotter Easy-to-use 3-D mesh plotter Easy-to-use combination mesh/contour plotter Easy-to-use function plotter Easy-to-use 3-D parametric curve plotter Easy-to-use polar coordinate plotter Easy-to-use 3-D colored surface plotter Easy-to-use combination surface/contour plotter Unit normals to specified triangles Prime factors Factorial function Logical 0 (false) Close one or all open files Disconnect serial port object from device Plot velocity vectors Sharp edges of surface triangulation Test for end-of-file Information about file I/O errors Evaluate function Evaluate MATLAB function in Automation Discrete Fourier transform 2-D discrete Fourier transform N-D discrete Fourier transform Shift zero-frequency component to center of Interface to FFTW library run-time algorithm Read line from file, removing newline Read line of text from device and discard Read line from file, keeping newline characters Read line of text from device and include Field names of structure, or public fields of Create figure graphics object Define figure properties Show or hide figure palette Supported file formats Set or get attributes of file or folder Open Current Folder browser, or select it if

Página 265

filemarker function name fileparts fileread filesep fill fill3 filter filter (timeseries) filter2 find findall findfigs findobj findobj (handle) conditions findprop (handle) property name findstr finish fitsinfo fitsread fix flipdim fliplr flipud floor flow fminbnd fixed interval fminsearch function using derivative-free method fopen fopen (serial) for format fplot fprintf fprintf (serial) frame2im fread fread (serial) freeBoundary TriRep method freqspace frewind file fscanf fscanf (serial) fseek ftell ftp

Ing. Teddy Negrete

Character to separate file name and internal Parts of file name and path Read contents of file into string File separator for current platform Filled 2-D polygons Filled 3-D polygons 1-D digital filter Shape frequency content of time series 2-D digital filter Find indices and values of nonzero elements Find all graphics objects Find visible offscreen figures Locate graphics objects with specific properties Find handle objects matching specified Find meta.property object associated with Find string within another, longer string Termination M-file for MATLAB program Information about FITS file Read data from FITS file Round toward zero Flip array along specified dimension Flip matrix left to right Flip matrix up to down Round toward negative infinity Simple function of three variables Find minimum of single-variable function on Find minimum of unconstrained multivariable Open file, or obtain information about open files Connect serial port object to device Execute statements specified number of times Set display format for output Plot function between specified limits Write data to text file Write text to device Return image data associated with movie frame Read data from binary file Read binary data from device Facets referenced by only one simplex Frequency spacing for frequency response Move file position indicator to beginning of open Read data from a text file Read data from device, and format as text Move to specified position in file Position in open file Connect to FTP server, creating FTP object

Página 266

full fullfile func2str handle function function_handle (@) functions funm fwrite fwrite (serial) fzero gallery gamma, gammainc, gammaln gammaincinv gca gcbf callback is executing gcbo gcd gcf gco ge genpath genvarname get function audioplayer method object audiorecorder method object mmreader method object get (COM) properties get (hgsetget) from hgsetget class get (memmapfile) get (RandStream) get (serial) get (timer) get (timeseries) get (tscollection) getabstime (timeseries) getabstime (tscollection) getappdata getaudiodata audiorecorder method GetCharArray getdatasamplesize getDefaultStream (RandStream) getdisp (hgsetget) getenv

Ing. Teddy Negrete

Convert sparse matrix to full matrix Build full file name from parts Construct function name string from function Declare function Handle used in calling functions indirectly Information about function handle Evaluate general matrix function Write data to binary file Write binary data to device Find root of continuous function of one variable Test matrices Gamma functions Inverse incomplete gamma function Current axes handle Handle of figure containing object whose Handle of object whose callback is executing Greatest common divisor Current figure handle Handle of current object Test for greater than or equal to Generate path string Construct valid variable name from string Query Handle Graphics object properties Query property values for audioplayer Query property values for audiorecorder Query property values for multimedia reader Get property value from interface, or display Query property values of handle objects derived Memmapfile object properties Random stream properties Serial port object properties Timer object properties Query timeseries object property values Query tscollection object property values Extract date-string time vector into cell array Extract date-string time vector into cell array Value of application-defined data Store recorded audio signal in numeric array Character array from Automation server Size of data sample in timeseries object Default random number stream Override to change command window display Environment variable

Página 267

getfield getFileFormats mmreader static method getframe GetFullMatrix getinterpmethod getpixelposition getpref getqualitydesc getReport (MException) getsampleusingtime (timeseries) object getsampleusingtime (tscollection) object getTag Tiff method getTagNames Tiff static method gettimeseriesnames tscollection object gettsafteratevent occurring at or after event gettsafterevent occurring after event gettsatevent occurring at event gettsbeforeatevent occurring before or at event gettsbeforeevent occurring before event gettsbetweenevents occurring between events GetVariable workspace getVersion Tiff static method GetWorkspaceData ginput global gmres restarts) gplot matrix grabcode gradient graymon monitors grid griddata

Ing. Teddy Negrete

Field of structure array File formats that mmreader supports Capture movie frame Matrix from Automation server workspace Interpolation method for timeseries object Get component position in pixels Preference Data quality descriptions Get error message for exception Extract data samples into new timeseries Extract data samples into new tscollection

Value of specified tag List of recognized TIFF tags Cell array of names of timeseries objects in New timeseries object with samples New timeseries object with samples New timeseries object with samples New timeseries object with samples New timeseries object with samples New timeseries object with samples Data from variable in Automation server

LibTIFF library version Data from Automation server workspace Graphical input from mouse or cursor Declare global variables Generalized minimum residual method (with Plot nodes and links representing adjacency MATLAB code from files published to HTML Numerical gradient Set default figure properties for grayscale Grid lines for 2-D and 3-D plots Data gridding

Página 268

griddata3 data griddatan (dimension >= 2) gsvd gt gtext guidata guide guihandles gunzip gzip hadamard handle hankel hdf hdf5 hdf5info hdf5read hdf5write hdfinfo hdfread hdftool EOS files help helpbrowser documentation and demos helpdesk helpdlg helpwin functions hess hex2dec number hex2num precision number hgexport hggroup Hggroup Properties hgload hgsave hgsetget set and get methods hgtransform Hgtransform Properties hidden hilb hist histc hold home horzcat

Ing. Teddy Negrete

Data gridding and hypersurface fitting for 3-D Data gridding and hypersurface fitting Generalized singular value decomposition Test for greater than Mouse placement of text in 2-D view Store or retrieve GUI data Open GUI Layout Editor Create structure of handles Uncompress GNU zip files Compress files into GNU zip files Hadamard matrix Abstract class for deriving handle classes Hankel matrix Summary of MATLAB HDF4 capabilities Summary of MATLAB HDF5 capabilities Information about HDF5 file Read HDF5 file Write data to file in HDF5 format Information about HDF4 or HDF-EOS file Read data from HDF4 or HDF-EOS file Browse and import data from HDF4 or HDFHelp for functions in Command Window Open Help browser to access online Open Help browser Create and open help dialog box Provide access to help comments for all Hessenberg form of matrix Convert hexadecimal number string to decimal Convert hexadecimal number string to doubleExport figure Create hggroup object Hggroup properties Load Handle Graphics object hierarchy from file Save Handle Graphics object hierarchy to file Abstract class used to derive handle class with Create hgtransform graphics object Hgtransform properties Remove hidden lines from mesh plot Hilbert matrix Histogram plot Histogram count Retain current graph in figure Send the cursor home Concatenate arrays horizontally

Página 269

horzcat (tscollection) Horizontal concatenation for tscollection objects hostid Server host identification number hsv2rgb Convert HSV colormap to RGB colormap hypot Square root of sum of squares i Imaginary unit idealfilter (timeseries) Apply ideal (noncausal) filter to timeseries object idivide Integer division with rounding option if Execute statements if condition is true ifft Inverse discrete Fourier transform ifft2 2-D inverse discrete Fourier transform ifftn N-D inverse discrete Fourier transform ifftshift Inverse FFT shift ilu Sparse incomplete LU factorization im2frame Convert image to movie frame im2java Convert image to Java image imag Imaginary part of complex number image Display image object Image Properties Define image properties imagesc Scale data and display image object imapprox Approximate indexed image using one with fewer colors imfinfo Information about graphics file imformats Manage image file format registry import Add package or class to current import list importdata Load data from file imread Read image from graphics file imwrite Write image to graphics file incenters TriRep method Incenters of specified simplices ind2rgb Convert indexed image to RGB image ind2sub Subscripts from linear index Inf Infinity inferiorto Specify inferior class relationship info Information about contacting The MathWorks inline Construct inline object inmem Names of functions, MEX-files, Sun Java classes in memory inOutStatus DelaunayTri method Status of triangles in 2-D constrained Delaunay triangulation inpolygon Points inside polygonal region input Request user input inputdlg Create and open input dialog box inputname Variable name of function input inputParser Construct input parser object inspect Open Property Inspector instrcallback Event information when event occurs instrfind Read serial port objects from memory to MATLAB workspace instrfindall Find visible and hidden serial port objects int2str Convert integer to string int8, int16, int32, int64 Convert to signed integer interfaces List custom interfaces exposed by COM server object interp1 1-D data interpolation (table lookup) interp1q Quick 1-D linear interpolation interp2 2-D data interpolation (table lookup)

Ing. Teddy Negrete

Página 270

interp3 3-D data interpolation (table lookup) interpft 1-D interpolation using FFT method interpn N-D data interpolation (table lookup) interpstreamspeed Interpolate stream-line vertices from flow speed intersect Find set intersection of two vectors intmax Largest value of specified integer type Alphabetical List (MATLAB®) text://5 17 of 35 22/02/2011 11:14 intmin Smallest value of specified integer type intwarning Control state of integer warnings inv Matrix inverse invhilb Inverse of Hilbert matrix invoke Invoke method on COM object or interface, or display methods ipermute Inverse permute dimensions of N-D array iqr (timeseries) Interquartile range of timeseries data is* Detect state isa Determine whether input is object of given class isappdata True if application-defined data exists iscell Determine whether input is cell array iscellstr Determine whether input is cell array of strings ischar Determine whether item is character array iscom Determine whether input is COM or ActiveX object isdir Determine whether input is folder isEdge TriRep method Test if vertices are joined by edge isempty Determine whether array is empty isempty (timeseries) Determine whether timeseries object is empty isempty (tscollection) Determine whether tscollection object is empty isequal Test arrays for equality isequal (MException) Compare MException objects for equality isequalwithequalnans Test arrays for equality, treating NaNs as equal isevent Determine whether input is COM object event isfield Determine whether input is structure array field isfinite Array elements that are finite isfloat Determine whether input is floating-point array isglobal Determine whether input is global variable ishandle Determine whether input is valid Handle Graphics handle ishghandle True for Handle Graphics object handles ishold Current hold state isinf Array elements that are infinite isinteger Determine whether input is integer array isinterface Determine whether input is COM interface isjava Determine whether input is Sun Java object isKey (Map) Check if containers.Map contains key iskeyword Determine whether input is MATLAB keyword isletter Array elements that are alphabetic letters islogical Determine whether input is logical array ismac Determine if version is for Mac OS X platform ismember Array elements that are members of set ismethod Determine whether input is COM object method isnan Array elements that are NaN isnumeric Determine whether input is numeric array isobject Is input MATLAB object isocaps Compute isosurface end-cap geometry isocolors Calculate isosurface and patch colors isonormals Compute normals of isosurface vertices

Ing. Teddy Negrete

Página 271

Alphabetical List (MATLAB®) text://5 18 of 35 22/02/2011 11:14 isosurface Extract isosurface data from volume data ispc Determine if version is for Windows (PC) platform isPlatformSupported mmreader static method Determine whether mmreader is available on current platform ispref Test for existence of preference isprime Array elements that are prime numbers isprop Determine whether input is COM object property isreal Check if input is real array isscalar Determine whether input is scalar issorted Determine whether set elements are in sorted order isspace Array elements that are space characters issparse Determine whether input is sparse isstr Determine whether input is character array isstrprop Determine whether string is of specified category isstruct Determine whether input is structure array isstudent Determine if version is Student Version isTiled Tiff method Determine if tiled image isunix Determine if version is for UNIX platform isvalid (handle) Is object valid handle class object isvalid (serial) Determine whether serial port objects are valid isvalid (timer) Determine whether timer object is valid isvarname Determine whether input is valid variable name isvector Determine whether input is vector j Imaginary unit javaaddpath Add entries to dynamic Sun Java class path javaArray Construct Sun Java array javachk Generate error message based on Sun Java feature support javaclasspath Get and set Sun Java class path javaMethod Invoke Sun Java method javaMethodEDT Invoke Sun Java method from Event Dispatch Thread (EDT) javaObject Invoke Sun Java constructor, letting MATLAB choose the thread javaObjectEDT Invoke Sun Java object constructor on Event Dispatch Thread (EDT) javarmpath Remove entries from dynamic Sun Java class path keyboard Input from keyboard keys (Map) Return all keys of containers.Map object kron Kronecker tensor product last (MException) Last uncaught exception lastDirectory Tiff method Determine if current IFD is last in file lasterr Last error message lasterror Last error message and related information lastwarn Last warning message lcm Least common multiple ldivide, rdivide Left or right array division ldl Block LDL' factorization for Hermitian indefinite matrices le Test for less than or equal to legend Graph legend for lines and patches Alphabetical List (MATLAB®) text://5 19 of 35 22/02/2011 11:14 legendre Associated Legendre functions length Length of vector or largest array dimension length (Map) Length of containers.Map object length (serial) Length of serial port object array

Ing. Teddy Negrete

Página 272

length (timeseries) Length of time vector length (tscollection) Length of time vector libfunctions Return information on functions in shared library libfunctionsview View functions in shared library libisloaded Determine if shared library is loaded libpointer Create pointer object for use with shared libraries libstruct Create structure pointer for use with shared libraries license Return license number or perform licensing task light Create light object Light Properties Light properties lightangle Create or position light object in spherical coordinates lighting Specify lighting algorithm lin2mu Convert linear audio signal to mu-law line Create line object Line Properties Line properties Lineseries Properties Define lineseries properties LineSpec (Line Specification) Line specification string syntax linkaxes Synchronize limits of specified 2-D axes linkdata Automatically update graphs when variables change linkprop Keep same value for corresponding properties linsolve Solve linear system of equations linspace Generate linearly spaced vectors list (RandStream) Random number generator algorithms listdlg Create and open list-selection dialog box listfonts List available system fonts load Load data from MAT-file into workspace load (COM) Initialize control object from file load (serial) Load serial port objects and variables into MATLAB workspace loadlibrary Load shared library into MATLAB software loadobj Modify load process for object log Natural logarithm log10 Common (base 10) logarithm log1p Compute log(1+x) accurately for small values of x log2 Base 2 logarithm and dissect floating-point numbers into exponent and mantissa logical Convert numeric values to logical loglog Log-log scale plot logm Matrix logarithm logspace Generate logarithmically spaced vectors lookfor Search for keyword in all help entries lower Convert string to lowercase ls Folder contents lscov Least-squares solution in presence of known covariance lsqnonneg Solve nonnegative least-squares constraints problem Alphabetical List (MATLAB®) text://5 20 of 35 22/02/2011 11:14 lsqr LSQR method lt Test for less than lu LU matrix factorization luinc Sparse incomplete LU factorization magic Magic square makehgtform Create 4-by-4 transform matrix mat2cell Divide matrix into cell array of matrices mat2str Convert matrix to string material Control reflectance properties of surfaces and patches matlab (UNIX) Start MATLAB program (UNIX platforms)

Ing. Teddy Negrete

Página 273

matlab (Windows) Start MATLAB program (Windows platforms) matlabcolon (matlab:) Run specified function via hyperlink matlabrc Startup M-file for MATLAB program matlabroot Root folder max Largest elements in array max (timeseries) Maximum value of timeseries data MaximizeCommandWindow Open Automation server window maxNumCompThreads Control maximum number of computational threads mean Average or mean value of array mean (timeseries) Mean value of timeseries data median Median value of array median (timeseries) Median value of timeseries data memmapfile Construct memmapfile object memory Display memory information menu Generate menu of choices for user input mesh, meshc, meshz Mesh plots meshgrid Generate X and Y arrays for 3-D plots meta.class meta.class class describes MATLAB classes meta.class.fromName Return meta.class object associated with named class meta.DynamicProperty meta.DynamicProperty class describes dynamic property of MATLAB object meta.event meta.event class describes MATLAB class events meta.method meta.method class describes MATLAB class methods meta.package meta.package class describes MATLAB packages meta.package.fromName Return meta.package object for specified package meta.package.getAllPackages Get all top-level packages meta.property meta.property class describes MATLAB class properties metaclass Obtain meta.class object methods Class method names methodsview View class methods mex Compile MEX-function from C/C++ or Fortran source code mex.getCompilerConfigurations Get compiler configuration information for building MEX-files MException Capture error information mexext Binary MEX-file name extension mfilename File name of currently running function mget Download file from FTP server min Smallest elements in array min (timeseries) Minimum value of timeseries data Alphabetical List (MATLAB®) text://5 21 of 35 22/02/2011 11:14 MinimizeCommandWindow Minimize size of Automation server window minres Minimum residual method mislocked Determine if function is locked in memory mkdir Make new folder mkdir (ftp) Create new directory on FTP server mkpp Make piecewise polynomial mldivide \, mrdivide / Left or right matrix division mlint Check MATLAB code files for possible problems mlintrpt Run mlint for file or folder, reporting results in browser mlock Prevent clearing function from memory mmfileinfo Information about multimedia file mmreader Create multimedia reader object for reading video files mod Modulus after division mode Most frequent values in array

Ing. Teddy Negrete

Página 274

more Control paged output for Command Window move Move or resize control in parent window movefile Move file or folder movegui Move GUI figure to specified location on screen movie Play recorded movie frames movie2avi Create Audio/Video Interleaved (AVI) file from MATLAB movie mput Upload file or directory to FTP server msgbox Create and open message box mtimes Matrix multiplication mu2lin Convert mu-law audio signal to linear multibandread Read band-interleaved data from binary file multibandwrite Write band-interleaved data to file munlock Allow clearing functions from memory namelengthmax Maximum identifier length NaN Not-a-Number nargchk Validate number of input arguments nargin, nargout Number of function arguments nargoutchk Validate number of output arguments native2unicode Convert numeric bytes to Unicode characters nchoosek Binomial coefficient or all combinations ndgrid Generate arrays for N-D functions and interpolation ndims Number of array dimensions ne Test for inequality ne (MException) Compare MException objects for inequality nearestNeighbor DelaunayTri method Point closest to specified location neighbors TriRep method Simplex neighbor information NET Summary of functions in MATLAB .NET interface NET.addAssembly Make .NET assembly visible to MATLAB NET.Assembly Members of .NET assembly NET.convertArray Convert numeric MATLAB array to .NET array NET.createArray Create single or multidimensional .NET array NET.createGeneric Create instance of specialized .NET generic type Alphabetical List (MATLAB®) text://5 22 of 35 22/02/2011 11:14 NET.GenericClass class Represent parameterized generic type definitions constructor Constructor for NET.GenericClass class NET.invokeGenericMethod Invoke generic method of object NET.NetException .NET exception NET.setStaticProperty Static property or field name netcdf Summary of MATLAB Network Common Data Form (netCDF) capabilities netcdf.abort Revert recent netCDF file definitions netcdf.close Close netCDF file netcdf.copyAtt Copy attribute to new location netcdf.create Create new netCDF dataset netcdf.defDim Create netCDF dimension netcdf.defVar Create netCDF variable netcdf.delAtt Delete netCDF attribute netcdf.endDef End netCDF file define mode netcdf.getAtt Return netCDF attribute netcdf.getConstant Return numeric value of named constant netcdf.getConstantNames Return list of constants known to netCDF library netcdf.getVar Return data from netCDF variable netcdf.inq Return information about netCDF file netcdf.inqAtt Return information about netCDF attribute Ing. Teddy Negrete

Página 275

netcdf.inqAttID Return ID of netCDF attribute netcdf.inqAttName Return name of netCDF attribute netcdf.inqDim Return netCDF dimension name and length netcdf.inqDimID Return dimension ID netcdf.inqLibVers Return netCDF library version information netcdf.inqVar Return information about variable netcdf.inqVarID Return ID associated with variable name netcdf.open Open netCDF file netcdf.putAtt Write netCDF attribute netcdf.putVar Write data to netCDF variable netcdf.reDef Put open netCDF file into define mode netcdf.renameAtt Change name of attribute netcdf.renameDim Change name of netCDF dimension netcdf.renameVar Change name of netCDF variable netcdf.setDefaultFormat Change default netCDF file format netcdf.setFill Set netCDF fill mode netcdf.sync Synchronize netCDF file to disk newplot Determine where to draw graphics objects nextDirectory Tiff method Make next IFD current IFD nextpow2 Next higher power of 2 nnz Number of nonzero matrix elements noanimate Change EraseMode of all objects to normal nonzeros Nonzero matrix elements norm Vector and matrix norms normest 2-norm estimate not Find logical NOT of array or scalar input Alphabetical List (MATLAB®) text://5 23 of 35 22/02/2011 11:14 notebook Open M-book in Microsoft Word software (on Microsoft Windows platforms) notify (handle) Notify listeners that event is occurring now Current date and time nthroot Real nth root of real numbers null Null space num2cell Convert numeric array to cell array num2hex Convert singles and doubles to IEEE hexadecimal strings num2str Convert number to string numberOfStrips Tiff method Total number of strips in image numberOfTiles Tiff method Total number of tiles in image numel Number of elements in array or subscripted array expression nzmax Amount of storage allocated for nonzero matrix elements ode15i Solve fully implicit differential equations, variable order method ode23, ode45, ode113, ode15s, ode23s, ode23t, ode23tb Solve initial value problems for ordinary differential equations odefile Define differential equation problem for ordinary differential equation solvers odeget Ordinary differential equation options parameters odeset Create or alter options structure for ordinary differential equation solvers odextend Extend solution of initial value problem for ordinary differential equation onCleanup Cleanup tasks at function completion ones Create array of all ones open Open file in appropriate application openfig Open new copy or raise existing copy of saved figure opengl Control OpenGL rendering openvar Open workspace variable in Variable Editor or other graphical editing tool

Ing. Teddy Negrete

Página 276

optimget Optimization options values optimset Create or edit optimization options structure or Find logical OR of array or scalar inputs ordeig Eigenvalues of quasitriangular matrices orderfields Order fields of structure array ordqz Reorder eigenvalues in QZ factorization ordschur Reorder eigenvalues in Schur factorization orient Hardcopy paper orientation orth Range space of matrix otherwise Default part of switch statement pack Consolidate workspace memory padecoef Padé approximation of time delays pagesetupdlg Page setup dialog box pan Pan view of graph interactively pareto Pareto chart parfor Parallel for-loop parse (inputParser) Parse and validate named inputs parseSoapResponse Convert response string from SOAP server into MATLAB types pascal Pascal matrix patch Create one or more filled polygons Patch Properties Patch properties Alphabetical List (MATLAB®) text://5 24 of 35 22/02/2011 11:14 path View or change search path path2rc Save current search path to pathdef.m file pathsep Search path separator for current platform pathtool Open Set Path dialog box to view and change search path pause Halt execution temporarily pbaspect Set or query plot box aspect ratio pcg Preconditioned conjugate gradients method pchip Piecewise Cubic Hermite Interpolating Polynomial (PCHIP) pcode Create protected function file pcolor Pseudocolor (checkerboard) plot pdepe Solve initial-boundary value problems for parabolic-elliptic PDEs in 1-D pdeval Evaluate numerical solution of PDE using output of pdepe peaks Example function of two variables perl Call Perl script using appropriate operating system executable perms All possible permutations permute Rearrange dimensions of N-D array persistent Define persistent variable pi Ratio of circle's circumference to its diameter pie Pie chart pie3 3-D pie chart pinv Moore-Penrose pseudoinverse of matrix planerot Givens plane rotation play audioplayer method Play audio from audioplayer object audiorecorder method Play audio from audiorecorder object playblocking audioplayer method Play audio from audioplayer object, holding control until playback completes playshow Run M-file demo (deprecated; use echodemo instead) plot 2-D line plot plot (timeseries) Plot time series plot3 3-D line plot plotbrowser Show or hide figure plot browser

Ing. Teddy Negrete

Página 277

plotedit Interactively edit and annotate plots plotmatrix Scatter plot matrix plottools Show or hide plot tools plotyy 2-D line plots with y-axes on both left and right side pointLocation DelaunayTri method Simplex containing specified location pol2cart Transform polar or cylindrical coordinates to Cartesian polar Polar coordinate plot poly Polynomial with specified roots polyarea Area of polygon polyder Polynomial derivative polyeig Polynomial eigenvalue problem polyfit Polynomial curve fitting polyint Integrate polynomial analytically polyval Polynomial evaluation Alphabetical List (MATLAB®) text://5 25 of 35 22/02/2011 11:14 polyvalm Matrix polynomial evaluation pow2 Base 2 power and scale floating-point numbers power Array power ppval Evaluate piecewise polynomial prefdir Folder containing preferences, history, and layout files preferences Open Preferences dialog box primes Generate list of prime numbers print, printopt Print figure or save to file and configure printer defaults printdlg Print dialog box printpreview Preview figure to print prod Product of array elements profile Profile execution time for function profsave Save profile report in HTML format propedit Open Property Editor propedit (COM) Open built-in property page for control properties Class property names propertyeditor Show or hide property editor psi Psi (polygamma) function publish Publish MATLAB file with code cells, saving output to specified file type PutCharArray Store character array in Automation server PutFullMatrix Matrix in Automation server workspace PutWorkspaceData Data in Automation server workspace pwd Identify current folder qmr Quasi-minimal residual method qr Orthogonal-triangular decomposition qrdelete Remove column or row from QR factorization qrinsert Insert column or row into QR factorization qrupdate quad Numerically evaluate integral, adaptive Simpson quadrature quad2d Numerically evaluate double integral over planar region quadgk Numerically evaluate integral, adaptive Gauss-Kronrod quadrature quadl Numerically evaluate integral, adaptive Lobatto quadrature quadv Vectorized quadrature questdlg Create and open question dialog box quit Terminate MATLAB program Quit (COM) Terminate MATLAB Automation server quiver Quiver or velocity plot quiver3 3-D quiver or velocity plot Quivergroup Properties Define quivergroup properties qz QZ factorization for generalized eigenvalues Ing. Teddy Negrete

Página 278

rand Uniformly distributed pseudorandom numbers rand (RandStream) Uniformly distributed random numbers randi Uniformly distributed pseudorandom integers randi (RandStream) Uniformly distributed pseudorandom integers randn Normally distributed pseudorandom numbers randn (RandStream) Normally distributed pseudorandom numbers randperm Random permutation randperm (RandStream) Random permutation Alphabetical List (MATLAB®) text://5 26 of 35 22/02/2011 11:14 RandStream Random number stream RandStream (RandStream) Random number stream rank Rank of matrix rat, rats Rational fraction approximation rbbox Create rubberband box for area selection rcond Matrix reciprocal condition number estimate read mmreader method Read video frame data from multimedia reader object Tiff method Read entire image readasync Read data asynchronously from device readEncodedStrip Tiff method Read data from specified strip readEncodedTile Tiff method Read data from specified tile real Real part of complex number reallog Natural logarithm for nonnegative real arrays realmax Largest positive floating-point number realmin Smallest positive normalized floating-point number realpow Array power for real-only output realsqrt Square root for nonnegative real arrays record function Record data and event information to file audiorecorder method Record audio to audiorecorder object recordblocking audiorecorder method Record audio to audiorecorder object, holding control until recording completes rectangle Create 2-D rectangle object Rectangle Properties Define rectangle properties rectint Rectangle intersection area recycle Set option to move deleted files to recycle folder reducepatch Reduce number of patch faces reducevolume Reduce number of elements in volume data set refresh Redraw current figure refreshdata Refresh data in graph when data source is specified regexp, regexpi Match regular expression regexprep Replace string using regular expression regexptranslate Translate string into regular expression registerevent Associate event handler for COM object event at run time rehash Refresh function and file system path caches relationaloperators (handle) Equality and sorting of handle objects release Release COM interface rem Remainder after division remove (Map) Remove key-value pairs from containers.Map removets Remove timeseries objects from tscollection object rename Rename file on FTP server repmat Replicate and tile array

Ing. Teddy Negrete

Página 279

resample (timeseries) Select or interpolate timeseries data using new time vector resample (tscollection) Select or interpolate data in tscollection using new time vector Alphabetical List (MATLAB®) text://5 27 of 35 22/02/2011 11:14 reset Reset graphics object properties to their defaults reset (RandStream) Reset random stream reshape Reshape array residue Convert between partial fraction expansion and polynomial coefficients restoredefaultpath Restore default search path rethrow Reissue error rethrow (MException) Reissue existing exception return Return to invoking function rewriteDirectory Tiff method Write modified metadata to existing IFD rgb2hsv Convert RGB colormap to HSV colormap rgb2ind Convert RGB image to indexed image rgbplot Plot colormap ribbon Ribbon plot rmappdata Remove application-defined data rmdir Remove folder rmdir (ftp) Remove directory on FTP server rmfield Remove fields from structure rmpath Remove folders from search path rmpref Remove preference root object Root Root Properties Root properties roots Polynomial roots rose Angle histogram plot rosser Classic symmetric eigenvalue test problem rot90 Rotate matrix 90 degrees rotate Rotate object in specified direction rotate3d Rotate 3-D view using mouse round Round to nearest integer rref Reduced row echelon form rsf2csf Convert real Schur form to complex Schur form run Run script that is not on current path save Save workspace variables to file save (COM) Serialize control object to file save (serial) Save serial port objects and variables to file saveas Save figure or Simulink block diagram using specified format saveobj Modify save process for object savepath Save current search path scatter Scatter plot scatter3 3-D scatter plot Scattergroup Properties Define scattergroup properties schur Schur decomposition script Sequence of MATLAB statements in file sec Secant of argument in radians secd Secant of argument in degrees sech Hyperbolic secant selectmoveresize Select, move, resize, or copy axes and uicontrol graphics objects semilogx, semilogy Semilogarithmic plots Alphabetical List (MATLAB®) text://5 28 of 35 22/02/2011 11:14 sendmail Send e-mail message to address list serial Create serial port object

Ing. Teddy Negrete

Página 280

serialbreak Send break to device connected to serial port set function Set Handle Graphics object properties audioplayer method Set property values for audioplayer object audiorecorder method Set property values for audiorecorder object mmreader method Set property values for multimedia reader object set (COM) Set object or interface property to specified value set (hgsetget) Assign property values to handle objects derived from hgsetget class set (RandStream) Set random stream property set (serial) Configure or display serial port object properties set (timer) Configure or display timer object properties set (timeseries) Set properties of timeseries object set (tscollection) Set properties of tscollection object setabstime (timeseries) Set times of timeseries object as date strings setabstime (tscollection) Set times of tscollection object as date strings setappdata Specify application-defined data setDefaultStream (RandStream) Set default random number stream setdiff Find set difference of two vectors setDirectory Tiff method Make specified IFD current IFD setdisp (hgsetget) Override to change command window display setenv Set environment variable setfield Assign values to structure array field setinterpmethod Set default interpolation method for timeseries object setpixelposition Set component position in pixels setpref Set preference setstr Set string flag setSubDirectory Tiff method Make subIFD specified by byte offset current IFD setTag Tiff method Set value of tag settimeseriesnames Change name of timeseries object in tscollection setxor Find set exclusive OR of two vectors shading Set color shading properties shg Show most recent graph window shiftdim Shift dimensions showplottool Show or hide figure plot tool shrinkfaces Reduce size of patch faces sign Signum function sin Sine of argument in radians sind Sine of argument in degrees single Convert to single precision sinh Hyperbolic sine of argument in radians size function Array dimensions TriRep method Size of triangulation matrix Alphabetical List (MATLAB®) text://5 29 of 35 22/02/2011 11:14 size (Map) size of containers.Map object size (serial) Size of serial port object array size (timeseries) Size of timeseries object size (tscollection) Size of tscollection object slice Volumetric slice plot smooth3 Smooth 3-D data snapnow Force snapshot of image for inclusion in published document sort Sort array elements in ascending or descending order

Ing. Teddy Negrete

Página 281

sortrows Sort rows in ascending order sound Convert matrix of signal data to sound soundsc Scale data and play as sound spalloc Allocate space for sparse matrix sparse Create sparse matrix spaugment Form least squares augmented system spconvert Import matrix from sparse matrix external format spdiags Extract and create sparse band and diagonal matrices specular Calculate specular reflectance speye Sparse identity matrix spfun Apply function to nonzero sparse matrix elements sph2cart Transform spherical coordinates to Cartesian sphere Generate sphere spinmap Spin colormap spline Cubic spline data interpolation spones Replace nonzero sparse matrix elements with ones spparms Set parameters for sparse matrix routines sprand Sparse uniformly distributed random matrix sprandn Sparse normally distributed random matrix sprandsym Sparse symmetric random matrix sprank Structural rank sprintf Format data into string spy Visualize sparsity pattern sqrt Square root sqrtm Matrix square root squeeze Remove singleton dimensions ss2tf Convert state-space filter parameters to transfer function form sscanf Read formatted data from string stairs Stairstep graph Stairseries Properties Define stairseries properties start Start timer(s) running startat Start timer(s) running at specified time startup Startup file for user-defined options std Standard deviation std (timeseries) Standard deviation of timeseries data stem Plot discrete sequence data stem3 Plot 3-D discrete sequence data Stemseries Properties Define stemseries properties stop Stop timer(s) stopasync Stop asynchronous read and write operations Alphabetical List (MATLAB®) text://5 30 of 35 22/02/2011 11:14 str2double Convert string to double-precision value str2func Construct function handle from function name string str2mat Form blank-padded character matrix from strings str2num Convert string to number strcat Concatenate strings horizontally strcmp, strcmpi Compare strings stream2 Compute 2-D streamline data stream3 Compute 3-D streamline data streamline Plot streamlines from 2-D or 3-D vector data streamparticles Plot stream particles streamribbon 3-D stream ribbon plot from vector volume data streamslice Plot streamlines in slice planes streamtube Create 3-D stream tube plot strfind Find one string within another strings String handling Ing. Teddy Negrete

Página 282

strjust Justify character array strmatch Find possible matches for string strncmp, strncmpi Compare first n characters of strings strread Read formatted data from string strrep Find and replace substring strtok Selected parts of string strtrim Remove leading and trailing white space from string struct Create structure array struct2cell Convert structure to cell array structfun Apply function to each field of scalar structure strvcat Concatenate strings vertically sub2ind Convert subscripts to linear indices subplot Create axes in tiled positions subsasgn Subscripted assignment subsindex Subscript indexing with object subspace Angle between two subspaces subsref Redefine subscripted reference for objects substruct Create structure argument for subsasgn or subsref subvolume Extract subset of volume data set sum Sum of array elements sum (timeseries) Sum of timeseries data superclasses Superclass names superiorto Establish superior class relationship support Open MathWorks Technical Support Web page surf, surfc 3-D shaded surface plot surf2patch Convert surface data to patch data surface Create surface object Surface Properties Surface properties Surfaceplot Properties Define surfaceplot properties surfl Surface plot with colormap-based lighting surfnorm Compute and display 3-D surface normals svd Singular value decomposition svds Find singular values and vectors Alphabetical List (MATLAB®) text://5 31 of 35 22/02/2011 11:14 swapbytes Swap byte ordering switch Switch among several cases, based on expression symamd Symmetric approximate minimum degree permutation symbfact Symbolic factorization analysis symmlq Symmetric LQ method symrcm Sparse reverse Cuthill-McKee ordering symvar Determine symbolic variables in expression synchronize Synchronize and resample two timeseries objects using common time vector syntax Two ways to call MATLAB functions system Execute operating system command and return result tan Tangent of argument in radians tand Tangent of argument in degrees tanh Hyperbolic tangent tar Compress files into tar file tempdir Name of system's temporary folder tempname Unique name for temporary file tetramesh Tetrahedron mesh plot texlabel Produce TeX format from character string text Create text object in current axes Text Properties Text properties

Ing. Teddy Negrete

Página 283

textread Read data from text file; write to multiple outputs textscan Read formatted data from text file or string textwrap Wrapped string matrix for given uicontrol tfqmr Transpose-free quasi-minimal residual method throw (MException) Issue exception and terminate function throwAsCaller (MException) Throw exception as if from calling function tic, toc Measure performance using stopwatch timer Tiff MATLAB Gateway to LibTIFF library routines timer Construct timer object timerfind Find timer objects timerfindall Find timer objects, including invisible objects timeseries Create timeseries object title Add title to current axes todatenum Convert CDF epoch object to MATLAB datenum toeplitz Toeplitz matrix toolboxdir Root folder for specified toolbox trace Sum of diagonal elements transpose (timeseries) Transpose timeseries object trapz Trapezoidal numerical integration treelayout Lay out tree or forest treeplot Plot picture of tree tril Lower triangular part of matrix trimesh Triangular mesh plot triplequad Numerically evaluate triple integral triplot 2-D triangular plot TriRep class Triangulation representation Alphabetical List (MATLAB®) text://5 32 of 35 22/02/2011 11:14 constructor Triangulation representation TriScatteredInterp class Interpolate scattered data constructor Interpolate scattered data trisurf Triangular surface plot triu Upper triangular part of matrix true Logical 1 (true) try Execute statements and catch resulting errors tscollection Create tscollection object tsdata.event Construct event object for timeseries object tsearch Search for enclosing Delaunay triangle tsearchn N-D closest simplex search tsprops Help on timeseries object properties tstool Open Time Series Tools GUI type Display contents of file typecast Convert data types without changing underlying data uibuttongroup Create container object to exclusively manage radio buttons and toggle buttons Uibuttongroup Properties Describe button group properties uicontextmenu Create context menu Uicontextmenu Properties Describe context menu properties uicontrol Create user interface control object Uicontrol Properties Describe user interface control (uicontrol) properties uigetdir Open standard dialog box for selecting directory uigetfile Open standard dialog box for retrieving files uigetpref Open dialog box for retrieving preferences uiimport Open Import Wizard to import data

Ing. Teddy Negrete

Página 284

uimenu Create menus on figure windows Uimenu Properties Describe menu properties uint8, uint16, uint32, uint64 Convert to unsigned integer uiopen Open file selection dialog box with appropriate file filters uipanel Create panel container object Uipanel Properties Describe panel properties uipushtool Create push button on toolbar Uipushtool Properties Describe push tool properties uiputfile Open standard dialog box for saving files uiresume Resume execution of blocked M-file uisave Open standard dialog box for saving workspace variables uisetcolor Open standard dialog box for setting object's ColorSpec uisetfont Open standard dialog box for setting object's font characteristics uisetpref Manage preferences used in uigetpref uistack Reorder visual stacking order of objects uitable Create 2-D graphic table GUI component Uitable Properties Describe table properties uitoggletool Create toggle button on toolbar Uitoggletool Properties Describe toggle tool properties uitoolbar Create toolbar on figure Uitoolbar Properties Describe toolbar properties Alphabetical List (MATLAB®) text://5 33 of 35 22/02/2011 11:14 uiwait Block execution and wait for resume undocheckout Undo previous checkout from source control system (UNIX platforms) unicode2native Convert Unicode characters to numeric bytes union Find set union of two vectors unique Find unique elements of vector unix Execute UNIX command and return result unloadlibrary Unload shared library from memory unmesh Convert edge matrix to coordinate and Laplacian matrices unmkpp Piecewise polynomial details unregisterallevents Unregister all event handlers associated with COM object events at run time unregisterevent Unregister event handler associated with COM object event at run time untar Extract contents of tar file unwrap Correct phase angles to produce smoother phase plots unzip Extract contents of zip file upper Convert string to uppercase urlread Download content at URL into MATLAB string urlwrite Download content at URL and save to file usejava Determine whether Sun Java feature is supported in MATLAB software userpath View or change user portion of search path validateattributes Check validity of array validatestring Check validity of text string values (Map) Return values of containers.Map object vander Vandermonde matrix var Variance var (timeseries) Variance of timeseries data varargin Variable length input argument list varargout Variable length output argument list vectorize Vectorize expression ver Version information for MathWorks products verctrl Source control actions (Windows platforms) verLessThan Compare toolbox version to specified version string version Version number for MATLAB and libraries vertcat Concatenate arrays vertically

Ing. Teddy Negrete

Página 285

vertcat (timeseries) Vertical concatenation of timeseries objects vertcat (tscollection) Vertical concatenation for tscollection objects vertexAttachments TriRep method Return simplices attached to specified vertices view Viewpoint specification viewmtx View transformation matrices visdiff Compare two text files, MAT-Files, binary files, or folders volumebounds Coordinate and color limits for volume data voronoi Voronoi diagram voronoiDiagram DelaunayTri method Voronoi diagram voronoin N-D Voronoi diagram wait Wait until timer stops running waitbar Open or update a wait bar dialog box waitfor Wait for condition before resuming execution Alphabetical List (MATLAB®) text://5 34 of 35 22/02/2011 11:14 waitforbuttonpress Wait for key press or mouse-button click warndlg Open warning dialog box warning Warning message waterfall Waterfall plot wavfinfo Information about WAVE (.wav) sound file wavplay Play recorded sound on PC-based audio output device wavread Read WAVE (.wav) sound file wavrecord Record sound using PC-based audio input device wavwrite Write WAVE (.wav) sound file web Open Web site or file in Web or Help browser weekday Day of week what List MATLAB files in folder whatsnew Release Notes for MathWorks products which Locate functions and files while Repeatedly execute statements while condition is true whitebg Change axes background color who, whos List variables in workspace wilkinson Wilkinson's eigenvalue test matrix winopen Open file in appropriate application (Windows) winqueryreg Item from Windows registry wk1finfo Determine whether file contains 1-2-3 WK1 worksheet wk1read Read Lotus 1-2-3 WK1 spreadsheet file into matrix wk1write Write matrix to Lotus 1-2-3 WK1 spreadsheet file workspace Open Workspace browser to manage workspace write Tiff method Write entire image writeDirectory Tiff method Create new IFD and make it current IFD writeEncodedStrip Tiff method Write data to specified strip writeEncodedTile Tiff method Write data to specified tile xlabel, ylabel, zlabel Label x-, y-, and z-axis xlim, ylim, zlim Set or query axis limits xlsfinfo Determine whether file contains a Microsoft Excel spreadsheet xlsread Read Microsoft Excel spreadsheet file xlswrite Write Microsoft Excel spreadsheet file xmlread Parse XML document and return Document Object Model node xmlwrite Serialize XML Document Object Model node

Ing. Teddy Negrete

Página 286

xor Logical exclusive-OR xslt Transform XML document using XSLT engine zeros Create array of all zeros zip Compress files into zip file zoom Turn zooming on or off or magnify by factor Was this topic helpful? Yes No

External Interfaces Alphabetical List (MATLAB®) text://5 35 of 35 22/02/2011 11:14 © 1984-2010 The MathWorks, Inc. • Terms of Use • Patents • Trademarks • Acknowledgments

Ing. Teddy Negrete

Página 287

Autor: TEDDY NEGRETE

20/05/2013

G:\2_AREA_BASICA\AB_130\PRODUCTOS_PERIODO_VACACIONAL\CV\Guia_Practicas_MATLAB_CV.docx

- 288 -