                    INSTRUCTIONS for the program SYSAN. 

SYSAN is a program for the analysis of linear analog and discrete systems
with and without feedback.
The complete and unrestricted rights of the program belong to the author,
M.J. van den Oever, Gregoriusdonk 10, 4707 VA Roosendaal, the Netherlands.
Licensees can, in accordance with the licensing agreement, obtain certain
rights to the program. Violation of the licensing agreement will void this
agreement without any compensation for the licensee. The author reserves the
right for compensation from the licensee in case the licensee circulates the
program or parts thereof without written permission from the author.
The program is not copy protected, but it contains a personal identifica-
tion. This identification is shown in every program output. The identifica-
tion is stored in code in the file IDENT.FIL. The file IDENT.FIL must be in
the same directory as the the program SYSAN.EXE, otherwise SYSAN will not
start.

SYSAN was specially developed to run on PC's under the operating system MS-
DOS. The required memory capacity is 640 Kbyte.
A 8087 type numeric coprocessor is recommended. The program will automatic-
ally use the coprocessor if it is available.

The program is fully driven via menus and is ment to be used without other
instructions.

The program is multilingual. At the moment Dutch, German and English are
available. Via an independant language generator program, other languages can
be made available.
The selection of the default language is fully automatic.
You start the program with SYSAN LANGUAGE, in which LANGUAGE is omitted for
the default language.
The automatic language selection operates by means of the country number
that is given at the startup of the computer in the config.sys file. In
case config.sys does not provide a country number, the default language is
English. You can also create a default language by preparing a file with the
name DEFLANG.TXT and storing this file in the same directory with SYSAN.EXE.
As an example the file DEFLANG.TXT for Dutch is prepared with:
                         copy NEDERL.TXT DEFLANG.TXT
If you do not use the default language, you start SYSAN with
                         SYSAN NEDERLANDS for Dutch
                         SYSAN DEUTSCH for German
                         SYSAN ENGLISH for English.

The program delivers tables, mathematical expressions and graphics. All
output parts are complete on one screen. By means of Shift-PrtScr hardcopies
of tables and expressions can be obtained. The special command P yields
hardcopies of the graphics. The options command lets you choose between half
size and full size graphics copies.

The program is in color and adjusts itself automatically to the installed
graphics card.
The source program was written in Borland Pascal 7.0. All graphics cards that
can be handled by Borland Pascal 7.0 can also be handled by SYSAN.
It is possible to drive the program by mouse. You therefore should have
installed a mouse with a MicroSoft mousedriver.
The program has an extensive help function. At any place in the program,
except in graphics with activated cursor, you can call the dedicated
helpfunction with function key F1. At the moment the helpfunction is only
available in Dutch and English.
Depending on the particular graphic, the graphic can be provided with a grid
to facilitate reading or a cursor can be installed. The grid facility is
chosen with the options menu. Function key F4 installs the cursor.
Hard copies can be made on Epson compatible 9 pins dot matrix printers and
on HP laserjet and deskjet printers. The hard copy is a screen copy.
Therefore the resolution of the hard copy depends on the graphics card.
There are 2 print sizes: A5 (half size) over the width of the paper and A4
(full size) over the length of the paper. The choice is made in the options
menus.

If you wish, you may switch off all the menu directions in the tables,
expressions and graphs. In that case you may also provide the graphics and
the tables with a caption. The output is then more suitable for inclusion in
reports and other publications. This switching is done in the options menu.
Inputs, consisting of only one keystroke (commands), are executed im-
mediately. Inputs, consisting of more keystrokes (data), are to be concluded
with <Enter>.
                             Ŀ
                                 D  O  S    
                             
-------------------------------------------------------------------------
Ŀ
                                                                        
                         M  A  I  N   M  E  N  U                        

