Skip to content

Instantly share code, notes, and snippets.

@DiogoRibeiro7
Created September 28, 2023 22:15
Show Gist options
  • Save DiogoRibeiro7/9b56914e8fd432f453f5ed0bf4890d5a to your computer and use it in GitHub Desktop.
Save DiogoRibeiro7/9b56914e8fd432f453f5ed0bf4890d5a to your computer and use it in GitHub Desktop.
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