source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/opt/yalmip/dev/tests-mbg/sos/test_sos_sjoberg.m @ 37

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

Added original make3d

File size: 562 bytes
Line 
1function test_sos_sjoberg
2
3% Regression for a problem in getexponentbase
4% that caused issues in matrix sos
5
6sdpvar x1 x2
7x = [x1 x2]';
8
9f = [x2;
10     -0.5*x1-0.5*x1^3-0.5*x2];
11
12g = [0; 0.5];
13h = x1;
14
15gam = 1.52;     
16
17% V = sum (c_i * x^something)
18z = monolist(x,4);
19c = sdpvar(length(z),1);
20V = c'*z;
21
22Vx = jacobian(V,x)
23
24HJI = [Vx*f + f'*Vx.' + h'*h, 1/gam*Vx*g;
25       1/gam*g'*Vx.' -1]
26   
27[sol,m,B,residuals] = solvesos( set(sos(-HJI)),[],[],c);
28residual = norm(getbase(replace(-HJI-m{1}'*B{1}*m{1},c,double(c))),'inf')
29
30mbg_asserttrue(residual < 1e-8);
Note: See TracBrowser for help on using the repository browser.