Dynamic identification of plasma magnetic contour in fusion machines