我想在 R 中完成来自 GNU Octave/MATLAB 的阶跃响应示例。附加:在 MATLAB 中生成阶跃响应是示例的来源。
在 R 中
M <- 1; K <- 10; B <- 2; num <- 1; den <- c(M, B, K)
你如何定义R中的传递函数?
您如何在 R 中获得该系统的阶跃响应?
在 GNU Octave/MATLAB 中
M = 1; % units of kg
K = 10; % units of N/m
B = 2; % units of N-s/m
num = 1;
den = [M B K];
sys = tf(num,den)
step(sys);
% sys =
% 1
% --------------
% s^2 + 2 s + 10
% Continuous-time transfer function.