Skip to content

Commit

Permalink
hopefully final change for issue #180
Browse files Browse the repository at this point in the history
  • Loading branch information
cortespea committed Jan 8, 2024
1 parent 0d2baa7 commit 4e7f16b
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions biosteam/_tea.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ def __init__(self, system: System, IRR: float, duration: tuple[int, int],
startup_months: float, startup_FOCfrac: float, startup_VOCfrac: float,
startup_salesfrac: float, WC_over_FCI: float, finance_interest: float,
finance_years: int, finance_fraction: float,
interest_during_construction: bool=True):
interest_during_construction: bool=False):
#: System being evaluated.
self.system: System = system

Expand Down Expand Up @@ -745,15 +745,25 @@ def get_cashflow_table(self):
years = self.finance_years
end = start + years
L[:start] = loan = self.finance_fraction*(C_FC[:start])
if self.interest_during_construction:
interest_during_construction = self.interest_during_construction
if interest_during_construction:
initial_loan_principal = loan_principal_with_interest(loan, interest)
else:
initial_loan_principal = loan.sum()
LP[start:end] = solve_payment(initial_loan_principal, interest, years)
loan_principal = 0
for i in range(end):
LI[i] = li = (loan_principal + L[i]) * interest
LPl[i] = loan_principal = loan_principal - LP[i] + li + L[i]
if interest_during_construction:
for i in range(end):
LI[i] = li = (loan_principal + L[i]) * interest
LPl[i] = loan_principal = loan_principal - LP[i] + li + L[i]
else:
for i in range(end):
if i < start:
li = 0
else:
li = (loan_principal + L[i]) * interest
LI[i] = li
LPl[i] = loan_principal = loan_principal - LP[i] + li + L[i]
taxable_cashflow = S - C - D - LP
nontaxable_cashflow = D + L - C_FC - C_WC
else:
Expand Down

0 comments on commit 4e7f16b

Please sign in to comment.