VII. Applications: sciences, economics and optimization
50. Economics, finance and insurance
Financial and economic calculations are on the home screen in the section "Applications", field Economics: interest for days (30E/360, ACT/360, ACT/365), a bill of exchange and its discount, an annuity paid out of savings (temporary, deferred, a perpetuity), mixed interest, savings with an initial deposit and yearly crediting, a loan repaid by a constant principal, interest on a deposit (simple, compound, continuous, with tax and inflation), regular savings, a loan with its amortization schedule and APR, a bond, an investment (NPV, IRR, payback), currency conversion, the break-even point, profit maximization, market equilibrium, Leontief's model and Markov chains, and actuarial mathematics – life tables, life insurance, annuities, reserves and non-life insurance with bonus-malus.
Investing in P2P loans computes the portfolio value (the cash on the account and the outstanding principal) month by month: the deposits are invested in whole amounts per loan, the loans are repaid by an annuity, the platform takes an origination fee and a share of the interest, the losses are a yearly default rate; for comparison a closed formula with continuous reinvestment. Inversely it finds the monthly deposit or the time for a target amount.
Amounts can be in any currency – pick it in the form (the default is your phone's country's); the calculation doesn't depend on it. Currency conversion takes the Czech National Bank's daily rates (in Czech or on a phone set to Czechia) or the European Central Bank's reference rates (in the other languages) and converts any pair through a common currency, showing the rates' source and date.
Amounts in a currency are written by the custom of the app's language and the region in the phone's settings (2,431.50 USD; in Czech 2 431,50 Kč; in German 2.431,50, in Switzerland 2’431.50), and so is the rate table's date.
The steps show the formulas, the substitution and the intermediate results: the effective and the real rate, the amortization schedule, the flows' present value, marginal revenue and cost as derivatives, surpluses as integrals, the Leontief inverse and the stationary distribution by solving a system. Actuarial mathematics uses the commutation numbers; the reserve is shown prospectively and retrospectively.
Examples
model(deposit; find=Kn[one]; K0=100000[one]; p=5[pct]; n=10[one]; d=15[pct]; infl=3[pct]; kind=compound; freq=monthly; cur=CZK)![model(deposit; find=Kn[one]; K0=100000[one]; p=5[pct]; n=10[one]; d=15[pct]; infl=3[pct]; kind=compound; freq=monthly; cur=CZK)](img/eco-deposit.png)
![model(deposit; find=Kn[one]; K0=100000[one]; p=5[pct]; n=10[one]; d=15[pct]; infl=3[pct]; kind=compound; freq=monthly; cur=CZK)](img/eco-deposit-1.png)
![model(deposit; find=Kn[one]; K0=100000[one]; p=5[pct]; n=10[one]; d=15[pct]; infl=3[pct]; kind=compound; freq=monthly; cur=CZK)](img/eco-deposit-2.png)
model(savings; find=S[one]; a=2000[one]; p=3[pct]; n=15[one]; d=15[pct]; timing=due; freq=monthly; cur=CZK)![model(savings; find=S[one]; a=2000[one]; p=3[pct]; n=15[one]; d=15[pct]; timing=due; freq=monthly; cur=CZK)](img/eco-savings.png)
![model(savings; find=S[one]; a=2000[one]; p=3[pct]; n=15[one]; d=15[pct]; timing=due; freq=monthly; cur=CZK)](img/eco-savings-1.png)
![model(savings; find=S[one]; a=2000[one]; p=3[pct]; n=15[one]; d=15[pct]; timing=due; freq=monthly; cur=CZK)](img/eco-savings-2.png)
model(loan; find=a[one]; D=3000000[one]; p=5[pct]; n=25[one]; F=15000[one]; freq=monthly; cur=CZK)![model(loan; find=a[one]; D=3000000[one]; p=5[pct]; n=25[one]; F=15000[one]; freq=monthly; cur=CZK)](img/eco-loan.png)
![model(loan; find=a[one]; D=3000000[one]; p=5[pct]; n=25[one]; F=15000[one]; freq=monthly; cur=CZK)](img/eco-loan-1.png)
![model(loan; find=a[one]; D=3000000[one]; p=5[pct]; n=25[one]; F=15000[one]; freq=monthly; cur=CZK)](img/eco-loan-2.png)
model(savings; find=S[one]; a=1000[one]; K0=20000[one]; p=2[pct]; n=5[one]; timing=due; freq=monthly; credit=annual; cur=CZK)![model(savings; find=S[one]; a=1000[one]; K0=20000[one]; p=2[pct]; n=5[one]; timing=due; freq=monthly; credit=annual; cur=CZK)](img/eco-savings-yearly.png)
![model(savings; find=S[one]; a=1000[one]; K0=20000[one]; p=2[pct]; n=5[one]; timing=due; freq=monthly; credit=annual; cur=CZK)](img/eco-savings-yearly-1.png)
![model(savings; find=S[one]; a=1000[one]; K0=20000[one]; p=2[pct]; n=5[one]; timing=due; freq=monthly; credit=annual; cur=CZK)](img/eco-savings-yearly-2.png)
model(lending; find=V[one]; a=2000[one]; p=8[pct]; f=1[pct]; loss=2[pct]; L=200[one]; M=60[one]; n=10[one]; cur=CZK)![model(lending; find=V[one]; a=2000[one]; p=8[pct]; f=1[pct]; loss=2[pct]; L=200[one]; M=60[one]; n=10[one]; cur=CZK)](img/eco-lending.png)
![model(lending; find=V[one]; a=2000[one]; p=8[pct]; f=1[pct]; loss=2[pct]; L=200[one]; M=60[one]; n=10[one]; cur=CZK)](img/eco-lending-1.png)
![model(lending; find=V[one]; a=2000[one]; p=8[pct]; f=1[pct]; loss=2[pct]; L=200[one]; M=60[one]; n=10[one]; cur=CZK)](img/eco-lending-2.png)
model(loan; find=a[one]; D=1200000[one]; p=5[pct]; n=10[one]; freq=monthly; method=constant; schedule=short; cur=CZK)![model(loan; find=a[one]; D=1200000[one]; p=5[pct]; n=10[one]; freq=monthly; method=constant; schedule=short; cur=CZK)](img/eco-loan-constant.png)
![model(loan; find=a[one]; D=1200000[one]; p=5[pct]; n=10[one]; freq=monthly; method=constant; schedule=short; cur=CZK)](img/eco-loan-constant-1.png)
![model(loan; find=a[one]; D=1200000[one]; p=5[pct]; n=10[one]; freq=monthly; method=constant; schedule=short; cur=CZK)](img/eco-loan-constant-2.png)
model(daycount; find=Kn[one]; K0=50000[one]; p=2[pct]; start=2026-03-15; end=2026-09-20; d=15[pct]; basis=e30; cur=CZK)![model(daycount; find=Kn[one]; K0=50000[one]; p=2[pct]; start=2026-03-15; end=2026-09-20; d=15[pct]; basis=e30; cur=CZK)](img/eco-daycount.png)
![model(daycount; find=Kn[one]; K0=50000[one]; p=2[pct]; start=2026-03-15; end=2026-09-20; d=15[pct]; basis=e30; cur=CZK)](img/eco-daycount-1.png)
![model(daycount; find=Kn[one]; K0=50000[one]; p=2[pct]; start=2026-03-15; end=2026-09-20; d=15[pct]; basis=e30; cur=CZK)](img/eco-daycount-2.png)
model(bill; find=payout[one]; N=100000[one]; dr=6[pct]; start=2026-01-10; end=2026-04-10; basis=act360; cur=CZK)![model(bill; find=payout[one]; N=100000[one]; dr=6[pct]; start=2026-01-10; end=2026-04-10; basis=act360; cur=CZK)](img/eco-bill.png)
![model(bill; find=payout[one]; N=100000[one]; dr=6[pct]; start=2026-01-10; end=2026-04-10; basis=act360; cur=CZK)](img/eco-bill-1.png)
![model(bill; find=payout[one]; N=100000[one]; dr=6[pct]; start=2026-01-10; end=2026-04-10; basis=act360; cur=CZK)](img/eco-bill-2.png)
model(annuity; find=a[one]; PV=2000000[one]; p=3[pct]; n=20[one]; k=5[one]; kind=temporary; timing=ordinary; freq=monthly; cur=CZK)![model(annuity; find=a[one]; PV=2000000[one]; p=3[pct]; n=20[one]; k=5[one]; kind=temporary; timing=ordinary; freq=monthly; cur=CZK)](img/eco-annuity.png)
![model(annuity; find=a[one]; PV=2000000[one]; p=3[pct]; n=20[one]; k=5[one]; kind=temporary; timing=ordinary; freq=monthly; cur=CZK)](img/eco-annuity-1.png)
![model(annuity; find=a[one]; PV=2000000[one]; p=3[pct]; n=20[one]; k=5[one]; kind=temporary; timing=ordinary; freq=monthly; cur=CZK)](img/eco-annuity-2.png)
model(bond; find=price[one]; N=1000[one]; cp=5[pct]; n=5[one]; y=4[pct]; freq=annual; cur=EUR)![model(bond; find=price[one]; N=1000[one]; cp=5[pct]; n=5[one]; y=4[pct]; freq=annual; cur=EUR)](img/eco-bond.png)
![model(bond; find=price[one]; N=1000[one]; cp=5[pct]; n=5[one]; y=4[pct]; freq=annual; cur=EUR)](img/eco-bond-1.png)
![model(bond; find=price[one]; N=1000[one]; cp=5[pct]; n=5[one]; y=4[pct]; freq=annual; cur=EUR)](img/eco-bond-2.png)
model(npv; find=irr[one]; CF=-1000 300 400 500 200[one]; r=10[pct]; cur=EUR)![model(npv; find=irr[one]; CF=-1000 300 400 500 200[one]; r=10[pct]; cur=EUR)](img/eco-npv.png)
![model(npv; find=irr[one]; CF=-1000 300 400 500 200[one]; r=10[pct]; cur=EUR)](img/eco-npv-1.png)
![model(npv; find=irr[one]; CF=-1000 300 400 500 200[one]; r=10[pct]; cur=EUR)](img/eco-npv-2.png)
model(exchange; find=converted[one]; A=100[one]; from=EUR; to=CZK; source=cnb)
model(profit; find=optimum[one]; a=100[one]; b=2[one]; F=200[one]; cv=20[one]; e=0.5[one]; cur=CZK)![model(profit; find=optimum[one]; a=100[one]; b=2[one]; F=200[one]; cv=20[one]; e=0.5[one]; cur=CZK)](img/eco-profit.png)
![model(profit; find=optimum[one]; a=100[one]; b=2[one]; F=200[one]; cv=20[one]; e=0.5[one]; cur=CZK)](img/eco-profit-1.png)
![model(profit; find=optimum[one]; a=100[one]; b=2[one]; F=200[one]; cv=20[one]; e=0.5[one]; cur=CZK)](img/eco-profit-2.png)
model(market; find=equilibrium[one]; a=100[one]; b=2[one]; cs=10[one]; d=3[one]; t=5[one]; cur=CZK)![model(market; find=equilibrium[one]; a=100[one]; b=2[one]; cs=10[one]; d=3[one]; t=5[one]; cur=CZK)](img/eco-market.png)
![model(market; find=equilibrium[one]; a=100[one]; b=2[one]; cs=10[one]; d=3[one]; t=5[one]; cur=CZK)](img/eco-market-1.png)
![model(market; find=equilibrium[one]; a=100[one]; b=2[one]; cs=10[one]; d=3[one]; t=5[one]; cur=CZK)](img/eco-market-2.png)
model(leontief; find=x[one]; A=0.2 0.3 0.1 0.4 0.1 0.2 0.1 0.2 0.3[one]; y=100 200 150[one])![model(leontief; find=x[one]; A=0.2 0.3 0.1 0.4 0.1 0.2 0.1 0.2 0.3[one]; y=100 200 150[one])](img/eco-leontief.png)
![model(leontief; find=x[one]; A=0.2 0.3 0.1 0.4 0.1 0.2 0.1 0.2 0.3[one]; y=100 200 150[one])](img/eco-leontief-1.png)
![model(leontief; find=x[one]; A=0.2 0.3 0.1 0.4 0.1 0.2 0.1 0.2 0.3[one]; y=100 200 150[one])](img/eco-leontief-2.png)
model(markov; find=stationary[one]; P=0.8 0.15 0.05 0.1 0.8 0.1 0.05 0.15 0.8[one])
model(mortality; find=expectancy[one]; x=65[one]; table=female)![model(mortality; find=expectancy[one]; x=65[one]; table=female)](img/ins-mortality.png)
![model(mortality; find=expectancy[one]; x=65[one]; table=female)](img/ins-mortality-1.png)
![model(mortality; find=expectancy[one]; x=65[one]; table=female)](img/ins-mortality-2.png)
model(lifeinsurance; find=premium[one]; x=40[one]; n=20[one]; i=2.5[pct]; S=1000000[one]; product=endowment; payment=annual; table=male; cur=CZK)![model(lifeinsurance; find=premium[one]; x=40[one]; n=20[one]; i=2.5[pct]; S=1000000[one]; product=endowment; payment=annual; table=male; cur=CZK)](img/ins-life.png)
![model(lifeinsurance; find=premium[one]; x=40[one]; n=20[one]; i=2.5[pct]; S=1000000[one]; product=endowment; payment=annual; table=male; cur=CZK)](img/ins-life-1.png)
![model(lifeinsurance; find=premium[one]; x=40[one]; n=20[one]; i=2.5[pct]; S=1000000[one]; product=endowment; payment=annual; table=male; cur=CZK)](img/ins-life-2.png)
model(nonlife; find=stationary[one]; levels=100 90 80 70 60 50[one]; q=10[pct]; mode=bonusmalus; rule=reset; cur=CZK)![model(nonlife; find=stationary[one]; levels=100 90 80 70 60 50[one]; q=10[pct]; mode=bonusmalus; rule=reset; cur=CZK)](img/ins-bonus.png)
![model(nonlife; find=stationary[one]; levels=100 90 80 70 60 50[one]; q=10[pct]; mode=bonusmalus; rule=reset; cur=CZK)](img/ins-bonus-1.png)
![model(nonlife; find=stationary[one]; levels=100 90 80 70 60 50[one]; q=10[pct]; mode=bonusmalus; rule=reset; cur=CZK)](img/ins-bonus-2.png)
Known limitations
- The life tables are model ones (Gompertz–Makeham, roughly like the Czech population); for precise results enter your own qₓ from official tables.
- The rates are reference rates – banks and exchange offices use their own rates and fees.
- Microeconomics with a linear demand and quadratic costs; general functions given by a formula aren't there yet.
- The conventions don't move dates for holidays – interest is for the days between the dates given; a loan has no extra repayments or rate changes.
- Investing in P2P loans is an estimate with a fixed return and a constant default rate; it ignores debt recovery, early repayment, a secondary market and taxes. This is not investment advice.