NV Analytics Logo Noah Vachon

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
            

Inputs

Defining the inputs for the model using a data class to store the parameters.


@dataclass
class ModelInputs:
    n_phones: float = 100000
    price_scrap: float = 50000
    price_phone: float = 500
    cost_machine_adv: float = 1000000
    cogs_phone: float = 250
    n_life: int = 10
    n_machines: int = 5
    d_1: float = 100000
    g_d: float = 0.2
    max_year: float = 20
    interest: float = 0.05
    cash_flows = [0]
    machines_purchased = 0
    elasticity: float = 100
    demand_constant: float = 300000

model_data = ModelInputs()
            

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

My Dynamic Salary Model

A salary over time retirement model

Retirement Model Lab

A years until retirement calculator

TVM Project

A Time Value of Money Manufacturing Project