jueves, 22 de noviembre de 2012

Reporte 7 (laboratorio)

Para ultima tarea esto es lo que se tiene que resolver:

P8.1 Dibujar la grafica polar de la respuesta en frecuencia para las siguientes funciones de transferencia.
A)






B)




C)




D)




Para hacer la gráfica polar de cada función utilizaremos "nyquist" de octave ya que esta crea las gráficas que requerimos. Pero primero resolveremos las funciones para dejarlo en términos mas directos.

Aqui las funciones que necesitaban ese cambio eran la A y D, lo que nos queda es lo siguiente:

A)




D)





Ahora con octave realizaremos cada gráfica, para realizarlas se hace lo siguiente:

Tecleamos numerador y denominador y las guardamos en variables, como se puede apreciar en las imágenes yo las llamo "num" y "den", después en otra variable guardamos la función de transferencia y al final le damos "nyquist nombre de variable" y realiza la gráfica.

También si el denominador o numerador llegan a mas numero solo rellenaremos con ceros, por ejemplo en la ultima gráfica realizada llega a s^3 en el denominador y en el numerador solo a s, solo se rellena con ceros para comp letar.

Aqui las gráficas con su respectivo codigo en la imagen, las graficas se presentan como se presentaron las funciones:

A)

B)
C)
D)




jueves, 15 de noviembre de 2012

Reporte 6 (laboratorio)

El problema a resolver es el siguiente:

B.12.14. sea el sistema

x = Ax + Bu
y = Cx



Diseñe un sistema regulador por el método de asignación de polos con observador. Suponga que los polos en lazo cerrado deseados para la asignación de polos están en

 s = -1 + j                               s = -1 - j                                   s = -5

Los polos deseados del observador estan localizados en

s = -6                                   s = -6                             s = -6

También obtenga la funcion de transferencia del controlador observador.

Para empezar a resolver esto utilizaremos la función place que es la similar en octave, para "acker" en MATLAB, ya que para sacar la matriz de ganancia de retroalimentacion K y la ganancia de observador Ke esta funcion nos ayuda mucho.

Bien aqui en octave:


Esto es el resultado para la matriz de ganancia K que es:

Aqui para el observador Ke, solo agregamos el valor de la matriz para L que son los polos del observador que estan localizados, las matrices de A y C ya estan pero para que funcione esto le agregamos una comilla para que solo agarre una sola linea:


Aqui el resultado que nos da

Ahora determinaremos la funcion de transferencia utilizando la funcion ss2tf:




La funcion del controlador observador es la siguiente:
octave:


Latex:


Ahora la función de transferencia del sistema dado en forma de espacio de estado es:




martes, 13 de noviembre de 2012

martes, 6 de noviembre de 2012

Reporte

Un sistema integrado de navegación y de control de movimiento para robots móviles autónomos multisensoriales

Una tarea esencial para el sistema de robot móvil es la navegación y control de movimiento. Las características de la percepción requeridas por el entorno de modelado o de control de movimiento son muy diferentes. Esto puede obtener utilizando básicamente varios sensores.

El sistema descrito en NMC(neuromuscular controller) integra la adquisición de datos simple, modelado, planificación, y el subsistema de control de movimiento. Un conjunto de reglas determina la estructura dinámica y el comportamiento del sistema y procides un hombre / máquina y el sistema de interfaz del sistema


Introduccion:
La investigación en robots móviles se inició en los años sesenta con el trabajo pionero del Instituto de Investigaciones de Stanford. Dos versiones de Shakey, un robot móvil autónomo, fueron construidos en 1968 y 1971. El principal objetivo de este proyecto fue "para estudiar los procesos para el control en tiempo real de un sistema de robot que interactúa con un entorno complejo". De hecho, los robots móviles fueron y siguen siendo un apoyo muy cómodo y eficaz para la investigación de inteligencia artificial orientadas en robotica

Shakey:


