Equivalent microstructure problem: Mathematical formulation and numerical solution