Shape sensing for beam elements in presence of non-linear behaviour