National Instruments 370753C-01 Fan User Manual


 
Chapter 4 System Analysis
© National Instruments Corporation 4-11 Xmath Control Design Module
Often it is desirable to run several simulations with different inputs. In this
case, you can define a PDM whose columns contain the input vectors for
the different simulations. Then u will be n
y
× q × N
samp
, where q is the
number of different simulations to be run. The resulting y will be
n
y
× q × N
samp
, with each column of the PDM corresponding to a different
simulation.
The input PDM must have a regular domain—that is, the interval between
each domain value and the one succeeding it must be the same over all
points in the domain. If the system is discrete, the domain intervals must be
equal to the system’s sampling period. If the system is continuous, it is
discretized using the exponential (zero-order hold) method, with the
sampling interval set equal to the input domain interval spacing.
Note For accurate results, you need to make sure this sampling interval is small enough
that discretization effects are negligible.
The next step is to create a general signal and store it as a PDM where
domain is time as shown in Example 4-5. Because you are using a SISO
system, this input is a single-channel PDM.
Example 4-5 Performing a General Time-Domain Simulation
t = 0:0.1:15;
osig = ones(1,30);
sig = [0*osig,0.5*osig,osig,0.5*osig,0*ones(1,31)];
U = pdm(sig,t);
Create the system:
Sys = system([-2.3,0.01,5.1;0,-0.35,-2;0,2,-.35],
[1,.25,.25]',[1.34,0,0],0);
and perform the simulation:
Y = Sys*U;
To see how well the system tracks the input signal, plot the input,
as follows, and the system’s response, shown in Figure 4-3.
plot ([U,Y], {legend = ["Input Signal",
"System Response"],line_color = "black",
xlab = "Time (sec)", ylab = "Amplitude"})