How to Create a Savings Interest Calculator with Mathematica?

  • Context: Mathematica 
  • Thread starter Thread starter Lobotomy
  • Start date Start date
  • Tags Tags
    Calculator Mathematica
Click For Summary
SUMMARY

This discussion focuses on creating a savings interest calculator using Mathematica. The user aims to graphically represent the relationship between savings, interest, and time using the formula (#1*(1 + #2/#3)^(#3*#4) - 1)/(#2/#3). The code includes the use of Manipulate and ListLinePlot functions to visualize the accumulated sum based on user-defined parameters such as initial investment, added contributions, growth rate, and duration in years. The user seeks guidance on generating a list or table to accurately compute and display the accumulated savings over time.

PREREQUISITES
  • Familiarity with Mathematica programming language
  • Understanding of financial concepts such as interest rates and compound interest
  • Knowledge of graphical representation techniques in Mathematica
  • Basic programming skills to manipulate functions and variables
NEXT STEPS
  • Explore Mathematica's Manipulate function for interactive visualizations
  • Learn about ListLinePlot for plotting data in Mathematica
  • Research how to create and manipulate tables in Mathematica using Table
  • Study financial formulas for calculating compound interest and savings growth
USEFUL FOR

This discussion is beneficial for Mathematica users, financial analysts, educators teaching financial literacy, and anyone interested in creating interactive financial calculators.

Lobotomy
Messages
55
Reaction score
0
Hello. I just started to learn mathematica a few days ago. I am trying
to make a calculator that can graphically represent the relationship
between:

savings
interest
time

the mathematical formula I am using you can see below.

this is what I've written sofar...







Manipulate[


**%% Here i would like to make a "ListLinePlot" using this function:
(this is the formula for my calculations)

(#1*(1 + #2/#3)^(#3*#4) - 1)/(#2/#3) &[d, g, f, n]


then I would like to use the below controlls to manipulate the values
of d,g,f and n. How is this done?

I understand that there has to be some kind of list or table that
contains the accumulated sum at certain times. But I have no clue how
to make this list. The problem with my function is that it only
calculates the correct final answer. for example

"if i invest 1000€ per month with 5% interest for 8 years, what is the
accumulated sum?"



GridLines -> Automatic,



{{f, 1, "Frequency"}, {1 -> "Annually", 1/4 -> "Quarterly",
1/12 -> "Monthly"}},
Delimiter,



{{a, 5000, "Initial Investment"}, 0, 10000000, 1000,
Appearance -> {"Open", "Labeled"}},

{{d, 0, "Added Contributions/yr"}, -500000, 500000, 1000,
Appearance -> {"Open", "Labeled"}},

{{g, 0.05, "Growth(%/100)"}, 0, 1, 0.05,
Appearance -> {"Open", "Labeled"}},

{{n, 5, "Years"}, 1, 100, 1, Appearance -> {"Open", "Labeled"}},



ControlPlacement -> Left]
 
Physics news on Phys.org
I've added this into at the top, just below Manipulate in the code:L1 = Table[(#1*((1 + (#2/#3))^(#3*x) - 1))/(#2/#3) &[a, g, f, x], {x,
0, n}]
L2 = Table[x, {x, 0, n}]

ListLinePlot[{L1, L2}, DataRange -> {0, n},I think I am on the way to the right solution but it doesn't really work... this is my entire code:

Manipulate[

L1 = Table[(#1*((1 + (#2/#3))^(#3*x) - 1))/(#2/#3) &[a, g, f, x], {x,
0, n}]
L2 = Table[x, {x, 0, n}]

ListLinePlot[{L1, L2}, DataRange -> {0, n},



GridLines -> Automatic,


Delimiter,



{{f, 12, "Frequency of contributions"}, {1 -> "Annually",
1/4 -> "Quarterly", 1/12 -> "Monthly"}},
Delimiter,



{{d, 5000, "Initial Deposit"}, 0, 10000000, 1000,
Appearance -> {"Open", "Labeled"}},

{{a, 100, "Added Contributions"}, -500000, 500000, 1000,
Appearance -> {"Open", "Labeled"}},

{{g, 0.05, "Growth(%/100)"}, 0, 1, 0.05,
Appearance -> {"Open", "Labeled"}},

{{n, 5, "Years"}, 1, 100, 1, Appearance -> {"Open", "Labeled"}},



ControlPlacement -> Left]
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
7K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K