Home > matlab > gensylv > gensylv.m

gensylv

PURPOSE ^

function [err, E] = gensylv(fake,A,B,C,D)

SYNOPSIS ^

function [err, E] = gensylv(kron_prod,A,B,C0,D)

DESCRIPTION ^

function [err, E] = gensylv(fake,A,B,C,D)
 Solves a Sylvester equation.

 INPUTS
   kron_prod     
   A
   B
   C
   D
    
 OUTPUTS
   err      [double] scalar: 1 indicates failure, 0 indicates success
   E
    
 ALGORITHM
   none.

 SPECIAL REQUIREMENTS
   none.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [err, E] = gensylv(kron_prod,A,B,C0,D)
0002 %function [err, E] = gensylv(fake,A,B,C,D)
0003 % Solves a Sylvester equation.
0004 %
0005 % INPUTS
0006 %   kron_prod
0007 %   A
0008 %   B
0009 %   C
0010 %   D
0011 %
0012 % OUTPUTS
0013 %   err      [double] scalar: 1 indicates failure, 0 indicates success
0014 %   E
0015 %
0016 % ALGORITHM
0017 %   none.
0018 %
0019 % SPECIAL REQUIREMENTS
0020 %   none.
0021 
0022 % Copyright (C) 1996-2010 Dynare Team
0023 %
0024 % This file is part of Dynare.
0025 %
0026 % Dynare is free software: you can redistribute it and/or modify
0027 % it under the terms of the GNU General Public License as published by
0028 % the Free Software Foundation, either version 3 of the License, or
0029 % (at your option) any later version.
0030 %
0031 % Dynare is distributed in the hope that it will be useful,
0032 % but WITHOUT ANY WARRANTY; without even the implied warranty of
0033 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0034 % GNU General Public License for more details.
0035 %
0036 % You should have received a copy of the GNU General Public License
0037 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
0038 C = C0;
0039 for i=1:(kron_prod-1);
0040     C  = kron(C0,C); 
0041 end;
0042 
0043 x0 = sylvester3(A,B,C,D);
0044 E  = sylvester3a(x0,A,B,C,D);
0045 err = 0;

Generated on Mon 21-May-2012 02:42:43 by m2html © 2005