Message Boards Message Boards

0
|
4623 Views
|
4 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Difference Equation Model: Loan Calculations

Posted 10 years ago

Hi there,

I'm extremely new to Mathematica. I am trying to build a loan model wherein I use a first order difference equation to create a spreadsheet based on parameters I set in the equation. I have a few specific questions in mind...

Since I know Latex, I'm going to present my equation in that format. I'm using the following system of equations: $x_{n+1}=\lambda x_{n} + b_{n+1}, b_{n+1}=\alpha b_{n}$ is the specific system, where $\lambda=1+r$, and $0<r<1$ is an interest rate on the loan $x_{n}$ given the n^th month on the loan from month $n=0$. Moreover, $\alpha\geq 1, x_{0}=5000,b_{0}=439.79$. For the sake of a table and/or graph of data based on the solved equation (which I know to be $x_{n}=\lambda^{n}x_{0}-b_{0}\sum_{i=1}^{n}\alpha^{i}\lambda^{n-i}$. I can solve the equation perfectly fine and I understand finite difference equations and discrete dynamical systems, but I have zero clue when it comes to Mathematica's syntax, formatting, etc. Please help! This is the pathetic start on things I have right now:

Rsolve[{x[1 + n] == b[1 + n] + \[Lambda]x[n], 
  b[1 + n] == \[Alpha]b[n], \[Lambda] == 1 + r, 
  0 < r < 1, \[Alpha] >= 1, x[0] == 5000, b[0] == 438.79}, {x[1 + n],
   b[1 + n]}, 360 >= n >= 0]

I would ideally like to create something where I have knobs to adjust the parameters lambda (or r, alternatively) and alpha, with a corresponding plot that will shift in accordance to how the parameters are tweaked. Finally, I'd like to be able to create a table of values or spreadsheet for payment amount $b_{n}$ over varying alpha values. Let me know if you have tips, tricks, answers, or resources that can get me on my way!

POSTED BY: Nick Leroux
4 Replies
POSTED BY: David Reiss
POSTED BY: David Reiss
POSTED BY: David Reiss
Posted 10 years ago

What if I were to try and plot these results, or list them in a table? I'm trying to create something that assembles the data in front of me, rather than something that calculates it pointwise.

P.S. Thank you so much for your responses, they've already helped tremendously.

POSTED BY: Nick Leroux
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract