We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import matplotlib.pyplot as plt import numpy as np import math k = .2 # Sigmoid Steepness m = 1.5 # Exponent n = 100 # Exponential Scaling Factor def calculate_fee(x, a, b, base_fee): def sigmoid(t): midpoint = (b - a) / 2 + a return base_fee / (1 + math.exp(-k * (t - midpoint))) if x <= a: return 0 elif x <= b: return sigmoid(x) else: return base_fee + ((x-b)**(m))/n # Parameters a = 3 b = 15 base_fee = 1 k = 1 # Generate values for x x_values = np.linspace(0, 40, num=5000) y_values = [calculate_fee(x, a, b, base_fee) for x in x_values] # Plot the function plt.plot(x_values, y_values, label='Fee Curve') plt.axvline(x=a, color='r', linestyle='--', label='Lower Threshold (a)') plt.axvline(x=b, color='g', linestyle='--', label='Upper Threshold (b)') plt.xlabel('Number of Transactions per Period (x)') plt.ylabel('Calculated Fee') plt.title('Fee Curve for a = 3, b = 15, base_fee = 1, k = 10') plt.legend() plt.grid(True) plt.show()
We should also add some rounding, I think.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
We should also add some rounding, I think.
The text was updated successfully, but these errors were encountered: