geth2.m
来自「控制系统计算机辅助设计——MATLAB语言与应用(源代码)」· M 代码 · 共 29 行
M
29 行
function [v,ierr]=geth2(G)
%GETH2 computes the H2 norm of a system using Astrom recursive method.
%
%[v,ierr]=GETH2(G)
% where G is the system model,
% v is the H2 norm.
% If ierr=1, then the system is unstable, and v is useless.
%
% See Also: NORMH2, COVAR
%Designed by Professor Dingyu Xue
%Northeastern University, Shenyang 110004, P R China
%first drafted in 1990, revised for LFC book, 2002
G=tf(G); num=G.num{1}; den=G.den{1};
ierr=0; v=0; n=length(den);
if abs(num(1))>eps
disp('System not strictly proper');
ierr=1; return
else, a1=den; b1=num(2:length(num)); end
for k=1:n-1
if (a1(k+1)<=eps), ierr=1; return
else,
aa=a1(k)/a1(k+1); bb=b1(k)/a1(k+1);
v=v+bb*bb/aa; k1=k+2;
for i=k1:2:n-1
a1(i)=a1(i)-aa*a1(i+1);
b1(i)=b1(i)-bb*a1(i+1);
end, end, end
v=sqrt(0.5*v);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?