Fundamentals of Algebraic Modeling