Archive for May, 2008|Monthly archive page

An Inconvenient Truth

     We are now in the 21st century. We have computers at our desk, which perform complex tasks in milliseconds. We have cell phones which enables us to communicate with our dear ones thousand miles away. We have internet which has virtually shrunk the whole world into a single entity. We have fast cars, latest gadgets, and what not to make our lives comfortable. We have technically advanced!

 

     Everyday, each of us work in a direction to make human life more comfortable. Every new invention is targeted to reduce the human effort in some way or other. Just imagine the days, when there were no computers, no radio/televisions, no electricity, and no automobiles. We just wonder how people would be living then.

 

     The industrial revolution has brought in drastic changes in the lifestyle of people. But wait! In the process of making life comfortable, are we neglecting something? Yes. We have ignored our environment. We have ignored our world. The same world where we are living. The very same world which provided us with the resources such as water, air, climate for our survival. All our technological advancements have adversely impacted our nature. And when the nature cant take it anymore, none of us can face its wrath.

 

     This post is inspired by the documentary film ‘An Inconvenient Truth ’ which addresses the issues of global warming. The film highlights the major contributors to Global warming and its effects which can be found here . The film ends with a positive note, giving a few simple but effective steps to check global warming which can be found here .

 

     I believe that we can save our world if each of us contributes. But what stops us from following these simple steps? The below phrase explains it very well.    

"It is difficult to get a man to understand something when his salary depends upon his non understanding it"  – Upton Sinclair.

Five Point Someone : Book Review

     What actually got me to this book was the hype around it. The book was released in 2004 and remained as the bestseller till 2007. That was enough for me to grab a copy and start reading. May be I m very late in reading the book. I should admit that, to quite an extent, the book lived up to my expectation. Chetan Bhagat (IIT+IIM), the author, has the ability to narrate the story in a very lucid manner. The book has around 270 pages and can be completed within half a day. And once you start reading this book, I m sure you will not stop until you finish – all at one go J

 

     The story is that of three friends who join for Mechanical Engineering at IIT, Delhi. Hari is the narrator of the story. He often finds Viva terrible and lands up in soup as he is not able to answer the questions in spite of knowing the correct answers. He falls in love with Neha, the daughter of HOD of Mechanical Dept. Ryan is a tall, handsome and smart guy who hates mugging. He is innovative in nature. He often comes up with new designs in class but is pushed to follow the conventional designs by the professors. He gradually starts hating professors and stops attending classes. Then there is Alok, who comes from a very poor financial background. He aspires to become an artist, but then decides to study hard and join IIT so that he can get a good job in future and support his family. His father is not well and is undergoing treatment for paralysis and his mother is the only earning member.

 

     Ryan, who finds IIT curriculum uninteresting, decides to break the whole system. He finds it useless to mug up five to six courses a semester. He comes up with new strategy – Co-operate to Dominate. Hari and Alok become followers of Ryan and soon they start spending most of their time boozing, fagging and watching movies. When things go out of control, they decide to steal the question paper from HOD’s room and end up getting caught. Their life is in a total mess now. How do they come out of that situation? That’s the climax of the story.

 

     The title ‘Five Point Someone’ indicates the relative grading system in IITs. Five pointers are the worst performers in the class and are generally ignored by all the professors. The incidents, the characters, the plot everything is described very well. The book explains ‘What not to do at IIT’. Ironically you will find those ‘not to do’ things interesting. Overall it was a nice read. I am looking forward to read ‘The 3 mistakes of my life’.

Mussanje Maathu : Movie Review (Kannada)

    It was quite sometime since I watched a movie in theatre. So I referred TOI ratings for movies released during the week, and to my surprise Mussanje Maathu (Kannada), had scored over Jannat (Hindi) and Chronicles of Narnia (English). The TOI rated it 4/5, meaning very good. So I decided to give it a try.

 

    The movie cast includes Sudeep, Ramya and Anuprabhakar. In the first scene, Sudeep meets Ramya in a train (remember Jab We Met?). But quite opposite to Jab We Met, the heroine is in a state of depression here and hero tries to console her. The JWM similarity ends there.

 

    Sudeep is an RJ at Radio Mirchi and ‘Mussanje Maathu’ is a show run by him in the evenings where depressed call him up & share their problems (remember Lage Raho Munnabhai?). So expect lot of sentimental sequences in the movie. The movie runs slow at times and Sudeep fails to impress like Sunjay Dutt in Lage Raho. The script is to blame here.

 

    I am not going to disclose further story. Mahesh, the director of the movie has done a decent work in his directorial debut. The storyline is good. Sudeep is superb in his role. The only drawback is that the emotional scenes, which are in plenty, could have been handled in a much better way.

 

My rating – 3/5 (Average)

Shah Rukh, Shah Rukh Everywhere!

Have you tried counting how many times you have a glimpse of Shah Rukh Khan everyday? Start your day reading newspaper – he is there promoting his band KKR or spreading the smile with Sunfeast! If somehow he gets missed there, Bollywood section is sure to bring him in. On your way to work/study, you can’t avoid seeing him on hoardings of Nokia / Airtel. And these make sure you don’t miss them – at the traffic signals, the underways and alike. Off you go to shop and lo! He’s there on the wrappers as one of a brand’s ambassador.

 

