Inverse analysis of metamaterials and parameter determination by means of an automatized optimization problem