Calculates the frequency response of a dynamic system. Generates two objects, one for the magnitude in db and the other for the phase in degrees of the system response as a function of frequency
bode
Optional
frequencyRange: number[]Returns the numerator and the denominator expression for a given transfer function
tfdata
const tf = new TransferFunction({
numerator: [{ re: 1, im: 1 }, { re: -2, im: 0 }],
denominator: [{ re: 1, im: 0 }, { re: -2, im: 0 }, { re: -3, im: 0 }],
});
console.log(tf.getExpression())
// Output: { numerator: [-1, -2, 3], denominator: [1, -2] }
Calculates the unit impulse response of a dynamic system model. The impulse response is the response to a Dirac input δ(t). It returns a ready to input chart data, with x and y axis
impulse
Optional
timeRange: number[]Given a frequency range, it calculates the real and imaginary part of the transform function evaluated at each frequency
nyquist
Optional
frequencyRange: number[]Calculates the poles of a dynamic system model. Meaning, the values that will make the system go to infinite. The poles of a dynamic system determine the stability and response of the system.
An open-loop linear time-invariant system is stable if: In continuous-time, all the poles of the transfer function have negative real parts. When the poles are visualized on the complex s-plane, then they must all lie in the left-half plane (LHP) to ensure stability. In discrete-time, all the poles must have a magnitude strictly smaller than one, that is they must all lie inside the unit circle.
pole
Calculates and plots the root locus of the SISO model sys. The root locus returns the closed-loop pole trajectories as a function of the feedback gain k (assuming negative feedback). Root loci are used to study the effects of varying feedback gains on closed-loop pole locations. In turn, these locations provide indirect information on the time and frequency responses.
rlocus
Optional
k: number[]Feedback gain
Return the transfer function expression in a string format
const tf = new TransferFunction({
numerator: [{ re: 1, im: 1 }, { re: -2, im: 0 }],
denominator: [{ re: 1, im: 0 }, { re: -2, im: 0 }, { re: -3, im: 0 }],
});
console.log(tf.toString())
// Output: -(1 + i)s - 2 / s^2 - 2s - 3
Generated using TypeDoc
Transfer function interface.
Example