
% invoke the help command for the exponential matrix
 help expm

 % type in the A matrix
 A = [0     -.00156  -0.1711  0    0       ;
      0     -.1419    0.1711  0    0       ;
      0     -.00875  -1.102   0    0       ;
      0     -.00128  -0.1487  0    0.00013 ;
      0      .0605    0.1487  0   -0.05911];
 
 % specify the time t
 
 t = 2;
 
 % compute the product A times t
 
 At = A*t

 % compute the exponential matrix
 
 ex = expm(At)
 % now learn about computing eigenvalues and eigenvectors
 
 help eig
 % compute the eigenvalues and eigenvectors of A
 
 [v,d] = eig(A)
 % learn about the step response program
 
 help step
 % learn about the state space system
 
 help ss
 % define an appropriate B so that all initial controls are initiated
 % with a value of 0.2 simultaneously
 
 % input the original B matrix
 
 B = [0     -0.143  0       ;
      0      0      0       ;
      0.392  0      0       ;
      0      0.108 -0.0592  ;
      0     -0.0486 0      ];
 % define a new B so that all controls are 0.2 in value
 
 s = [.2 .2 .2]';
 BB = B*s
 % define the C matrix
 
 C = [1 0 0 0 0;
      0 0 0 1 0;
      0 0 0 0 1];
 % define the D matrix 
 D = [0 0 0]';
 
 % set the final time
 
 tfinal = 30;
 
 % develop the ss system
 
 sys = ss(A,BB,C,D);
 
 % call the step program
 
 [y,t] = step (sys,tfinal);
 
 help plot
 
 % plot the output variables
 
 plot (t,y)
 title('Plot of y vector versus time')
 xlabel('time')
 ylabel('y vector components')
 help text
 text(20,.16,'y3')
 text(20,-.1,'y2')
 text(20,-1,'y1')
 
 % print the graph
 
 print
 
 % quit the matlab session
 



