First-principles and model calculations on carbon chains