plot.tfa: Plot transfer function

Description Usage Arguments Details See Also Examples

View source: R/S3-plot.tfa.R

Description

Plot a transfer function

Usage

1
2
## S3 method for class 'tfa'
plot(x, xvar = NULL, yvar = NULL, ...)

Arguments

x

an object of class 'tfa' (transfer function analysis) created using tfa_lambda or tfa_inertia.

xvar, yvar

(optional) the variables to plot on the x and y axes. May be "p", "lambda" or "inertia". Defaults to xvar="p" and yvar="lambda" for objects created using tfa_lambda and xvar="p" and yvar="inertia" for objects created using tfa_inertia.

...

arguments to be passed to methods: see par and plot.

Details

plot.tfa plots transfer functions (class tfa) created using tfa_lambda or tfa_inertia.

See Also

Constructor functions: tfa_lambda, tfa_inertia

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
  # Create a 3x3 matrix
  ( A <- matrix(c(0,1,2,0.5,0.1,0,0,0.6,0.6), byrow=TRUE, ncol=3) )

  # Calculate the transfer function of A[3,2] given a range of lambda
  evals <- eigen(A)$values
  lmax <- which.max(Re(evals))
  lambda <- Re(evals[lmax])
  lambdarange <- seq(lambda-0.1, lambda+0.1, 0.01)
  ( transfer <- tfa_lambda(A, d=c(0,0,1), e=c(0,1,0), lambdarange=lambdarange) )

  # Plot the transfer function
  plot(transfer)

  # Create an initial stage structure
  ( initial <- c(1,3,2) )

  # Calculate the transfer function of upper bound on inertia 
  # given a perturbation to A[3,2]
  ( transfer<-tfa_inertia(A, d=c(0,0,1), e=c(0,1,0), bound="upper",
                          prange=seq(-0.6,0.4,0.01)) )

  # Plot the transfer function (defaults to inertia ~ p)
  plot(transfer)

  # Plot inertia against lambda
  plot(transfer, xvar="lambda", yvar="inertia")

popdemo documentation built on Nov. 16, 2021, 5:06 p.m.