Mathematical simulation of structural damage in historical buildings