-----------------------------------------------------------------
Ŀ  Ŀ  Ŀ  Ŀ  Ŀ
                                        SYSTEM              
  INPUT      ROOTLOCI     FEEDBACK       DISPLAY      END   
        
      Ŀ  Ŀ   Ŀ  Ŀ      
       TIME        FREQUENCY                                   
        RESPONSE     ANALYSIS      MATRIX       OPTIONS        
                   
--------------------------------------------------------------------
                                                
      Ŀ  Ŀ          Ŀ
       GRAPHICS                            Save    
         OPTIONS    GRAPHICS            .DFL files 
                  
      Ŀ  Ŀ   Ŀ
       GRAPHICS  Ĵ  GRAPHICS      Save/Call 
         OPTIONS      OPTIONS    .STE files 
           
------------------------------------------------------------------------
Ŀ   Ŀ
  Call       COMPENSATOR
.DFL files     DESIGN   
   

The program starts in the main menu. In the maim menu the various parts of
the program may be selected either with the keys for the vertical cursor
movement and the <Enter> key or with with the key for the bold letter or
with the mouse and the left mouse button. In the same manner you make the 
selection in the other menus.

With the function key F6, system data may be changed from all program parts.
The changes concern the location of the poles and zeros, the value of the
coefficients of the denominator- and numerator polynomes, the corner
frequencies or the gain. The order of the transfer function cannot be
changed. After the changes via F6 the program returns to the program part
from where the change was initiated but with the new data.


The function key F8 reinstalls the menu of the subject program part.

The function key F9 directly selects the next menu item. Shift-F9 selects
the former menu item.

The function key F10 brings you back in the main menu.

The system parameters are the common data. The three main parts of the
program: TIMERESPONSE, FREQUENCY ANALYSIS and ROOTLOCI each work indepen-
dently with the system parameters without changing them (except with F6).
Transfer from one main part to another main part always goes via the main
menu.

Contents MAIN MENU:
                    System Input
                    Time response
                    Root loci
                    Frequency analysis
                    System Matrix
                    Close control loop
                    Display of system / page overview
                    Options
                              Input K or Kpz ?
                              Coord Cart or pol?
                              Program Instruc. ?
                              Grids in Plots ?
                              Print size ?
                    End of program - return to DOS


SYSTEM INPUT:
With the SYSTEM INPUT menu you may input the system data from the keyboard
or from the data files. Also the system may be enlarged by adding poles
and/or zeros.

Contents SYSTEM INPUT menu:
                    Poles and zeros
                    PoLynomials
                    Corner frequencies
                    Data from File
                    Append system

Input of systemdata.

The system transfer function can be presented with poles and zeros by

            s       s
           ( - 1)( - 1)....         
            z1      z2                  (s - z1)(s - z2)....
G(s)  =  K   =  Kpz 
            s       s                   (s - p1)(s - p2).... 
           ( - 1)( - 1)....
            p1      p2

or by the polynomial form
                  3      2
         ......b3s  + b2s  + b1s + b0
G(s)  =  
                  3      2
         ......a3s  + a2s  + a1s + a0

In the case of system input with poles and zeros, one has to select in
advance via the options menu whether K or Kpz will be input. The default
selection is K. 
The location of the poles and zeros in the complex plane is normally
input and shown in Cartesian coordinates. Through the options menu one
can opt for polar coordinates.
Besides system inputs by means of poles and zeros or polynomials, system
inputs may also be made through corner frequencies as is customary with Bode
plots. 
Including the driving function, the system can handle a maximum of 8 poles
and 8 zeros. Equal complex poles are not allowed. Up to 4 equal real poles
are permitted.
System data can also be input by means of state equations.
The allowable magnitude of the input poles and zeros depends on the order
of the transfer function. For the calculation of the absolute values of
complex variables one needs the square of the real and the imaginary parts.
Therefore highest power (= the order of the system) of the square of the
complex roots must be smaller than 10 to the power 38. If you use a transfer 
function of the order 8, then the absolute value of poles and zeros must be 
smaller than 10 to the power 38/16 (237). The real and the imaginary part 
must then be smaller than 0.52 times this value (167). If you exceed this 
limit, it will result in a runtime error 205.

