function [rc,cc] = foster2cauer(rf,cf) %FOSTER2CAUER Transform Foster RC network to Cauer RC network % [rc,cc] = foster2cauer(rf,cf) returns the resistances rc and % capacitances cc of a Cauer RC network with the same impedance as the % Foster RC network consisting of the resistances rf and capacitances cf. % The vectors rf and cf must have the same length. % ensure row vectors rf = rf(:)'; cf = cf(:)'; % verify that rf and cf have the same length if length(rf)~=length(cf) error('The input vectors rf and cf must have the same length.') end % calculate polynomial coefficients of impedance (numerator and denominator) [p,q] = residue(1./cf,-1./(rf.*cf),0); % algorithm according to the following article (end of section III): % Y.C. Gerstenmaier, W. Kiffe, and G Wachutka: % Combination of thermal subsystems modeled by rapid circuit transformation, % 13th International Workshop on Thermal Investigation of ICs and Systems, 2007. THERMINIC 2007. n = length(rf); % number of rc pairs cc(n) = 0; % preallocate array rc(n) = 0; % preallocate array for k = 1:n [div,rem] = deconv(q,p); % polynomial division with remainder cc(k) = div(1); % Cauer capacitance (coefficient of s) rc(k) = 1/div(2); % Cauer resistance (reciprocal of constant term) rem = rem(find(rem~=0,1):end); % remove leading zeros from vector q = div(2)*p+[zeros(1,length(p)-length(rem)) rem]; % ensure same vector length for right-aligned addition p = -rem/div(2); end end