bode | R Documentation |
The function
1. returns a list with two dataframes, one for the mag plot and the other for the phase plot
2. plots the mag and phase if the argument "pl" is set to TRUE (default)
3. Allows to reduce execution time by setting desired resolution using n (default = 5*10^5)
bode(wL, wU, fun = tf1)
bode(wL, wU, fun = tf1, pl = T)
bode(wL, wU, fun = tf1, pl = F)
bode(wL, wU, fun = tf1, pl = F, n = 3000)
bode(wL, wU, fun = tf1, n = 3000)
wL |
Lower limit of frequency window in bode plot. Single numeric value |
wU |
Upper limit of frequency window in bode plot. Single numeric value |
fun |
A single argument function describing the transfer function |
pl |
A single boolean value,(default = TRUE), toggles plot on or off |
n |
Single numeric value, (default = 5*10^5), decides the resolution of the bode plot |
Returns a 2 element list containing dataframes related to magnitude and phase plots
Chitran Ghosal
##define transfer function
tf <- function(s){
K <- 0.0016
w1 <- 2*pi*1000
w2 <- 2*pi*50000
return(K*s/((s/w1 + 1)*(s/w2 + 1)))
}
##call bode function
L <- bode(0.1, 10^8, fun = tf)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.