Tuesday, April 28, 2015

Convert rmvb to avi

To convert rmvb to avi, you may try:


#!/bin/bash
cd /home/username/films
for file in *.rmvb; do
  mencoder "$file" -oac mp3lame -ovc lavc -o "/home/username/films/avifilms/${file%.rmvb}.a$
done

where, the videos you want to convert is in "/home/username/films"

LifeHacker - find/burn subtitle

To find and burn subtitles to a movie, you may try lifehacker

please follow the link:
http://lifehacker.com/how-to-get-subtitles-on-your-digital-movies-489535336

Sunday, April 26, 2015

الرومان

من كتاب قصة الحضارة:ـ

أ- الجمهورية
ب - الثورة
ج - الملكية


في عهد الملكية - تدين أقل - انتشار الزنا و قلة الزواج - في الطبقات العليا: استخدام موانع الحمل الآلية و الكيميائية - في الطبقات العليا:  استخدام عمليات الإجهاض - الطبقات الفقيرة: زيادة النسل

الثياب

tunic
جميع الطبقات تلبسه

 

Toga جبة

يلبسه الأشراف في مجلس الشيوخ أو الألعاب

 


أما الامبراطور فيلبس طوجة أرجوانية


الخف البسيط، و هو شبه الشبشب بصباع مصنوع من الجلد
الحذاء الكامل من القماش والجلد، و كان يرتدى مع الطوجة في المناسبات


أما النساء فبعضهن كانوا يلبسون الخمار، والبراقع لتخفي الوجه، وبعضهن كانوا يزينون شعورهم




كانت الألعاب تقام في الاحتفالات بالأعياد الدينية أو المناسبات الخاصة بالامبراطور، وكان المجالدين من
 المسجونين و المحكوم عليهم بالإعدام يصارعون بعضهم في مبارزات فردية أو جماعية، ويتسلحون بالسهام أو الحراب أو الخناجر، وقد يلبسون الدروع، وقد يحاربون الحيوانات

كان المجتلد ذو أرض خشبية مغطاه بالتراب، فوقها شرفة  للشيوخ و الكهنة و كبار الموظفين، فوقهم مقصورة للامبراطور و الامبراطورة والأسرة الامبراطورية والحاشية، وفوقهم الأشراف، وكان يسمح لكل الأحرار بالمشاهدة

بعد فازباسيان صارت المجالدات تقام في الكولسيوم بدلا من المجتلد

18 july 64
 شب حريق في المضمار الكبير، وانتقل إلى  ثلثي المدينة لمدة 9 أيام
كان نيرون يريد أن يعيد بناء المدينة بشكل أكثر تنظيما، أشيع أنه متواطئ في حرق المدينة، لما وجد ذلك، اتهم المسيحيين بحرقها لأنهم كانوا يبشرون بزوال هذه الحياة الظالمة و استبدالها بحياة أفضل

أصدر على عدد من المسيحيين أحكام بالإدانة من غير دليل على حرقهم رومة، بل كانت التهمة هي كراهية الجنس البشري، ألبس بعضهم الجلود و تركهم للحيوانات تأكلهم، وصلب البعض، ودفن الكثير 

منهم أحياء، وأشعل في بعضهم النيران

صلب بطرس بالمقلوب في ملعب نيرون عام 64 في حلبة روما في ميدان الفاتيكان 

من كتاب مختصر تاريخ العالم :ـ
 " شرع نيرون يعتقل المسيحيين حيث يجدهم، ثم كانوا يعدمون بوحشية" وكانوام  يدفنون موتاهم في شبكة من الممرات تحت الأرض خارج أسوار المدينة، و أيضا  يتجمعون في هذه الممرات ليشجعوا بعضهم في أوقات الاضطهاد

Monday, April 13, 2015

Linear System Model

A) Linear system with one state variable, one input and one output

Any Linear system can be described through linear model as below:

  • Specify the state
    • ex: position (x)
  • Specify the inputs
    • ex: velocity (v)
  • Specify the output
    • ex: position (x)

You will have your system described as follows:
  • Differential equation







  • Output equation
y = x

B) Linear system with multiple state variable, one input and one output


Suppose that you have a linear system with:
  • State: x, y, PHI
    • i.e: x1 = x, x2=y, x3=Φ
  • Inputs: nu, PHI
    • i.e: u1 = nu, u2 = Φ
  • Output: x,y,PHI
    • i.e: y1 = x, y2=y, y3=Φ
You will have your system described as follows:





  • Differential equations


  • Output equations

The above equations can be written using Matrices as follows:

  • Differential equations


  • Output equations













in our example, C11, C22, C33 are equal to one, others are zeros


C) Nonlinear systems (Linearization)

If we have systems that are described by nonlinear differential equations, where you can find terms like:
  • x1*x2
  • x1*u1
  • cos(x3)
  • ...etc