Then you decide to catch up with a program on the TV in the evening, It’s no wonder that he appears in every second commercial these days. Here is a list of commercials Shah Rukh can be currently seen in, with his quotes.

 

  1. Nokia – Dus saal se mera sathi (?!), Hamaara Nokia.
  2. Sunfeast – He can be seen in the ad cooking biscuits.
  3. Airtel – Garv se bolo, Hello !
  4. HP Compaq Presario - Yeh Hui Na Baat
  5. Belmonte – Welcome to the Belmonte academy of style.
  6. Dish TV – Thoda aur wish Karo ! Dish Karo !
  7. Hyundai i10 – Don’t just follow, Catch the i.
  8. Pepsi – He is portraying a dumb and funny character here being the brother of Deepika Padukone. This one is my favourites among the lot :-) .
  9. Videocon – Match On, toh Videocon .
  10. Emami Fair and Handsome – He is shown helping a guy, to look handsome.
  11. Navratna Cool Talc – Duniya Ka Sabse Chhota AC.

 

And now you take up for some cricket action in IPL, then our King Khan can be seen there too cheering for his team Kolkata Knight Riders. And by chance if u decided to watch a reality show, our SRK is anchoring on Star Plus for “Kya Aap Panchvi Paas se Tez Hain”! But this time, the IPL ruins the show’s TRP. Now Shah Rukh is in a fix. Will he want people to watch his ‘Paanchvi Paas’ or IPL ? Shah Rukh vs Shah Rukh, mind it!. May be he wants people to choose IPL over ‘Paanchvi Paas’ since his money is invested there.

 

By the way I haven’t mentioned his movie presence anywhere in this post. So willingly or not, having to see Shah Rukh so many times in a day, aren’t we taking slightly an extra dose of Shah Rukh everyday ? ;-)

PID Controller Simplified

This is an attempt to explain PID controller with minimum use of maths.

A simple closed loop control system consisting of a controller and a process (or plant) is shown below.

The input to the system is the ’setpoint’, ie the desired output. The input to the controller is the error.

Error = Present Output – Setpoint.

The two steps in the design of a control system are -
1. Mathematically model the plant to be controlled.
2. Design the Controller.

The block diagram of a PID controller is shown below –

A PID controller consists of a Proportional element, an Integral element and a Derivative element, all three connected in parallel. All of them take the error as input. Kp, Ki, Kd are the gains of P, I and D elements respectively.

The best way to understand something is by simulating it. So I simulated a PID controller in matlab. The matlab code is provided at the end of this article.

Let me assume a suitable mathematical model for the plant and then go ahead with designing the controller.

Let the transfer function of the plant be 1 / ( s^2 + 20s + 30 ).

The step response of a system is the output of the system when the input to the system is a unit step. The open loop step response of the above plant is –
(Click on the image to get an enlarged picture)

It can be seen that the step response output is close to 0.035. The steady state error = 1-0.035 = 0.965. That’s quite high! Also observe that the settling time is around 3 sec.

Now lets see what is the effect of PID controller on the system response.
Lets see the effect of proportional element on the system output.

Keeping Kp = 10, Ki = 0, Kd = 0 the step response of the system is

The output is now 0.25. Much better than the open loop response! (The curve in red shows the open loop step response of the plant)

Now let me increase the Kp further and observe the response.
Keeping Kp = 100, Ki = 0, Kd = 0 the step response of the system is

The output is now 0.77. So it’s clear now that increasing Kp will reduce the steady state error.

Keeping Kp = 200, Ki = 0, Kd = 0 the step response of the system is

The output is around 0.87. Also observe that the ripples have started appearing in the output. If Kp is increased further it will only lead to increase in ripples or overshoot. The rise time also has decreased. Also observe that there is a small steady state error (1 – 0.87 = 0.13).

Conclusion –
Increasing Kp will reduce the steady state error.
After certain limit, increasing Kp will only increase overshoot.
Kp reduces rise time.

 

Now lets keep Kp fixed. Lets start varying Ki.

Keeping Kp = 200, Ki = 10, Kd = 0 the step response of the system is

The output is now close to 0.99. That’s very close to the setpoint. But observe that settling time has increased.

Keeping Kp = 200, Ki = 200, Kd = 0 the step response of the system is

Observe that rise time has now reduced and steady state error is very small.

Keeping Kp = 200, Ki = 300, Kd = 0 the step response of the system is

Observe that steady state error is close to 0 now. But increasing Ki has resulted in overshoot.

Further increasing Ki will only increase overshoot.

Conclusion –
Ki eliminates the steady state error.
After certain limit, increasing Ki will only increase overshoot.
Ki reduces rise time.

 

Now lets Keep Ki fixed and start varying Kd.

Keeping Kp = 200, Ki = 300 and Kd = 10.

Wow! What a response! Where is the overshoot? It has disappeared. There is a reduction in settling time as well.

Increasing Kd further will only result in response getting worsened.

Conclusion –
Kd decreases the overshoot.
Kd reduces settling time.

 

So the ideal PID values for our plant is Kp = 200, Ki = 300 and Kd = 10.

The above process is known as manual tuning of PID.

Here is the matlab code used to simulate PID –
(The below code is written by me. So please let me know if you find any bugs!)

num=1;
den=[1 20 30];
Plant = tf(num,den);
step(Plant,’r');
hold on;

Kp=200;
P_Sys = tf(Kp,1);

Ki=300;
den2=[1 0];
I_Sys=tf(Ki,den2);

Kd=10;
num3=[Kd 0];
D_Sys=tf(num3,1);

PI=parallel(P_Sys,I_Sys);

PID=parallel(PI,D_Sys);

OpenLoop=series(PID,Plant);

ClsdLoop = feedback(OpenLoop,[1]);
step(ClsdLoop,’b');