A generalisation of the Onsager trial-function approach: describing nematic liquid crystals with an algebraic equation of state