Solution of direct and inverse problem of MTZ 1D