Un segunda tendencia bastante diferente de la investigación se inició en torno a la misma época. Su objetivo era resolver el problema de la locomoción robot-vehículo en terrenos difíciles. Los trabajos se centran en el diseño y el estudio de la cinemática y la dinámica de robots con multiples piernas.

HILARE, un robot móvil
El proyecto hilare se inició a finales de 1977 en LAAS. El objetivo del proyecto es llevar a cabo la investigación en general en la robótica y la percepción de un robot y su planificación. Un robot móvil se construyó para servir como un medio experimental.

La infraestructura física
El vehículo tiene tres ruedas, como se muestra en la imagen siguiente. Las dos ruedas traseras son impulsadas por motores paso a paso y la rueda delantera es libre. Esta estructura es simple, pero permite que el robot pueda realizar trayectorias tales como líneas rectas, círculos y clotoides(espirales).


Percepción sistema
A syste multisensorial proporciona el robot con la información que necesita acerca de su medio ambiente.

Percepción ultrasónico

El sistema tiene dos funciones:

1.- Una función de alarma que advierte al robot de la vecindad cercana de algún objeto. La reacción del robot es por lo general para llegar a una parada completa si mueve.

2.- Un circuito cerrado de función local evasión de obstáculos. En este modo el robot utiliza los datos de alcance para moverse a lo largo de un objeto, maniobrando para permanecer a una distancia fija de su superficie

VisiónUna cámara y un láser son el sistema de percepción principal. El láser se puede utilizar en el modo de exploración, o se puede medir rangos.

Posición referenciasLa posición se puede conseguir ya sea con relación a los objetos y los patrones específicos de entorno o en un marco construido de referencias.

La toma de decisiones y el control de ejecución
Una cuestión importante que surge en el área de investigación de la organización del sistema de toma de decisiones es el grado de distribución de decisión en el sistema, el grado de descomposición del sistema en módulos independientes, y su nivel de abstracción.

Referencias:
http://cyberneticzoo.com/wp-content/uploads/2010/10/HILARE-Robot-Research.pdf

Imagen: http://cs.stanford.edu/groups/manips/research/neuromuscular-control

Expresión ω-regular

Para ésta tarea se pidió que se creara una expresión ω-regular y a partir de ella creáramos un NBA (Nondeterministic Büchi Automaton).

Ésta expresión debía cumplir con 2 reglas:
  • Contar con 2 o más operadores(AND, OR, NOT, etc).
  • Contar con 2 o más símbolos( +, *, etc)
Mi expresión w-regular es la siguiente:


La NBA es la siguiente:


Referencias:
http://es.wikipedia.org/wiki/Expresi%C3%B3n_regular

jueves, 1 de noviembre de 2012

Reporte 5

El problema que se escogio es el siguiente:

De la siguiente imagen que muestra un diagrama de bloques de un sistema de control de procesos. Determina el rango de ganancia K para la estabilidad.

creamos nuestra funcion de transferencia que es la siguiente:



ahora para resolver el problema convertiremos las s por jw, asi nos queda nuestra funcion:

ahora empezamos a resolver nuestra funcion y tenemos que:

e^jw = (cosw -jsinw)(1 - jw)

entonces nos queda asi:


resolvemos de nuevo y nos queda asi:



por la configuración de la parte imaginaria de G (jw) igual a cero, obtenemos que:

sin w + w cos w = 0

o

w = -tan w

esto gracias a las funciones de equivalencias.

resolviendo esta ecuación para el valor positivo más pequeño de w, se obtiene que:

w = 2.029

substituyendo  w = 2.029 en G(jw)


el valor crítico de K para la estabilidad se puede obtener dejando que

G(j2.029) = -1 

o

0.4421 K = 1


Así con esto, el rango de ganancia K para la estabilidad es:

2.262 > K > 0

Code steganography

This code is only to encrypt the image

Here the code:

martes, 30 de octubre de 2012

Reporte #3

Aqui tenemos nuestra funcion de transferencia, ignoraremos unas variables por ser constantes y asi es como queda:


Ahora probaremos esta funcion con distintas entradas de temperatura ya que dependiendo de la temperatura mandara voltaje para prender los ventiladores.

