Untitled
unknown
plain_text
2 years ago
1.0 kB
16
Indexable
# Let's develope a function to calculate optimal number of wells
def calculate_optimal_wells(budget_per_well, reserve, total_budget,max_well):
max_profit = 0
optimal_num_wells = 0
for num_wells in range(1, max_well +1):
revenue = num_wells * reserve
total_cost = num_wells * budget_per_well
profit = revenue - total_cost
if profit > max_profit:
max_profit = profit
optimal_num_wells = num_wells
return optimal_num_wells
# Let's calculat the profit of each region
optimal_wells_region_0 = calculate_optimal_wells(budgpw, topm0pred, budg, maxwell0)
optimal_wells_region_1 = calculate_optimal_wells(budgpw, topm1pred, budg, maxwell1)
optimal_wells_region_2 = calculate_optimal_wells(budgpw, topm2pred, budg, maxwell2)
print('Optimal Number of Wells for Region 0:', optimal_wells_region_0)
print('Optimal Number of Wells for Region 1:', optimal_wells_region_1)
print('Optimal Number of Wells for Region 2:', optimal_wells_region_2)Editor is loading...
Leave a Comment