calculate grid payment