Modeling Physical Systems by Effective Harmonic Oscillators: The Optimized Quadratic Approximation