Conventional exergy analysis methods face the challenge of coping with the effect of process uncertainty. In this work, we proposed a novel framework which incorporates the concepts of uncertainty analysis and optimisation in the conventional exergy analysis. The proposed framework was realised as a MATLAB((R))-ba-based algorithm which connects with an Aspen (PUS)-U-(R)(R) model of naphtha reforming process, extracts process information, and calculates the process exergy efficiency. Then a statistical model, .,e., random forests (RF), combined with a bootstrap filter is used to analyse the effect of process uncertainty on the exergy efficiency. Finally, an optimisation method is devised by combining genetic algorithm (GA) with artificial neural networks (ANN). The MAT((R))-AB (R) basd system is supported by an extensive database of standard chemical exergies of elements. The algorithm and the database can be customised for any model simulated in the Aspen (PUS)-U-(R)(R) environment.