A variational problem arising as a model in martensitic phase transformation
including surface energy is studied. It explains the complex,
multi-dimensional pattern of twin branching which is often observed in a
martensitic phase near the austenite interface.
We prove that a Lavrentiev phenomenon can occur
if the domain is a rectangle. We show that this phenomenon
disappears under arbitrarily small shears
of the domain. We also prove that other perturbations of the problem lead to
an extinction of the Lavrentiev phenomenon