Main Content

prescale

Optimal scaling of state-space models

Syntax

scaledsys = prescale(sys)
scaledsys = prescale(sys,focus)
[scaledsys,info] = prescale(...)
prescale(sys)

Description

scaledsys = prescale(sys) scales the entries of the state vector of a state-space model sys to maximize the accuracy of subsequent frequency-domain analysis. The scaled model scaledsys is equivalent to sys.

scaledsys = prescale(sys,focus) specifies a frequency interval focus = {fmin,fmax} (in rad/TimeUnit, where TimeUnit is the system's time units specified in the TimeUnit property of sys) over which to maximize accuracy. This is useful when sys has a combination of slow and fast dynamics and scaling cannot achieve high accuracy over the entire dynamic range. By default, prescale attempts to maximize accuracy in the frequency band with dominant dynamics.

[scaledsys,info] = prescale(...) also returns a structure info with the fields shown in the following table.

SLLeft scaling factors
SRRight scaling factors
FreqsFrequencies used to test accuracy
RelAccGuaranteed relative accuracy at these frequencies

The test frequencies lie in the frequency interval focus when specified. The scaled state-space matrices are

As=TLATRBs=TLBCs=CTREs=TLETR

where TL = diag(SL) and TR = diag(SR). TL and TR are inverse of each other for explicit models (E = [ ]).

prescale(sys) opens an interactive GUI for:

  • Visualizing accuracy trade-offs for sys.

  • Adjusting the frequency interval where the accuracy of sys is maximized.

For more information on scaling and using the Scaling Tool GUI, see Scaling State-Space Models.

Tips

Most frequency-domain analysis commands perform automatic scaling equivalent to scaledsys = prescale(sys).

You do not need to scale for time-domain simulations and doing so may invalidate the initial condition x0 used in initial and lsim simulations.

Version History

Introduced in R2008b

See Also