Probaremos con las siguientes temperaturas:
10°
30°


Al parecere mi funcion no hay tanto cambio ya que con los diferentes temperaturas que e puesto salen los resultados anteriores.


La siguiente es una distorsion con una entrada en exponencial


Aqui probamos los polos y ceros de nuestra funcion y esto es lo que nos arroja octave:



Algo indispensable en los sistemas de control, es determinar el grado de estabilidad de mismo.
"Un sistema de control es estable si ante cualquier entrada acotada, el sistema genera una salida acotada"

Criterio de estabilidad de Routh.Este criterio sirve para determinar si es o no estable un sistema de control. Su funcionamiento se basa en la ecuación característica, la cual es la ecuación en el denominador dentro de la función de transferencia.

El objetivo de este criterio es determinar si la ubicación de las raíces de la ecuación esta dentro de la región estable en el plano s.


En nuestra imagen anterior los polos quedaron en los negativos por lo que se puede deducir que la funcion es estable.

nyquist en mi funcion:

En los valores que se dieron en las funciones anteriores fueron inestables

Sistemas de transicion

En esta entrada se modelara un sistema simple y lo representáramos mediante un sistema de transiciones o un grafo de programa, y para mas puntos si se queria, crear la representación en PROMELA. 

El sistema a modelar es la de un microondas:

Componentes.

  • Microondas: Este aparato funcion simplemente al oprimir los botones numericos y al darle en aceptar comienza a calentar la comida mediante giros.
  • Tabla numerica (para el tiempo de calentado): Esta parte del microondas es la que permite al sistema realizar su trabajo ya que si no se presiona un tiempo y al boton aceptar este no hace su trabajo
  • Personas: Este componente no forma parte del microondas (sistema) se implemento ya que sin el las entradas al microondas no serian posibles. Lo que hara es meter la comida y darle tiempo al microondas y oprimir aceptar para que esto funcione.
Microondas:

  • Estados:
-Standby: El microondas permanece esperando a que pongan comida
-Comida: La comida entra y se espera a que el tiempo acabe para calentarla.
-Calentando: El tiempo comienza y se inicia calentar, al terminar el microondas hace un sonido de terminado.
-Fin: La comida es devuelto caliente a la persona, y se regresa al estado de inicio.
  • Acciones Involucradas:
-Insertar comida: La persona inserta la comida al microondas.
-Teclea_tiempo: Se teclea el tiempo y se presiona aceptar para comenzar a calentar.
-Sonido: El microondas realiza un sonido para decir que a acabado

Aqui parte del grafo:

Tabla numerica
  • Estados:
-Inicio: La tabla numerica tiene un pequeño display donde muestra la hora a la espera de la hora.
-Timer: Al precionar aceptar, el timer hace una cuenta hacia atras hasta terminar calentando la comida.
  • Acciones Involucradas:
-Sonido: para poder sacar la comida.
-btn aceptar: Teclear el tiempo deseado y y oprimir aceptar para que empiece a calentar.

Aqui parte del grafo:

Persona:
  • Estados:
-Inicio: La persona se encuentra sin hacer nada hasta que le de hambre.
-Espera: La persona espera a que la comida este lista.
  • Acciones Involucradas:
-Insertar comida: La persona inserta la comida al microondas.
-Sonido/cancelar: La persona espera o cancela para poder sacar su comida.

Aqui la parte del grafo:

Estados:
0, 1 = Estados del componente Persona (Inicio, Espera)
A, B, C, D = Estados del componente Tostador(Standby, Comida, Calentando, Fin)
X, Y, Z = Estados del componente de las teclas (Stanby, Esperar, Sonido)

Acciones:
1, 2, 3, 4: meter_comida, sonido, Teclear, cancelar

Aqui el grafo completo:



jueves, 25 de octubre de 2012

Extra points

what will be done with this problem is to know if a group with the theory of gruop.

Problem to solve

2 + 3 = 10
8 + 4 = 96
7 + 2 = 63
6 + 5 = 66
9 + 5 = ?

