Solving the inverse problem of magnetisation–stress resolution