Experiments have been performed at Sandia National Laboratories Z-facility to validate iron opacity models relevant to the solar convection/radiation zone boundary. Sample conditions were measured by mixing Mg with the Fe and using Mg K-shell line transmission spectra, assuming that the plasma was uniform. We develop a spectral model that accounts for hypothetical gradients, and compute synthetic spectra to quantitatively evaluate the plasma gradient size that can be diagnosed. Two sample designs are investigated, assuming linear temperature and density gradients. First, Mg uniformly mixed with Fe enables temperature gradients greater than 10% to be detected. The second design uses Mg mixed into one side and Al mixed into the other side of the sample in an attempt to more accurately infer the sample gradient. Both temperature and density gradients as small as a few percent can be detected with this design. Experiments have successfully recorded spectra with the second design. In future research, the spectral model will be used to place bounds on gradients that exist in Z opacity experiments.