Robust Control Toolbox™ Previous page   Next Page 
sdlsim
 Provide feedback about this page

Time response of sampled-data feedback system

Syntax

Description

sdlsim(p,k,w,t,tf) plots the time response of the hybrid feedback system. lft(p,k), is forced by the continuous input signal described by w and t (values and times, as in lsim). p must be a continuous-time LTI system, and k must be discrete-time LTI system with a specified sampling time (the unspecified sampling time -1 is not allowed). The final time is specified with tf.

sdlsim(p,k,w,t,tf,x0,z0) specifies the initial state vector x0 of p, and z0 of k, at time t(1).

sdlsim(p,k,w,t,tf,x0,z0,int) specifies the continuous-time integration step size int. sdlsim forces int = (k.Ts)/N int where N>4 is an integer. If any of these optional arguments is omitted, or passed as empty matrices, then default values are used. The default value for x0 and z0 is zero. Nonzero initial conditions are allowed for p (and/or k) only if p (and/or k) is an ss object.

If p and/or k is an LTI array with consistent array dimensions, then the time simulation is performed pointwise across the array dimensions.

[vt,yt,ut,t] = sdlsim(p,k,w,t,tf) computes the continuous-time response of the hybrid feedback system lft(p,k) forced by the continuous input signal defined by w and t (values and times, as in lsim). p must be a continuous-time system, and k must be discrete-time, with a specified sampling time (the unspecified sampling time -1 is not allowed). The final time is specified with tf. The outputs vt, yt and ut are 2-by-1 cell arrays: in each the first entry is a time vector, and the second entry is the signal values. Stored in this manner, the signal vt is plotted by using one of the following commands:

Signals yt and ut are respectively the input to k and output of k.

If p and/or k are LTI arrays with consistent array dimensions, then the time simulation is performed pointwise across the array dimensions. The outputs are 2-by-1-by-array dimension cell arrays. All responses can be plotted simultaneously, for example, plot(vt).

[vt,yt,ut,t] = sdlsim(p,k,w,t,tf,x0,z0,int) The optional arguments are int (integration step size), x0 (initial condition for p), and z0 (initial condition for k). sdlsim forces int = (k.Ts)/N, where N>4 is an integer. If any of these arguments is omitted, or passed as empty matrices, then default values are used. The default value for x0 and z0 is zero. Nonzero initial conditions are allowed for p (and/or k) only if p (and/or k) is an ss object.

Example

To illustrate the use of sdlsim, consider the application of a discrete controller to an integrator with near integrator. A continuous plant and a discrete controller are created. A sample and hold equivalent of the plant is formed and the discrete closed-loop system is calculated. Simulating this with lsim gives the system response at the sample points. sdlsim is then used to calculate the intersample behavior.

The closed-loop digital system is now set up. You can use sysic to construct the interconnected feedback system.

lsim is used to simulate the digital step response.

The continuous interconnection is set up and the sampled data response is calculated with sdlsim.

You can see the effect of a nonzero initial condition in the continuous-time system. Note how examining the system at only the sample points will underestimate the amplitude of the overshoot.

Finally, you can examine the effect of a sinusoidal disturbance at the continuous-time plant output. This controller is not designed to reject such a disturbance and the system does not contain antialiasing filters. Simulating the effect of antialiasing filters is easily accomplished by including them in the continuous interconnection structure.

Algorithm

sdlsim oversamples the continuous-time, N times the sample rate of the controller k.

See Also
gapmetric   Computes the gap and the Vinnicombe gap metric

hinfsyn     Synthesizes a H optimal controller

norm        Computes the system norm of an LTI object

sdhinfnorm  Calculates the norm of a sampled-data feedback system

sdhinfsyn   Synthesizes a sample-data H optimal controller


 Provide feedback about this page 

Previous page sdhinfsyn sectf Next page

 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS