Created
September 28, 2023 22:15
-
-
Save DiogoRibeiro7/9b56914e8fd432f453f5ed0bf4890d5a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def utility_logarithmic(wealth, a=1): | |
return a * np.log(wealth) | |
wealth = np.linspace(1, 100, 100) # Wealth values from 1 to 100 | |
utility = utility_logarithmic(wealth) | |
plt.plot(wealth, utility) | |
plt.xlabel('Wealth') | |
plt.ylabel('Utility') | |
plt.title('Logarithmic Utility Function') | |
plt.grid(True) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment