plotting lyapunov functions using matlab.pdf

2
Plotting Lyapunov Functions Using MATLAB © F.L. Lewis updated Tuesday, February 04, 2003 Example 1 Quadratic Lyapunov Function 2 2 ) ( y x x V >> 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 2 / ) cos 1 ( ) ( 2 x V >> x=[-4:.04:4]; >> y=x; >> [X,Y]=meshgrid(x,y); >> z=(1-cos(X))+(Y.^2)/2; >> meshc(X,Y,z)

Upload: mohammad-umar-rehman

Post on 30-Nov-2015

366 views

Category:

Documents


9 download

DESCRIPTION

How to plot Lyapunov functions in MATLAB

TRANSCRIPT

Page 1: Plotting Lyapunov Functions Using MATLAB.pdf

Plotting Lyapunov Functions Using MATLAB © F.L. Lewis updated Tuesday, February 04, 2003

Example 1 Quadratic Lyapunov Function

22)( yxxV ��

>> 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

2/)cos1()( 2�� �

���xV

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

Page 2: Plotting Lyapunov Functions Using MATLAB.pdf

Example 3 Slotine and Li p. 67

� � 2/2/)cos1(2)( 222���� �����

��xV

>> 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)