How do you calculate trip fuel based on hourly fuel burn rates? I am working on a small personal project that uses fuel burn data about specific aircraft to calculate the total fuel required for a trip. The data looks like this:

          | 120000 kg  | 150000 kg | 180000kg
----------+------------+-----------+-----------
21,000 ft | 6250 kg/hr | 6350 kg/hr| 6450 kg/hr
22,000 ft | 6225 kg/hr | 6325 kg/hr| 6425 kg/hr
23,000 ft | 6200 kg/hr | 6300 kg/hr| 6400 kg/hr


Based on the table above, you can see that to cruise at 21,000 ft and a weight of 120,000 kg, you would burn 6250kg/hr. 

The problem I am having is that in order to calculate total weight, you first need to know total fuel, which you don't have until you know the proper burn rate. What would be the proper way to calculate fuel based on this information?
This would typically be solved iteratively. You start with your mass equal to ZFW and calculate how much fuel you need based on the table:

$$ \mathrm{Fuel}_1 = \mathrm{Fuel}(m=\mathrm{ZFW}) $$

Then you add this fuel to your total weight and repeat the calculation:

$$ \mathrm{Fuel}_2 = \mathrm{Fuel}(m=(\mathrm{ZFW} + \mathrm{Fuel}_1)) $$

which will give you slightly larger result. You repeat this process until convergence, meaning

$$ \mathrm{Fuel}_{i + 1} \approx \mathrm{Fuel}_i $$

and this is your final result.