A general method for the solution of inverse problems in transport phenomena