mirror of
https://github.com/TeachBooks/template.git
synced 2026-11-12 22:25:52 +00:00
started stripping down risk-and-reliability to create template
This commit is contained in:
parent
6697c0f5f8
commit
75ff95fa67
127 changed files with 54699 additions and 0 deletions
16
book/code/present_value.py
Normal file
16
book/code/present_value.py
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
t = np.linspace(0, 101)
|
||||
y_2 = 1 / (1 + 0.02)**t
|
||||
y_4 = 1 / (1 + 0.04)**t
|
||||
|
||||
fig = plt.figure()
|
||||
plt.plot(t, y_2, label='2%')
|
||||
plt.plot(t, y_4, label='4%')
|
||||
plt.grid()
|
||||
plt.legend()
|
||||
plt.xlabel('Year')
|
||||
plt.ylabel('Normalized Present Value [$-$]')
|
||||
|
||||
plt.savefig('present_value_py.svg')
|
||||
Loading…
Add table
Add a link
Reference in a new issue