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

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

Added original make3d

File size: 637 bytes
Line 
1
2% MPC setting
3N =10;
4
5% Create numerics for a discretized double integrator
6A = [2 -1;1 0];
7B = 0.1*[1;0];
8C = [0.5 0.5];
9
10[H,S] = create_CHS(A,B,C,N)
11
12% Initial state
13x = [2;0];
14
15% Define free variables
16t = sdpvar(1,1);
17U = [intvar(10,1)]   
18
19% Define the prediction vector
20Y = H*x+S*U;
21
22% Control constraints (we add a tag for later)
23control_bound = 10;
24F = lmi('U<control_bound','Upper bound');
25F = F+lmi('U>-control_bound','Lower bound') ;
26% Terminal constraint
27F = F+lmi('Y(N)>-1'); 
28F = F+lmi('Y(N)<1');
29t = sdpvar(2*N,1);
30%F = lmi([Y;U]<t) + lmi(t>-[Y;U]);
31
32solvesdp(F,Y'*Y+U'*U,sdpsettings('verbose',0,'bnb.solver','sedumi'))
Note: See TracBrowser for help on using the repository browser.