A surface-layer model of ferroelectric nanowire