bode {control}R Documentation

Bode Frequency Response for continuous-time Linear Systems.

Description

bode computes the magnitude and phase of the frequency response of system sys at given frequencies w

General Usage:

bode(sys)

bode(sys, w)

bode(sys, w, iu)

bode(sys, w = seq(0, 100, length = 10000), iu = 1)

bodeplot(sys)

bodeplot(sys, w)

bodeplot(sys, w, subtitle)

Usage

bode(sys, w, iu)

Arguments

sys

LTI system of transfer-function, state-space and zero-pole classes

w

vector of range of frequencies at the response is computed in rad/sec

iu

number to specify an input for a MIMO state-space system. If the system has 3 inputs, then iu would be set to 1, set to 2 and then to 3 to obtain the bode response from input 1, 2, and 3 to the outputs. For single input systems, iu is always set to 1. iu is not needed/allowed for calls to bodeplot

Details

bode Compute the magnitude and phase of the frequency response of system sys at given frequencies w. When sys is a transfer function, bode computes the frequency response of the system using the signal package.

bodeplot plots the frequency response computed by bode. For a MIMO state-space system, bodeplot uses selectsys to obtain the bode response for each input-to-output pair and plot them individually. This means that for a 2-input, 2-output system, bodeplot obtains the response for input 1 to output 1, input 1 to output 2, input 2 to output 1 and input 2 to output 2. bodeplot uses the subtitle argument to allow a user assign the plot a sub-title

Value

A list is returned by calling bode containing: w - frequencies

mag - magnitude of the response

phase - phase of the response

A plot is returned by calling bodeplot

See Also

nyquist

Examples

bode(tf(100, c(1,6,100)))
bode(ssdata(tf(100, c(1,6,100))))

bode(tf(4, c(1,1)))
A <- rbind(c(-2, -1), c(1,0)); B <- rbind(1,0);
C <- cbind(0,1); D <- as.matrix(0);
bode(ss(A,B,C,D))

## MIMO plot
A1 <- rbind(c(0,1), c(-25,-4)); B1 <- rbind(c(1,1), c(0,1))
C1 <- rbind(c(1,0), c(0,1)); D1 <- rbind(c(0,0), c(0,0))
sys1 <- ss(A1,B1,C1,D1)
bodeplot(sys1)
# Use:  par(mfrow = c(2,1)); bodeplot(selectsys(sys1,1,2)) to obtain the response for a subsystem
# of sys1 for input 1 and output 2 only
# RESET your plot layout using par(mfrow = c(1,1))


[Package control version 0.2.5 Index]