100% found this document useful (1 vote)
1K views

Plotting Lyapunov Functions Using MATLAB PDF

This document provides 3 examples of using MATLAB to plot Lyapunov functions. The first example plots a quadratic Lyapunov function V(x)=x^2+y^2. The second example plots a Lyapunov function from Slotine and Li with V(x)=(1-cosq)+q^2/2. The third example plots another Lyapunov function from Slotine and Li with V(x)=2(1-cosq)+q^2/2+q^2+q^2/2. For each example, MATLAB code is provided to generate the variables and plot the function as a 3D mesh or contour plot.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
1K views

Plotting Lyapunov Functions Using MATLAB PDF

This document provides 3 examples of using MATLAB to plot Lyapunov functions. The first example plots a quadratic Lyapunov function V(x)=x^2+y^2. The second example plots a Lyapunov function from Slotine and Li with V(x)=(1-cosq)+q^2/2. The third example plots another Lyapunov function from Slotine and Li with V(x)=2(1-cosq)+q^2/2+q^2+q^2/2. For each example, MATLAB code is provided to generate the variables and plot the function as a 3D mesh or contour plot.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Plotting Lyapunov Functions Using MATLAB

F.L. Lewis
updated Tuesday, February 04, 2003

Example 1 Quadratic Lyapunov Function


V ( x) = x 2 + y 2
>> x=[-4:.04:4];
>> y=x;
>> [X,Y]=meshgrid(x,y);
>> z=X.^2 + Y.^2;
>> mesh(X,Y,z)

Example 2
Slotine and Li p. 63
V ( x) = (1 - cosq ) + q& 2 / 2
>> x=[-4:.04:4];
>> y=x;
>> [X,Y]=meshgrid(x,y);
>> z=(1-cos(X))+(Y.^2)/2;
>> meshc(X,Y,z)

Example 3
Slotine and Li p. 67
V ( x) = 2(1 - cosq ) + q& 2 / 2 + q& 2 + q 2 / 2

>> x=[-4:.04:4];
>> y=x;
>> [X,Y]=meshgrid(x,y);
>> z=2*(1-cos(X))+(X.^2 + Y.^2)/2 + (Y.^2)/2;
>> meshc(X,Y,z)

You might also like