direct and inverse problem