Data from File:

With this menu item you may read system data from a disk file. These data
are stored through the save function of the 'Display of system/Data overview'
item of the main program. There is no difference between data read from disk 
and data input through the keyboard. 

TIME RESPONSE:
In this part of the program the time response of the system is calculated.
The input signal to the system is defined by its poles, zeros and gainfac-
tor.
In case of an analog system, the Z-transform of the sampled system with 
zero-order hold may be calculated. This Z-transform may be stored on disk 
so that it can be read later to perform further calculations with it.
This Z-transform is correct only when you start with the response on a unit
step.

Contents TIME RESPONSE menu:
                    Input signal
                    Laplace - partial fractions
                         or Z-transform - partial fractions
                    Time response - Expression
                    Time response - Table
                    Time response - Plot
                    Plot Options
                              Store plot
                              Fetch plot
                                      Verticals - discrete
                              Change main menu options
                                        Program Instruc. ?
                                        Grids in Plots ?
                                        Print size ?
                    Z-transform (analog systems only)


ROOT LOCI:
Breakaway points and root-locus points as a function of the gain factor may
be calculated. The gain factor is considered to be a separate proportional
controller with gain Kc. The root-locus plot is drawn by varying Kc from 0
to 10 000. Above 10 000 Kc is considered to be . The original DC system
gain remains unaltered. Of each root locus 100 steps are calculated. It may
occur that certain root loci are not entirely drawn, because either Kc
exceeds 10 000 or the amount of steps is 100.
The graphic display of the root loci can be explored by means of a cursor.
The root-locus plot can be detailed more by reducing the step magnitude
through the options menu. By doing so, there is a fair chance however, that
the complete root-locus plot is not visible anymore as the total number of
steps is limited to 100. The step magnitude should always be smaller than
the smallest distance between any poles and zeros.
The cursor location can be adjusted with the + and - keys of the cursor block
when the cursor is locked onto the root locus. By default the cursor step is
half the step of the root-locus calculation step. The cursor step may be
changed via the options menu. 
A first order lead or lag compensator can be designed with the Compensator
design program. First a dominant pole of the closed loop system, outside the
excisting root locus, is chosen. Thereafter a choice can be made between a
desired zero/pole ratio, a desired DC gain and an optimisation towards a
maximum bandwidth. Further details are available in the accompanying
help text.

Contents ROOT LOCI menu:
                    Breakaway points
                    Root locus - Table
                    Root locus - Plot
                    Root locus plot Options
                              Beginning of horizontal scale
                              End of horizontal scale
                              Step magnitude
                              Cursor Adjustment magnitude
                              Negative imaginary part of plot
                              Maximum gain
                              Constant Damping ratio
                              Unit circle (discrete systems)
                              Change main menu options
                                        Program Instruc. ?
                                        Grids in Plots ?
                                        Print size ?
                    Compensator design
                              Zero/pole ratio
                              DC gain
                              Optimise



FREQUENCY ANALYSIS:
In this part of the program the system frequency responses are calculated.
One can automatically determine phase and gain margins.
The 'date line' for the phase is -270,+90. This means that angles greater
than +90 are continued beyond -270 and vice versa.
The calculation of phase and gain margins succeeds only with monotonously
climbing or descending functions. If the phase or gain as function of the
frequency does not comply with this rule, the calculation may not converge.
Non convergence will be mentioned.
Bode plots, Nyquist plots and Nichols plots may be drawn. Where applicable,
these plots can be provided with a M and a N circle of specified value.
Approximation of the amplitude plot by straight lines and corner frequencies
can be shown. The phase plot can also be approximated by straight lines. For
single poles or zeros the straight line lies between 0.1*corner-frequency
and 0 and 10*corner-frequency and 90. For complex poles or zeros the
straight line approximation runs from

     -zta{1+0.35(1-z)}                zta{1+0.35(1-z)}
