DEQ
Compound interest
Uses Python.
2025.Feb.21 19:04:21
Principal Principal (original amount).
Interest rate Annual interest rate (assumed time unit: year).
Frequency Compounding frequency (per year).
Time Overall time (years).
Show values Show graph coordinates.

Computes compound interest, to find the final amount.

This is an example application of Python. The useful code is minimum, and most of it is related to plotting, as (more general) 'gnuplot' is used, instead of native 'matplotlib'.

Advantage is taken from: PHP, for the web page; Python for the numerical segment; and 'gnuplot', for plotting.

Draws a plot of the computed amounts.


Computation structure — A PHP file (this page: 'P-interest.php') calls (via 'action=...') an intermediate PHP file ('Interest.php'), which (through $_POST) sends the problem data as command line arguments to a Python script. This last does the computing, and makes 'system' call(s) to 'gnuplot', for the final (temporary) webpage.

Files involved: P-interest.php (this one), Interest.php, interest.py.

Keywords: PHP, command line arguments, Python script, gnuplot.

References: Plate: COmpoundInterest

• (Wikipedia) PHP (from Personal Home Page)

• (Wikipedia) Compound interest.

• Python minimize [in Optimization and root finding (scipy.optimize)], accessed 30-Aug-2024 (for possible determination of frequency).

• CISTI'2025, 20.ª Conferência Ibérica de Sistemas e Tecnologias de Informação (20.th Iberian Conference on Information Systems and Technologies), Lisboa (Portugal), 24–27 June 2024 (date to be confirmed).

• 1819-08-30: Serret, Joseph Alfred (†1885-03-02, 65 yrs.).

 
 
Valid HTML 5! IST http://web.ist.utl.pt/~mcasquilho/compute/explore/interest/P-interest.php
Created: 2024-08-30 — Last modified: 2024-08-30