function epsilon = maxgarmix( epsilon_h, epsilon_i, v )

% Effective dielectric constant of a medium containing intrusions of
% different dielectric properties computed according to the Maxwell-Garnett
% dielectring mixing model. Can it be used for magnetic properties as well?
%
% epsilon_h = complex dielectric constant of host material
% epsilon_i = complex dielectric constant of intrusion
% v         = volume fraction of intrusion ( 0 < v < 1 )
%
%                     1 + 2 v y
% epsilon = epsilon_h ---------
%                      1 - v y
%
%            epsilon_i - epsilon_h
% where y = -----------------------
%           epsilon_i + 2 epsilon_h


epsilon = epsilon_h .* ( 2 .* ( 1 - v ) .* epsilon_h + ( 1 + 2 .* v ) .* epsilon_i ) ./ ( ( 2 + v ) .* epsilon_h + ( 1 - v ) .* epsilon_i );