How to find out a suitable Lyapunov function?

In control theory, people are good at putting forward new control laws, many of which are derived from the use of a Lyapunov function. I am new to control theory, so could anyone give me an illustrative example about how to derive a control law or other similar applications by finding out a suitable Lyapunov function?

EDIT:
Since there are no general rules for deriving a Lypunov function, why not change this post to a big collection of "finding out a Lyapunov function to specific problems" so that anyone could learn from the experience? Anyone is welcome to write down their examples here so that others can obtain inspirations from them.


So actually a lot has been happening with Lyapunov functions, and a good source of this are the Underactuated Robotics notes.

In a nutshell, for linear systems, it is known that if a Lyapunov function exists, it is quadratic, like what @dantopa suggested. This means it can also be set up as an optimization problem which can directly deliver a valid Lyapunov function.
For arbitrary nonlinear functions, it's still an art form, but for polynomials which are sums of squares, you can also set it up as an optimization problem. This means for a lot of systems (generally smooth systems) you can take a Taylor expansion of your system to get a polynomial approximation, and find a Lyapunov for the approximate system.


Lyapunov functions are an art form. Hopefully you'll start with the canonical energy dissipation function $$ V(x,y) = \frac{1}{2} \left(x^{2} + y^{2} \right) $$

There are many examples on MSE such as this one:

Finding Lyapunov Function

A du jour pick from the web:

Lecture 4 — Lyapunov Stability


The way I have been taught, you can obtain appropriate Lyapunov functions by examining the physical dynamics of a system (obviously this is not a trivial problem depending on the system). This is covered well in texts such as: "Systems and Control" by Stanislaw H. Zak, and "Applied Nonlinear Control" by Slotine and Li.

Also, looking at the specific application to robotics there are many good papers demonstrating this. I took a graduate course in intelligent control recently, my course project was based around this paper (it's older, but still good): C.Kwan, F.L.Lewis, and D.M.Dawson, "Robust-Neural Network Control of Rigid-Link Electrically Driven Robots",IEEE Transactions on Neural Networks,vol.9,no.4,pp.581-588,1998.

In the paper I mention above, the authors choose to use the Inertia Matrix and Inductance Matrix (from the robot's mechanical and electrical dynamics) to define the Lyapunov function candidate. Both the matrices are positive definite, so it is a good starting point.