Code for Curve Two Titled 'PPF'

PHOTO EMBED

Tue Nov 14 2023 19:52:17 GMT+0000 (Coordinated Universal Time)

Saved by @dr_dziedzorm

import numpy as np
import matplotlib.pyplot as plt

# Constants for the equation
a = 100  # Example value for a
b = 1    # Example value for b
k = 2    # Example value for k

# Generate a range of x values
x_values = np.linspace(0, 10, 100)  # x will range from 0 to 10

# Calculate y values using the equation y = a - b * x^k
y_values = a - b * np.power(x_values, k)

# Create the plot
plt.figure(figsize=(8, 6))
plt.plot(x_values, y_values, label=f'y = {a} - {b} * x^{k}')

# Label the axes
plt.xlabel('x')
plt.ylabel('y')

# Add a title and legend
plt.title('Plot of the equation y = a - b * x^k')
plt.legend()

# Show the plot
plt.show()
content_copyCOPY