cpole2t.m
来自「ipr函数库与仿真实验程序,都是要用到的库函数。」· M 代码 · 共 29 行
M
29 行
function y = cpole2t(cp,res,t)% Performs inverse Laplace transform for two complex % conjugate poles and generates a time function. %Inputs: cp - complex pole, having POSITIVE imaginary part% res - residue at the complex pole% t - time vector%Output: y - time response vector% % The response is computed as % y(t) = 2 K exp(a*t) cos(omega*t + phi)% where res = K exp(j phi), cp = a + j omega%%%%%%%%%%%%%%%%%%% cpole2t.m %%%%%%%%%%%%%%%%%%%% Discrete-Time Control Problems using %% MATLAB and the Control System Toolbox %% by J.H. Chow, D.K. Frederick, & N.W. Chbat %% Brooks/Cole Publishing Company %% September 2002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%a = real(cp);omega = imag(cp);K = abs(res);phi = angle(res);y = 0*t;for n=1:length(t), y(n) = 2*K*exp(a*t(n))*cos(omega*t(n)+phi);end%----- remove any very small imaginary partsy = real(y);%%%%%%%%%%
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?