Energy method - Rayleigh–Ritz method using 2-Node Bar Element (1-D Problem)