A numerical technique to estimate the dielectric constant and loss factor o
f a homogeneous dielectric material placed in an arbitrary shaped cavity ha
s been developed, The values of S-parameters are measured experimentally by
placing the sample in the cavity. Starting with a trial set of permittivit
y values, the computation is carried out using the finite-element method (F
EM) to match the S-parameters around the fundamental resonance frequency. T
he FEM routine is run several times while optimizing the values of dielectr
ic constant and conductivity of the sample. During the process of optimizat
ion, eight different measures of error between computed and experimental va
lues of complex S-parameters are examined. It is found that there is no sin
gle measure of error, which can be minimized to estimate two parameters (di
electric constant and the loss factor), but the combination of errors has t
o be minimized to get the exact solution. The computer program can generate
the solution with an accuracy of less than 0.01% in a few hours on a penti
um-based personal computer.