Solution to problem:

2 + 3 = 10 (2+3=5(2))
8 + 4 = 96 (8+4=12(8))
7 + 2 = 63 (7+2=9(7))
6 + 5 = 66 (6+5=11(6))
9 + 5 = ? (9+5=14(9))
 
Result:
9 + 5 = 126



Associativity:
a \circ (b \circ c)=(a \circ b) \circ c, \forall a,b,c \in G


this point is not met and the order matters of factors in this problem, the result is not the same.

Neutral element:

 \exists e \in G : e \circ a=a \circ e=a

This time this point is not met because the result set given in the problem are not equal to the sum of any factor.


Symmetrical element: 
 \forall a \in G\quad \exists a^{-1} \in G : a\circ a^{-1}=a^{-1} \circ a=e


At this point I think it's obviously not apply to what is being done on the problem

Group:
A group is a set G which has defined an internal composition law that satisfies the above axioms.

Then this, problem is not a group because don´t meets with some requeriments, do as explain his definition.

This is of wikipedia now i try explain of the pdf of Elisa Schaeffer:

Identity:
                                                  e°g = g°e = g

this is not true since we have to
a(a + b) = c
a(a + e) is different from c

Reverse:
so if there is no identity, can not be reversed and also used "e"



Associativity:
the associativity is not because we
a (a + b) = c
Not the same that
b (b + a) = c

Closing:
this point is correct because it says that if g ° h belongs to G
And that g, h belongs to G
Are integers
If you multiply
You get a whole number


Then we come to the same conclusion on this problem is not a group

Well, I hope that the result is the desired and sorry for my bad english. 


References:
http://es.wikipedia.org/wiki/Teor%C3%ADa_de_grupos

Panama Stream cipher

Introduction:
Panama is a cryptography primitive which can be used both as a hash function and a stream cipher. Based on StepRightUp, it was designed by Joan Daemen and Craig Clapp and presented in the paper Fast Hashing and Stream Encryption with PANAMA on the Fast Software Encryption (FSE) conference 1998. The cipher has influenced several other designs, for example MUGI.
The primitive can be used both as a hash function and a stream cipher. The stream cipher uses a 256-bit key and the performance of the cipher is very good reaching 2 cycles per byte.
As a hash function, collisions have been shown by Vincent Rijmen et al. in the paper Producing Collisions for PANAMA presented at FSE 2001. The attack shows a computational complexity of 2^82 and with negligible memory requirements.
At FSE 2007, Joan Daemen and Gilles Van Assche presented a practical attack on the Panama hash function that generates a collision in 2^6 evaluations of the state updating function.
Guido Bertoni, Joan Daemen, Michaël Peeters, and Gilles Van Assche proposed, at NIST's 2006 Second Cryptographic Hash Workshop, unveiled a Panama variant called RadioGatún. RadioGatún is strictly a hash function; it does not have the known weaknesses that Panama's hash function has.


Structure of Panama



Panama contains two main elements. A shift register, with 32 cells, each containing a vector with eight 32-bit words, and a recirculating mixing function, resembling the f-function in a block cipher, which operates on a "state" consisting of seventeen 32-bit words. (While it has been noted that SHA-1 inspired Panama, I do not find the resemblance obvious.)

There are three fundamental operations that form part of Panama:
  • Panama is reset by setting both the 17-word state and the contents of the shift register to all zeroes.
  • A vector of eight 32-bit words is fed to Panama through a Push operation. Operations unique to the Push function are shown by the light dotted lines in the diagram. In a Push operation, the incoming vector is used as one of the inputs to the state transition function (the other input is the contents of one of the cells in the shift register), and is also used to XOR with the recirculating values in the shift register.
  • A vector of eight 32-bit words is recieved from Panama by means of a Pull operation. The line of alternating dots and dashes shows the operations unique to the Pull function in the diagram. In a Pull operation, the 32-bit words numbered 9 through 16 in the state are used as the output, and words 1 through 8 are XORed with the recirculating values in the shift register. The inputs to the state transition function both come from stages in the shift register, one not used for any special purpose in the Push operation replacing the input, absent from a Pull operation.
