Machines Manufacturing Capital Budgeting Model
This project evaluates the manufacturing capital budgeting for a machine investment model using various financial metrics such as NPV.
Setup
Setup for the later calculations, importing necessary packages and defining initial configurations.
from dataclasses import dataclass
import numpy as np
import numpy_financial as npf
Investment or Scrap
Functions to determine machine purchases, advertising decisions, and machine scrap years.
def investment(data, year):
if year <= data.n_machines:
data.machines_purchased += 1
else:
data.d_1 = data.d_1 * (data.g_d + 1)
def machine_lifecycle(data, year):
if year in range(data.n_life + 1, data.n_life + data.n_machines + 1):
data.machines_purchased -= 1
return True
else:
return False
Cash Flow
Calculates the cash flows using revenue, costs, and scrap value.
def calculation(data, phones_sold_values, scrap_values):
revenue = phones_sold_values * data.price_phone
cost_of_production = phones_sold_values * data.cogs_phone
scrap = data.price_scrap if scrap_values else 0
cash_flow = revenue - cost_of_production - data.cost_machine_adv + scrap
data.cash_flows.append(cash_flow)
Main Model
Iterates over the years and calculates the machine investments, scraps, supply, demand, and cash flows.
for year in range(1, model_data.max_year + 1):
investment_decision = investment(model_data, year)
scrap_value = machine_lifecycle(model_data, year)
supply = model_data.machines_purchased * model_data.n_phones
demand = model_data.d_1
phones_sold_values = demand if supply > demand else supply
calculation(model_data, phones_sold_values, scrap_value)
Outputs
Displays the calculated cash flows and NPV.
cash_flows = model_data.cash_flows
npv = npf.npv(model_data.interest, model_data.cash_flows)
year = 0
for x in cash_flows[1:]:
year += 1
print(f'Year {year}: ${x:,.0f}')
print(f'NPV: ${npv:,.0f}')
Python Code Output
Year 1: $24,000,000
Year 2: $24,000,000
Year 3: $24,000,000
Year 4: $24,000,000
Year 5: $24,000,000
Year 6: $29,000,000
Year 7: $35,000,000
Year 8: $42,200,000
Year 9: $50,840,000
Year 10: $61,208,000
Year 11: $73,699,600
Year 12: $74,050,000
Year 13: $49,050,000
Year 14: $24,050,000
Year 15: $-950,000
Year 16: $-1,000,000
Year 17: $-1,000,000
Year 18: $-1,000,000
Year 19: $-1,000,000
Year 20: $-1,000,000
NPV: $369,276,542
Other Python Projects
TVM Project
A Time Value of Money Manufacturing Project