vview_demo

PURPOSE ^

VVIEW_DEMO - Demo of the VVIEW command.

SYNOPSIS ^

function vview_demo

DESCRIPTION ^

 VVIEW_DEMO - Demo of the VVIEW command.

 Choose between a number of examples illustrating VVIEW. Issues
 the command VVIEW(B,plim,pinv(B)) for various choices of B.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function vview_demo
0002   
0003 % VVIEW_DEMO - Demo of the VVIEW command.
0004 %
0005 % Choose between a number of examples illustrating VVIEW. Issues
0006 % the command VVIEW(B,plim,pinv(B)) for various choices of B.
0007   
0008   while 1
0009   disp(' ')
0010   disp(' 1. Random control effectiveness matrix B (1x5)')
0011   disp(' 2.                                       (2x5)')
0012   disp(' 3.                                       (3x5)')
0013   disp(' 4. Admire flight data')
0014   disp(' 5. HARV flight data')
0015   disp(' ')
0016   ch = input('Select example (leave blank to exit): ','s');
0017   disp(' ')
0018   
0019   switch ch
0020     
0021    case {'1','2','3'} % Randomize
0022     k = str2num(ch);
0023     m = 5; % No. of actuators
0024     B=randn(k,m);
0025     plim=[-ones(m,1),ones(m,1)];
0026     ratio = vview(B,plim,pinv(B));
0027     title('Random B')
0028     
0029    case '4' % Admire data - Härkegård PhD thesis, Sec 10.4
0030     B = [0    -4.24  4.24  1.48;
0031      1.65 -1.27 -1.27  0;
0032      0    -0.28  0.28 -0.88];
0033     
0034     plim = [-55 -30 -30 -30;
0035         25  30  30  30]'*pi/180;
0036     
0037     ratio = vview(B,plim,pinv(B));
0038     xlabel('Cl')
0039     ylabel('Cm')
0040     zlabel('Cn')
0041     title('Admire (3000 m, Mach 0.22)')
0042     
0043    case '5' % HARV data - Bordignon PhD thesis, Example 5-2
0044     B = [-4.382e-2 -5.330e-1 -1.100e-2;
0045      4.382e-2 -5.330e-1  1.100e-2;
0046      -5.841e-2 -6.486e-2  3.911e-3;
0047      5.841e-2 -6.486e-2 -3.911e-3;
0048      1.674e-2     0     -7.428e-2;
0049      -6.280e-2  6.234e-2     0    ;
0050      6.280e-2  6.234e-2     0    ;
0051      2.920e-2  1.000e-5  3.000e-4;
0052      1.000e-5  3.553e-1  1.000e-5;
0053      1.000e-2  1.000e-5  1.485e-1]';
0054     
0055     plim = [-4.189 1.833;
0056         -4.189 1.833;
0057         -5.236 5.236;
0058         -5.236 5.236;
0059         -5.236 5.236;
0060         -1.396 7.854;
0061         -1.396 7.854;
0062         -5.236 5.236;
0063         -5.236 5.236;
0064         -5.236 5.236]*1e-1;
0065     ratio = vview(B,plim,pinv(B)); % Ok, same result (13.7%)
0066     xlabel('Cl')
0067     ylabel('Cm')
0068     zlabel('Cn')
0069     title('HARV (10000 ft, Mach 0.3, \alpha=12.5^o)')
0070   
0071     otherwise break
0072   end  
0073   
0074   disp('---------------------------------------------------------------')
0075   disp(' ');
0076   disp(' Control effectiveness matrix: B ='),disp(' '),disp(B)
0077   disp(' Position limits: [umin umax]'' ='),disp(' '),disp(plim')
0078   disp(' Blue (outer) set: { v : v = B*u, umin < u < umax }')
0079   disp('  Feasible virtual control set with constrained allocation')
0080   disp(' ')
0081   disp(' Red (inner) set: { v : umin < P*v < umax } where P = pinv(B)')
0082   disp('  Feasible virtual control set with linear allocation, u = P*v')
0083   disp(' ')
0084   disp(sprintf(' Red to blue size ratio: %0.3g%%',ratio*100))
0085   disp(' ')
0086   disp('---------------------------------------------------------------')
0087   
0088   end

Generated on Wed 25-Aug-2004 14:38:35 by m2html © 2003