Non-ideal stability: variational method for the determination of the outer-region matching data