%  MODIFY DISTURBANCE PARAMETERS

%  FILENAME: DISTPAR.M
%  DATE: October 1994
%  VERSION: 02
%  COPYRIGHT 1993, 1994 M.Gretzinger & T.Marlin
%            McMaster University   

% This m-file is called from STABLE.M. It sets up menu to allow user to
%       modify the disturbance parameters.

while 1
  clc
  disp('*************************************************************')
  disp('*           MODIFY DISTURBANCE PARAMETERS                   *')
  disp('*                                                           *')
  disp('*************************************************************')
  disp('')
  disp('SELECT THE APPROPRIATE MENU ITEM')
  disp('')
  disp('MODIFY...')
  disp('                               PRESENT VALUES')
  fprintf('1) Disturbance Gain, Kpd               %4.2f\n',kpd)
  fprintf('2) Disturbance Time Constant, taud1    %4.2f\n',taudist)
  disp('3) Return to main menu')
  disp('')
        
  m2 = input('Enter the desired selection:   ');
  
  if isempty(m2), break, end
      
  m2 = round(m2);
  if (m2<1) | (m2>3)
      disp('')
      disp('Not a valid selection')
      disp('')
      disp('Press ENTER to continue')
      pause;
  end    
  
  if m2 == 1
      junkkpd = input('Enter value for disturbance gain:  ') ;
      if isempty(junkkpd)
          junkkpd = kpd ;
      end
      kpd = junkkpd;

  elseif m2 == 2
      junktaudist = input('Enter value for disturbance time constant:  ') ;
      if isempty(junktaudist)
          junktaudist = taudist ;
      end
      if junktaudist < 0
         junktaudist = taudist;
         disp(' disturbance time constant must be nonnegative')
         disp(' press enter to continue')
         pause
      end
      taudist = junktaudist;

  else
      break
  end        % if m2
  
end    % while 1 (line 10)

