dric.m

来自「数字通信第四版原书的例程」· M 代码 · 共 17 行

M
17
字号
function [kerr,serr]=dric(a,b,q,r,k,s)
%DRIC	Discrete Riccati equation residual calculation.
%	[Kerr,Serr] = DRIC(A,B,Q,R,K,S) Computes the error in the solution
%	to the discrete Riccati equation.  Kerr is the error in the gain
%	matrix and Serr is the residual error in the Riccati equation.
%
%	                 -1                                     -1
%	Kerr = K-(R+B'SB)  B'SA;  Serr = S - A'SA + A'SB(R+B'SB)  BS'A - Q
%
%	See also: RIC, DLQE, DLQR

%	Copyright (c) 1986-93 by the MathWorks, Inc.

serr = s - a'*s*a+a'*s*b*((r+b'*s*b)\b'*s'*a)-q;
kerr = k - (r+b'*s*b)\b'*s*a;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?