- Function InvestmentConstantRateAll(PresentValue, FutureValue, Payment, NumberPeriods, Type, Mode, NumberSolutions, Solutions)
InvestmentConstantRateAll
The procedure InvestmentConstantRateAll
returns the interest rate(s)
for an investment based on periodic, constant payments and a constant
interest rate.
InvestmentConstantRateAll(
PresentValue, ! (input) numerical expression
FutureValue, ! (input) numerical expression
Payment, ! (input) numerical expression
NumberPeriods, ! (input) numerical expression
Type, ! (input) numerical expression
Mode, ! (input) numerical expression
NumberSolutions, ! (output) numerical expression
Solutions ! (output) one-dimensional parameter
)
Arguments
- PresentValue
The total amount that a series of future payments is worth at this moment. PresentValue must be a real number.
- FutureValue
The cash balance you want to attain after the last payment is made. FutureValue must be a real number.
- Payment
The periodic payment for the investment. Payment must be a real number.
- NumberPeriods
The total number of payment periods for the investment. NumberPeriods must be a positive integer.
- Type
Indicates when payments are due. \(Type = 0\): Payments are due at the end of each period. \(Type = 1\): Payments are due at the beginning of each period.
- Mode
Indicates whether all the solutions need to be found or just one. \(Mode = 0\): the search for solutions stops after one solution is found. \(Mode = 1\): the search for solutions continues till all solutions are found.
- NumberSolutions
The number of solutions found. If \(Mode = 0\) NumberSolutions will always be \(1\).
- Solutions
There is not always a unique solution for InterestRate. Dependent on Mode one solution or all the solutions will be given. Solutions smaller than \(-1\) are not supposed to be relevant, so the search for solutions is limited to the area greater than \(-1\).
Note
When you want to use this procedure in an objective function or constraint you have to use
InvestmentConstantRate
.The function
InvestmentConstantRateAll
is similar to the Excel functionRATE
.
Example
Given the local declarations:
Parameter _p_noSol;
Set _s_solutionNumbers {
SubsetOf: Integers;
Index: _i_solNo;
}
Parameter _p_sols {
IndexDomain: _i_solNo;
}
All solutions to InvestmentConstantRate
can be obtained using
_s_solutionNumbers := ElementRange(1,100);
InvestmentConstantRateAll(
PresentValue : -100,
FutureValue : 0,
Payment : 10,
NumberPeriods : 13,
type : 0,
Mode : 1,
NumberSolutions : _p_noSol,
Solutions : _p_sols );
block where single_column_display := 1, listing_number_precision := 6 ;
display _p_noSol, _p_sols ;
endblock ;
In this particular example there is only one solution:
_p_noSol := 1 ;
_p_sols := data
{ 1 : 0.039769 } ;
References
General equations for investments with constant, periodic payments.