DevTreks.Extensions/AgBudgetingCalculators/InputsCapital/CapitalService1Input.cs
/// <summary>
/// Purpose:       calculate generic capital services costs;
/// References:    AAEA Equation 5.18 and 5.10b; AAEA Appendix 6A and 10A and Chapter 2
/// </summary>
calculate generic capital services costs;
References:    AAEA Equation 5.18 and 5.10b; AAEA Appendix 6A and 10A and Chapter 2
calculate generic capital services costs ; References : AAEA Equation 5 . 18 and 5 . 10b ; AAEA Appendix 6A and 10A and Chapter 2
public static void CapitalServicesDiscFactor(GeneralRules.TIME_TYPES timeType,
            GeneralRules.INFLATION_TYPES inflationType, int t,
            double inflationRate, double realRate, double nomRate,
            ref double infCostEndYrTMinus1, ref double firstYrRate,
            ref double annuityFactor, int timePeriods)
        {
            annuityFactor = 1;
            if (inflationType == GeneralRules.INFLATION_TYPES.inflationyesfirst)
            {
                if (t == 1)
                {
                    annuityFactor = (System.Math.Pow((1 + inflationRate), t) * System.Math.Pow((1 + realRate), t));
                    firstYrRate = annuityFactor;
                }
                else
                {
                    annuityFactor = (System.Math.Pow((1 + inflationRate), (t - 1)) * System.Math.Pow((1 + realRate), (t - 1))) * (firstYrRate);
                }
            }
            else if (inflationType == GeneralRules.INFLATION_TYPES.inflationyesall)
            {
                infCostEndYrTMinus1 = infCostEndYrTMinus1 * (1 + inflationRate);
                annuityFactor = (System.Math.Pow((1 + inflationRate), t) * System.Math.Pow((1 + realRate), t));
            }
            else if (inflationType == GeneralRules.INFLATION_TYPES.inflationno)
            {
                annuityFactor = System.Math.Pow((1 + realRate), t);
            }
            if (timePeriods == 1)
            {
                annuityFactor = 1;
            }
            return;
        }
public static void CapitalServicesDiscFactor ( GeneralRules . TIME_TYPES timeType , GeneralRules . INFLATION_TYPES inflationType , int t , double inflationRate , double realRate , double nomRate , ref double infCostEndYrTMinus1 , ref double firstYrRate , ref double annuityFactor , int timePeriods ) { annuityFactor = 1 ; if ( inflationType == GeneralRules . INFLATION_TYPES . inflationyesfirst ) { if ( t == 1 ) { annuityFactor = ( System . Math . Pow ( ( 1 + inflationRate ) , t ) * System . Math . Pow ( ( 1 + realRate ) , t ) ) ; firstYrRate = annuityFactor ; } else { annuityFactor = ( System . Math . Pow ( ( 1 + inflationRate ) , ( t - 1 ) ) * System . Math . Pow ( ( 1 + realRate ) , ( t - 1 ) ) ) * ( firstYrRate ) ; } } else if ( inflationType == GeneralRules . INFLATION_TYPES . inflationyesall ) { infCostEndYrTMinus1 = infCostEndYrTMinus1 * ( 1 + inflationRate ) ; annuityFactor = ( System . Math . Pow ( ( 1 + inflationRate ) , t ) * System . Math . Pow ( ( 1 + realRate ) , t ) ) ; } else if ( inflationType == GeneralRules . INFLATION_TYPES . inflationno ) { annuityFactor = System . Math . Pow ( ( 1 + realRate ) , t ) ; } if ( timePeriods == 1 ) { annuityFactor = 1 ; } return ; }
Purpose:       calculate generic capital services costs;
References:    AAEA Equation 5.18 and 5.10b; AAEA Appendix 6A and 10A and Chapter 2
Purpose : calculate generic capital services costs ; References : AAEA Equation 5 . 18 and 5 . 10b ; AAEA Appendix 6A and 10A and Chapter 2
//see equation 5.18 for sngAnnuityFactor and inflation options //need to include the first year inflated discount rate //don't make any special provisions for first year //account for option to not vary costs over time
timeType
GeneralRules.TIME_TYPES
inflationType
GeneralRules.INFLATION_TYPES
t
int
inflationRate
double
realRate
double
nomRate
double
double
ref
timePeriods
int