source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/opt/yalmip/demos/stabilityex.m @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 853 bytes
Line 
1clc
2echo on
3%*********************************************************
4%
5% Lyapunov analysis using semidefinite programming
6%
7%*********************************************************
8
9% Create a stable matrix
10A = [-1 2;0 -2];
11pause % Strike any key to continue.
12
13% Create symmetric matrix (full syntax)
14P = sdpvar(2,2,'symmetric');
15pause % Strike any key to continue.
16
17% Add SETs for stability
18F = set(P>eye(2)) + set(A'*P+P*A<0)
19pause % Strike any key to continue.
20
21% Find feasible solution, minimize trace(P)
22solution = solvesdp(F,trace(P));
23pause % Strike any key to continue.
24
25% Extract numerical solution
26P_feasible = double(P);
27
28% Check solution
29eig(P_feasible)
30eig(A'*P_feasible+P_feasible'*A)
31pause % Strike any key to continue.
32
33% Checking the constraints can also be done with
34checkset(F)
35
36pause % Strike any key to continue.
37echo off
Note: See TracBrowser for help on using the repository browser.