Simple Interest¶
Simple interest is a pattern of money growth in which the value of money increases at a linear rate:
where refers to the value of 1 dollar (or other unit of currency) after time
, at interest rate s. For example, $1 that grows at 5% simple interest is expected to grow to $1.05 after 1 year:
For quantities of money larger than dollar, we can express growth as:
Where refers to the initial amount, or principal. For example, if we start with $5 and an interest rate of 5%, it should grow to $5.25 after one year:
Examples¶
Let’s repeat the above examples using the TmVal package. Let’s start by importing Amount, and Rate which are classes that can be used for simple interest calculations (we’ll explain what these classes mean in subsequent sections):
In [1]: from tmval import Amount, Rate
Let’s see how much $1 grows to after 1 year, at an interest rate of 5%:
In [2]: my_amt = Amount(k=1, gr=Rate(s=.05))
In [3]: print(my_amt.val(1))
1.05
Now, let’s change the principal to $5:
In [4]: my_amt = Amount(k=5, gr=Rate(s=.05))
In [5]: print(my_amt.val(1))
5.25
The output is 5.25, the same as above.
TmVal also comes with a simple interest solver, simple_solver() that can be used to solve for missing inputs. For example, what rate of interest would give us $5.25, if we held $5 for a year?
In [6]: from tmval import simple_solver
In [7]: s = simple_solver(fv=5.25, pv=5, t=1)
In [8]: print(s)
Pattern: Simple Interest
Rate: 0.050000000000000044
Unit of time: 1 year