We can linearize them around a certain point of operation (x0,u0)

  • Equations will be in the form:


We can linearize this around x0, u0 (specific state and specific input)







































Note, the above equations assumes that x0, u0 satisfies: f(x0,u0) = 0, h(x0) = 0






























Friday, April 3, 2015

Mobile Robots

Behaviors:

Mobile Robots Models:

(a) Differential Wheel Drive Model     --> Used for implementation (real model)
(b) Unicycle Model                               --> Used for design (more simple)

The following snapshot, is taken from the Glue Lecture of Lecture 2 of the Coursera course: Control Of Mobile Robots

where,

  • νr, νl: the angular velocities of the right and left wheel
  • c: the velocity of the robot
  • R: the radius of each wheel
  • Ф: the angle between the x axis and the robot direction
  • ω: the angular velocity of the robot (rate of change of Ф)
So, what we do is:
  • Use the Unicycle model for design (get: ν,ω)
  • Convert to the Differential Wheel Drive model from implementation (solve above equations -> get νr, νl from ν,ω )


Wheel Encoders:

They are wheel ticks counter, where the wheel has N ticks per revolution.
The wheel encoder counts the number of wheel ticks elapsed during rolling.

Knowing previous x,y,Ф and the readings of the wheel encoders, we can get the current x,y,Ф as follows:
The following snapshot, is taken from the Glue Lecture of Lecture 2 of the Coursera course: Control Of Mobile Robots



But, if the robot slipped, for example because it hit another robot, then its movement will not be related to the wheel encoder reading!

in this case, we shall use sensors (IR - Ultrasonic - LaserScanner - Camera - ...etc)

Behavior:

The robot may have one or more controllers (behaviors):

  • Go-To-Goal
  • Avoid-Obsatcles
  • Track-Target
  • ...etc
Mobile Robot Control Block Diagram:


The following snapshot, is taken from the Glue Lecture of Lecture 2 of the Coursera course: Control Of Mobile Robots





Thursday, April 2, 2015

Control Terms

System = something changes over time
Control = something that influence this change!

State = what the system is currently doing
Dynamics = how the state changes
Reference = what we want the system to do


System Dynamical Model

System:

  • Something changes (evolves) with time
Control:

  • Something which influences this change

Dynamical Model:

A dynamical Model of a system, is a model which describes how a system evolves with time.

To describe how a system evolves with time, or we can say changes with time:

we can use:
    • Differential Equation
    • Initial condition
Where:
    • It is known that the differentiation is something that describes change over time.
    • And, initial condition describes a specific state of the system.
Thus, with these 2 points, I can describe the system at a certain point of time, and I can describe how this system changes with time
          Hence, that's it, I described the system !

Solving the dynamical model, can be done:

A) Numerically:

By discretizing the time, I can use Taylor expansion:

X((k+1)*δt) = X(k*δt) + δt * X'(k*δt) + .... 

From the initial condition, we know X(k*δt)
From the differential equation, we know X'(k*δt) in terms of X(k*δt)

Hence, we can calculate X of k+1, from which we can get X of K+2, ... etc

B) Analytically (Integration):

To get the mathematical expression from the dynamical model:

    • Integrate the differential equation to get X(t) from X'(t)
    • Use the initial condition to get the integration constant

Equilibrium Point:

  • X'(t) = 0


PID Controller

Consider a car, that we control its speed to reach a reference speed = 70 km/hr

then, the error is:
e(t) = s(t) - 70
     , where s(t) is the speed of the car at time t

We will use gas/brakes to accelerate/decelerate the car according to this error.

u(t) = Proportional Part + Integral Part + Differential part
where if u(t) = +ve --> press gas to accelerate
and  if u(t) = -ve --> press brakes to decelerate

  • Proportional part = constant * e(t)
    • As long as there is an error, we will accelerate/decelerate the car the car
    • But, this term does not guarantee to reach Vref, yes, it guarantees to press the gas as long as there is error, but may be this gas consumed by friction of something like this.
  • Integral part = constant * Integration of e(t) over time
    • This part, depends on the accumulation of error, as long as the error accumulates, the gas will be pressed harder.
    • Alone, this term will not be sufficient, because it does not care about the current value of e(t)
      • ex: if e(t) = 0, at an instance of time, but the integration of error in the period (0 --> t) != 0, then the gas will still be pressed
Proportional part and Integral part shall be added together to reach and maintain Vref
  • Differential part  = constant * derivative (rate of change) of e(t)
    • If e(t) is increasing --> gas/brakes will be pressed harder
    • If e(t) is decreasing --> gas/brakes will be pressed softer
    • Alone, this part is not sufficient, because if e(t) is constant, this part will be Zero!

As far as I have seen:

  • The proportional part coefficient shall be the largest.
  • Then the Integral part coefficient
  • Then the differential part coefficient