How can i get the free energy?

how can I get the free energy for each trajectory after remd simulation as I have many trajectories?
also, i need to make a correlation between rmsd and the system free energy so what is the method that i can use for preparing this relation?

is there any help, please