draftply Download

Savings Surface: Rate vs. Contribution

← All samples

savings-surface.dplyEditor
1---
2version: 0.1.0
3precision: 2
4form_title: Savings Surface
5form_description: How much of your final balance comes from the return, and how much from just saving more? Enter your own numbers, then see the whole picture — every rate/contribution combination — in the surface below.
6form_inputs: Years|years, Annual return|rate{%}, Monthly contribution|amount{€}
7form_outputs: Your final balance|result
8form_plots: 1
9---
10# draftply Pro — Savings Surface: Rate vs. Contribution
11# "How much of my final balance comes from the return, and how much from
12# just saving more?" One surface shows both at once instead of a table of
13# scenarios. This notebook also has a FORM (Pro): tap the form icon.
14
15years = 30
16rate = 5 % # your assumed annual return
17amount = 300# your monthly contribution
18
19n = years * 12
20
21# Future value of a monthly contribution `a` at annual rate `r`, compounded
22# monthly over n months (ordinary annuity).
23balance(r, a) = a * (((1 + r / 12)^n - 1) / (r / 12))
24
25result = balance(rate, amount)
26"Your scenario — final balance": result
27
28# The whole picture: x = annual return (1%–10%), y = monthly contribution
29# (100–1000), z = final balance.
30surface(balance(x, y), 0.01..0.10, 100..1000, 40, "Final balance after 30 years", "annual return", "monthly contribution", "balance")
31