wn*10                    and 0 to wn*10                   and 180.

In case further details, of e.g. a Nyquist plot, are to be shown, the lowest
and/or the highest frequency should be adjusted via the Plot Options menu.

Contents FREQUENCY ANALYSIS menu:
                    Frequency response Table
                    Single frequency
                    Phase margin
                    Gain at phase Margin
                    Gain margin
                    Bode, Nyquist and Nichols Plot
                              Magnitude-frequency plot (Bode)
                              Phase-frequency plot (Bode)
                              Nyquist plot
                              Nichols Chart
                    Plot Options
                              Lowest frequency - rad/s
                              Highest frequency - rad/s
                              M - Circle
                              N - Circle
                                      Unit circle in polar plot
                              Change main menu options
                                        Program Instruc. ?
                                        Grids in Plots ?
                                        Print size ?

For instruction purposes you may start Bode plots (frequency-gain and
frequency-phase shift) with empty coordinates. In this way you can show the
asymptotes first and the real curves afterwards.

CLOSE CONTROL LOOP:
When closing the control loop, the system output signal is inverted and fed
back to the input of the system. Part of the gain, poles and zeros can be
relocated from the forward part of the loop to the feedback part of the
loop. By doing so, one can for instance determine the controller output
signal.

WARNING:
If the gain choice is K, then relocation of poles or zeros to the feedback
part of the loop means relocation of the terms
          s                    s 
     (1 - ) respectively (1 - ).
          p                    z
If the gain choice is Kpz, then the relocated terms are
     (s - p) respectively (s - z).
This influences the static gain of the feedback proces.
When poles and zeros of a discrete system are relocated, the controller
gain and the feedback gain are corrected in such a way that all static gains
of the control loop remain as is.

MATRIX:
In this program part system parameters may be input as state variables.
The state equations are shown in the form of matrices. The matrices are
defined for one output and one input of the system. Apart from supplying
system data in the form of state equations, the system data that are already
in the system can be shown as state equations. In that case you have the
choice between the controllable canonical form and the observable canonical
form. 
In the matrix menu you input the state data with function key F3.
New and modified state equations are transferred to the main program and the
system data are stored in the form of poles and zeros and of polynomials.
The state equations of an analog system may be transformed to a sampled
system with a zero order hold. You then obtain the Z-transform of the
sampled system.
The state equations may be saved on disk. To do so you select the menu item
'System matrices / page overview' and you save the data with F2. When saving,
a filename without extension must be entered. The matrix files automati-
cally obtain the extension .STE. The saved matrix files are called with the
menu item 'State data from file'.

Under the menu item 'Pole placement' you calculate the feedback vector K
that causes the selected poles of the feedback system. If you have made this
calculation, the calculations of the menu items 'Observer' and 'Reduced
observer' are extended to the calculation of an observer-controller. To be
able to check the robustness of the feedback system with an observer-
controller the program calculates (if possible) the phase and the gain
margins. Furthermore the data of the open loop system are saved on the 
scratch pad, so that it is always possible to perform a frequency analysis.

Contents MATRIX menu:
                    Input system matrices
                    System matrices from File
                    System matrices / Page overview
                              Existing state equations
                              Controllable canonical form
                              Observable canonical form
                              View pages
                    Pole placement
                    Observer
                         Reduced observer
                    Z - transform of matrices  (analog systems only)

