A semi-empirical potential for the statics and dynamics of covalent carbon systems