Learn R Programming

control (version 0.2.5)

ss2tf: State-space model conversion to Transfer function model.

Description

ss2tf converts the model for a state-space system to transfer function representation

Usage

ss2tf(a, b, c, d, iu)

Arguments

a

An n x n matrix

b

An n x m matrix

c

An p x n matrix

d

An p x m matrix

iu

A numeric value denoting number of inputs. default value is 1.For example, if the system has three inputs (u1, u2, u3), then iu must be either 1, 2, or 3, where 1 implies u1, 2 implies u2, and 3 implies u3.

Value

Returns an object of 'tf' class containing num and den. The numerator coefficients are returned in matrix num with as many rows as outputs y.

Details

ss2tf converts a model object in state-space form to transfer function model by calculating the transfer function of the system: . x = Ax + Bu y = Cx + Du

#' Other possible usages for ss2tf are: ss2tf(a,b,c,d) ss2tf(sys) ss2tf(sys, iu)

where sys is an object of state-space class

See Also

tf2ss ss2zp

Examples

Run this code
# NOT RUN {
sys2 <- tf2ss(tf(1, c(1,2,1)))
ss2tf(sys2)

# }
# NOT RUN {
  OR 
# }
# NOT RUN {
ss2tf(sys2$A,sys2$B,sys2$C,sys2$D)

# a single input multiple output system
A <- rbind(c(0,1), c(-10000,-4)); B <- rbind(0,1); C <- rbind(c(1,0), c(0,1));
D <- rbind(0,0)
ss2tf(A, B, C, D)

# a MIMO system
A = rbind(c(0,1), c(-25,-4)); B = rbind(c(1,1), c(0,1));
C = rbind(c(1,0), c(0,1)); D = rbind(c(0,0), c(0,0))
ss2tf(A,B,C,D,1) # to obtain output for input 1
ss2tf(A,B,C,D,2) # to obtain output for input 2

## OR

systems <- vector("list", ncol(D))
for(i in 1:ncol(D)){ systems[[i]] <- ss2tf(A,B,C,D,i) }
systems
systems[[1]]
systems[[2]]

# }

Run the code above in your browser using DataLab