SYSTEM DISPLAY / PAGE OVERVIEW
In this part of the program all system parameters, both as poles and zeros
and as polynomes are shown. Besides the active data, also past data are
stored and shown. There are 5 pages available for the storage of past data.
Those pages can be shown and made active. Each page has 4 subpages to store
system data in the form of coefficients of state equations. The latter may be
shown under the matrix menu.
With function key F2 you can save system data.
For demonstrations and repeated calculations on the same system it is recom-
mended to prepare the system data in advance and to store those data on
disk. There is no difference between data read from disk and data input
through the keyboard. Data files may be stored in and read from any direc-
tory.
To store or read the data a filename without extension has to be entered.
The files with the transfer functions automatically obtain the extension
.DFL. The matrix files obtain the extension .STE.


Graphics modes supported by SYSAN.EXE.

All graphics modes that are supported by SYSAN.EXE have a horizontal
resolution of either 640 dots or 720 dots.

The supported modes are:
     CGA       640 x 200
     MCGA      640 x 200
     MCGA      640 x 480
     EGA       640 x 200
     EGA       640 x 350
     EGA64     640 x 200
     EGA64     640 x 350
     EGAMono   640 x 350
     IBM5814   640 x 480
     HERCMono  720 x 348
     ATT400    640 x 200
     ATT400    640 x 400
     VGA       640 x 200
     VGA       640 x 350
     VGA       640 x 480
     PC3270    720 x 350

Only one graphics page is used.

It is not possible to automatically select IBM8514 or ATT400. There may also
be problems with automatic detection of some other graphics cards. This
problem occurs e.g. with the Tulip DGA system. Therefore it is possible to
override the automatic selection and to choose a particular graphics driver.
This selection can be made with the program INSTGRAF.EXE, that generates a
file BGI.SEL with a fixed driver selection. The contents of BGI.SEL is just
one line:
  GraphDriver(number)<space>GraphMode(number)<space>GraphDriver(name)
everything in accordance with Borland Pascal code.
If the selected driver in BGI.SEL is not equal to the PC video system, the
program will hang or show unreadable output. BGI.SEL can be deleted with
DOS, thereafter the driver selection is fully automatic again.

Monochrome monitors with a grey scale:
In computers with a monochrome monitor and a VGA videocard the text mode
colors presented in grey may give an unreadable result. In this case you can
switch to monochrome with INSTTEXT.

Graphics prints:
Graphics hardcopies are normally made with an Epson compatible 9 needles
matrix printer. If you want to make hardcopies with a monochrome HP printer
you need to have an empty file named DESKJET.INS in your working directory.
This file can be made with any text editer.


Contents of the disk (the demo version has not all these files):
      SYSAN . EXE       IDENT . FIL
        ATT . BGI       STATE . PIC
        CGA . BGI        16X8 . FON
     EGAVGA . BGI       14X9X . FON
    IBM8514 . BGI         4X6 . FON
       HERC . BGI        8X8X . FON
     PC3270 . BGI     ENGLISH . TXT
   NEDERLAN . TXT     DEUTSCH . TXT

   DESIGHLP . NED    DESIGHLP . ENG
   FEEDBHLP . NED    FEEDBHLP . ENG
   FREQUHLP . NED    FREQUHLP . ENG
   INPUTHLP . NED    INPUTHLP . ENG
   LOCUSHLP . NED    LOCUSHLP . ENG
    MAINHLP . NED     MAINHLP . ENG
   MATRXHLP . NED    MATRXHLP . ENG
    OPTIHLP . NED     OPTIHLP . ENG
    SYSTHLP . NED     SYSTHLP . ENG
    TIMEHLP . NED     TIMEHLP . ENG
   ZERO1HLP . NED    ZERO1HLP . ENG
   ZERO2HLP . NED    ZERO2HLP . ENG

   INSTGRAF . EXE To be used for non-automatic graphics driver selection.
   INSTTEXT . EXE To be used with a monochrome monitor and color video
                  card.
    INSTDIR . EXE Use this when IDENT.FIL is not in the same directory
                  with SYSAN.EXE.
   INSTMAIN . EXE Use this when you start SYSAN.EXE from a different
                  directory.



M.J. van den Oever.                                     October 4 1995        
