Risk reduction by Thermoeconomics for energy systems with probabilistic boundary conditions