DevTreks.Extensions/NPVCalculators/BIs/BICalculator.cs
/// <summary>
/// Calculate preproduction costs.
/// Output is a new annuity node, with amortized preproduction costs, that will get added to each 
/// subsequent time period
/// </summary>
Calculate preproduction costs.
Output is a new annuity node, with amortized preproduction costs, that will get added to each
subsequent time period
Calculate preproduction costs . Output is a new annuity node with amortized preproduction costs that will get added to each subsequent time period
private double CalculatePreProductionAmortizedCost(double amortOpTotal,
            double realRate, int prodPeriods, double salvVal)
        {
            double dbPreProductionCost = 0;
            double dbCapitalRecoveryFactor = 0;
            double dbDiscountedSalvVal = 0;
            if (prodPeriods < 1)
            {
                prodPeriods = 1;
            }
            dbDiscountedSalvVal = salvVal / (System.Math.Pow((1 + realRate), prodPeriods));
            if (prodPeriods == 1)
            {
                dbPreProductionCost = amortOpTotal;
                dbCapitalRecoveryFactor
                    = (GeneralRules.CalculateCapitalRecoveryFactor(prodPeriods, 0, realRate));
                dbPreProductionCost = (((amortOpTotal) - dbDiscountedSalvVal) 
                    * dbCapitalRecoveryFactor);
            }
            else
            {
                dbCapitalRecoveryFactor
                    = (GeneralRules.CalculateCapitalRecoveryFactor(prodPeriods, 0, realRate));
                dbPreProductionCost = (((amortOpTotal) - dbDiscountedSalvVal) 
                    * dbCapitalRecoveryFactor);
            }
            return dbPreProductionCost;
        }
private double CalculatePreProductionAmortizedCost ( double amortOpTotal , double realRate , int prodPeriods , double salvVal ) { double dbPreProductionCost = 0 ; double dbCapitalRecoveryFactor = 0 ; double dbDiscountedSalvVal = 0 ; if ( prodPeriods < 1 ) { prodPeriods = 1 ; } dbDiscountedSalvVal = salvVal / ( System . Math . Pow ( ( 1 + realRate ) , prodPeriods ) ) ; if ( prodPeriods == 1 ) { dbPreProductionCost = amortOpTotal ; dbCapitalRecoveryFactor = ( GeneralRules . CalculateCapitalRecoveryFactor ( prodPeriods , 0 , realRate ) ) ; dbPreProductionCost = ( ( ( amortOpTotal ) - dbDiscountedSalvVal ) * dbCapitalRecoveryFactor ) ; } else { dbCapitalRecoveryFactor = ( GeneralRules . CalculateCapitalRecoveryFactor ( prodPeriods , 0 , realRate ) ) ; dbPreProductionCost = ( ( ( amortOpTotal ) - dbDiscountedSalvVal ) * dbCapitalRecoveryFactor ) ; } return dbPreProductionCost ; }
Calculate preproduction costs.
Calculate preproduction costs .
//discount the SalvVal //CompPriceTotals store interest charge; also adjusted and discounted prices //so the amortization occurs over these adjusted numbers using a real rate //preproduction costs are discounted back to the beginning of year //need to use discounting even in 1 year //note: nom interest is taken out when practice passed in //inflation added back in to the annuity using CalcDiscountedAnnuity in CalcTotal
amortOpTotal
double
realRate
double
prodPeriods
int
salvVal
double