When Panama is used as a stream cipher, first the key is input by one Push operation, and then an initialization vector is input by a second Push operation. Then, 32 Pull operations are performed, discarding their output, to allow the internal state of Panama to be fully mixed.

When Panama is used as a hash function, the message to be hashed, followed by a 1 bit and as many zeroes as are needed to cause the message to occupy an integer number of 256-bit blocks, is input to Panama through a series of Push operations. Then, after a number of Pull operations with their output discarded, so that the effects of even the last block of the message are fully diffused, the output from a final Pull operation constitutes the hash.

The state transition function of Panama operates on 17 32-bit words, numbered 0 through 16. Its steps are visible in the diagram, and are, in order:
  • Nonlinearity: each word is XORed with the OR of the previous values of the next word and the complement of the word after, going around the circle from word 0 to 16 and back to 0.
  • Bit Dispersion: first, the words are transposed (by a simple decimation with interval 4), then the words undergo circular left shifts of different sizes.
  • Diffusion: each word is XORed with both the previous values of the next word and the word four positions ahead, again going around the circle.
  • Buffer Injection: Word 0 is XORed with 1; words 1 through 8 are XORed with the first input to the function, and words 9 through 16 are XORed with the second input to the function.


The Panama Stream Encryption Scheme
The stream cipher is initialized by first loading the 256-bit key K, the 256-bit diversification parameter Q, and performing 32 additional blank Pull iterations. During key-stream generation, an eight-word block z is delivered at the output for every iteration. In practice, the diversification parameter allows for frequent resynchronization without the need to change the key.

Vulnerabilities
The first thing to note is that the presence of the blank rounds makes it hard
to produce a collision in the digest if there is a difference in either the state or
the buffer after all the message blocks are input. Due to the invertibility of the
state updating function such a difference will not cancel out. Moreover, the lack
of external input and the propagation properties of the state updating function
give the attacker almost no control over the final difference. Therefore, our goal is to produce a collision in both the state and the buffer before the blank rounds.
We produce a collision by following a trail. Two instances of Panama process
two different messages (p and p + dp), which have a given difference (dp). The
trail also specifies the differences in the state (da) and in the buffer (db) between the two instances of Panama, at each round. So, not only the two messages must have the given difference, they must also produce the right difference in the state and in the buffer.
We shall now describe the general structure of the trail used in the scope of
this article. We will first talk about the sequence of message differences, then
about the differences in the state.
In the sequel, the round numbers are specified between brackets in super-
script: ·(i) . The convention is that p(i) is the message block processed during
round i, and a(i) is the value of the state after round i.



Tracing the path of information through the state transition function of Panama shows that a trivial application of differential cryptanalysis principles does not suffice to obtain some bits of the buffer by means of a known plaintext attack on Panama when used as a stream cipher. The following diagram illustrates what happens when an attack is attempted:

With known plaintext, one knows the value of the output bits from Panama. If one has two successive output blocks from Panama, tracing through the state transition function leads to the following results:

Initially, words 9 through 16 of the state are known.
After the nonlinearity step, words 9 through 14 of the state are still known for certain. The bits of word 15 which correspond to 1 bits in the former value of word 16 are known as well, but the other bits of word 6 are unknown. The bits of word 16 are, with a probability of 75%, the inverses of their former values.
After the bit dispersion step, the words known with certainty are words 2, 4, 9, 11, 14, and 16, and the words about which partial information is available are words 7 and 12. The right words in the right places are not available to allow a known or partly known word to exit the diffusion step for comparison with a word known from the current output block, by which means some buffer contents could be found.
Even so, the fact that it comes this close to solution makes one wary of the danger of a differential attack.



References:
http://en.wikipedia.org/wiki/Panama_(cryptography)
http://www.quadibloc.com/crypto/co4821.htm
http://www.cosic.esat.kuleuven.be/publications/article-81.pdf