Spectroscopic analysis and modeling of tungsten EBIT and Z-pinch plasma experiments 1