Linking the Solar Wind to its origin in the solar atmosphere is a difficult task. One way forward is to use composition data measured in situ and remotely. Indeed, different structures on the Sun have different abundances, that become frozen at a certain height, and therefore we can determine where certain wind plasma detected in situ comes from. However, systematically determining these abundances from remote-sensing observations is difficult because it usually first requires an accurate determination of the Differential Emission Measure (DEM). We present a new method to measure relative abundances using UV spectroscopy, which aims at being independent from the DEM. This method relies on optimizing linear combinations of spectral lines. We test this method using DEMs obtained from AIA observations and creating synthetic intensities with them. This allows us to test the method accurately and to find the best linear combinations. This method could be used semi-automatically for optimal abundance determinations from existing observations as well as for designing new observations such as those from the SPICE spectrometer from the future Solar Orbiter mission.