This Python script compares the growth of two investment funds over a set number of years while considering different annual costs for each fund. It calculates and visualizes the future values of the investments, showcasing the impact of varying costs.
The script uses matplotlib and numpy libraries to create two essential plots:
- Investment Growth Comparison: This plot shows how Fund 1 and Fund 2 evolve over time.
- Annual Cost Differences (Positive): It illustrates the absolute annual difference in value between the two funds due to costs.
To use the script, follow these steps:
- Ensure you have Python installed on your system.
- Clone this repository to your local machine.
- Open the script using a Python environment or IDE (e.g., PyCharm).
- Modify the script's constants, such as
initial_investment
,annual_growth_rate
,cost_fund1_percentage
,cost_fund2_percentage
, andyears
, to suit your scenario. - Run the script to see the investment comparison results and plots.
- Python 3.x
- matplotlib
- numpy
Here's a sample example:
# Constants
initial_investment = 10000
annual_growth_rate = 0.10
cost_fund1_percentage = 0.5 # %
cost_fund2_percentage = 0.05 # %
years = 30
# Rest of the script...