evalfr is a simplified version of freqresp
meant for quick evaluation of the system response at any point in the complex plane. To
evaluate system response over a set of frequencies, use freqresp. To obtain the magnitude and phase data as well as plots of the
frequency response, use bode.
frsp = evalfr(sys,x)
evaluates the dynamic system model sys at the point
x in the complex s plane (for continuous-time
sys) or z plane (for discrete-time
sys).
For this example, consider a cube rotating about its corner with inertia tensor J and a damping force F of 0.2 magnitude. The input to the system is the driving torque while the angular velocities are the outputs. The state-space matrices for the cube are:
Specify the A, B, C and D matrices, and create the continuous-time state-space model.
J = [8 -3 -3; -3 8 -3; -3 -3 8];
F = 0.2*eye(3);
A = -J\F;
B = inv(J);
C = eye(3);
D = 0;
sys = ss(A,B,C,D);
size(sys)
State-space model with 3 outputs, 3 inputs, and 3 states.
Compute the frequency response of the system at 0.2 rad/second. Since sys is a continuous-time model, express the frequency in terms of the Laplace variable s.
Sparse state-space models, such as sparss
or mechss
models.
Generalized or uncertain state-space models such as genss or uss (Robust Control Toolbox) models. (Using uncertain models requires Robust Control Toolbox™ software.)
For tunable control design blocks, the function evaluates the model at its
current value to evaluate the frequency response.
For uncertain control design blocks, the function evaluates the frequency
response at the nominal value and random samples of the model.
Identified state-space models, such as idss (System Identification Toolbox) models. (Using identified models
requires System Identification Toolbox™ software.)
Point in complex plane at which to evaluate system response, specified as a complex
scalar. For continuous-time sys, the point x
is in the plane of the continuous-time Laplace variable s. For
discrete-time sys, x is in the plane of the
discrete-time Laplace variable z.
To evaluate the response of the system at a particular frequency, specify the
frequency in terms of the appropriate Laplace variable. For instance, if you want to
evaluate the frequency response of a system sys at a frequency
value of w rad/s, then use:
x = j*w, for continuous-time sys.
z = exp(j*w*Ts), for discrete-time sys,
where Ts is the sample time.
Frequency response of the system at the point x, returned as a
complex scalar (for SISO sys) or a complex array (for MIMO
sys). For MIMO systems, the array dimensions correspond to the
I/O dimensions of sys.
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.