Professional Documents
Culture Documents
The objective of this tutorial is to acquaint the student with the basic tools needed to use the
c
c package on the Unix workstations of the Rensselaer Computing System (RCS).
c
c is an extension to
which uses a icon-driven interface for the
construction of a block diagram representation of a process. A block diagram is simply a
graphical representation of a process (which is composed of an input, the system, and an output).
Typically, the
m-file is used to solve sets of linear and nonlinear ordinary
differential equations. The ``traditional'' numerical methods approach is used, e.g. supply the
equations to be solved in a function file, and use a general purpose equation solver (linear or
nonlinear algebraic, linear or nonlinear differential equation, etc.) which ``calls'' the supplied
function file to obtain the solution. One of the reasons why
is ` easy to use is
that the ``equation solvers'' are supplied for us, and we access these through a command line
interface (CLI) (aka the
prompt, >>). However, c
c uses a graphical user
interface (GUI) for solving process simulations. Instead of writing
code, we simply
connect the necessary ``icons'' together to construct the block diagram. The ``icons'' represent
possible inputs to the system, parts of the systems, or outputs of the system. c
c allows
the user to easily simulate systems of linear and nonlinear ordinary differential equations. A
good background in matrix algebra and lumped parameter systems as well as an understanding of
is required, and we highly recommend that the student thoroughly reads and works
through this tutorial. Many of the features of c
c are user-friendly due to the icon-
driven interface, yet it is important to spend some time experimenting with c
c and its
many features. Dynamic simulation packages (such as
, c
c , etc.) are being
used more and more frequently in the chemical process industries for process simulation and
control system design. After completing this tutorial, the student should be able to ``build'' and
simulate block diagram representations of dynamic systems.
In order to use c
c the student must ``start'' a
session (click on the
button). Once
has started up, type (SMALL LETTERS!) at the
prompt (>>) followed by a carriage return (press the return key). A c
c
window should appear shortly, with the following icons: Sources, Sinks, Discrete, Linear,
Nonlinear, Connections, Extras (this window is shown in Figure 2). Next, go to the file menu in
this window and choose New in order to begin building the block diagram representation of the
system of interest.
c c
As mentioned previously, the block diagram representation of the system is made up of various
type of icons. Basically, one has to specify the model of the system (state space, discrete, transfer
functions, nonlinear ODE's, etc), the input (source) to the system, and where the output (sink) of
the simulation of the system will go. Open up the Sources, Sinks, and Linear windows by
clicking on the appropriate icons. Note the different types of sources (step function, sinusoidal,
white noise, etc.), sinks (scope, file, workspace), and linear systems (transfer function, state
space model, etc.).
For example, you may be interested in simulating a step input to a first-order transfer function in
the Laplace domain and viewing the result graphically in
. The resulting block
diagram is shown in Figure 3. To do this, you would "drag" a icon from the
Sources window, a ! icon from the Linear window, two " ! icons
from the Sinks window, and a icon from the Source window to the blank block diagram
window.
The next step is to connect these icons together by drawing lines connecting the icons using the
left-most mouse button (hold the button down and drag the mouse to draw a line). Connect the
icon to the input of the ! icon, then connect the output of the
! icon to first " ! icon. Then, connect the icon to the second
" ! icon. ``Open'' the icons (by double clicking on them with the left-most mouse button)
and set the values of the various parameters; for example the step size and step time in the
icon, the transfer function coefficients in the ! icon, and the variable
names in the " ! icons (generally, the clock variable is denote as time, whereas the
output variable is denoted y). Select the parameter field from the simulation menu (in the block
diagram window) and set the proper integration details (min and max stepsizes, start and stop
integration times, integration code, etc.). Finally, select start from the simulation menu to start
the simulation. The output of the simulation will be sent to the
command line
interface (CLI) (aka the
prompt, >>). The result can be plotted as one would normally
plot ( e.g. plot(time,y) ), since the variables and are now defined in the
workspace. The result is shown in Figure 4, for a first-order transfer function with a time
constant = 2, and a unit step input at time = 1.
c
c c#
The following are general tips and should be used often.
1.? In order to save your work, select Save from the file menu and give the file that you want
to save a name (or choose an old name if you are ``writing over'' an old version), and
click the ok button (using the left-most mouse button). Realize that you have a choice of
the ``folder'' that the file is saved in.
2.? The PID Controller block parameters are entered in as: , , .
3.? The following transfer function (in the Laplace domain)
is entered into the ! icon by double clicking on the !
icon and entering the numerator and denominator polynomial coefficients. The numerator
coefficients would be entered as [2 1] and the denominator coefficients are entered as [10
5 1].
ë`
where
is the name that you saved the block diagram under. For
example, if you saved the block diagram as `, then you would type:
ë`
`
(c
c
?