Skip to content

Commit

Permalink
Update tutorial.rst
Browse files Browse the repository at this point in the history
undo some of the garbage from chatgpt
  • Loading branch information
alexanderthclark authored Feb 1, 2025
1 parent 897709a commit 59c0b7d
Showing 1 changed file with 6 additions and 26 deletions.
32 changes: 6 additions & 26 deletions docs/tutorial.rst
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
Market Equilibrium Analysis Using FreeRide
=========================================

Market equilibrium is a fundamental concept in economics that occurs when the quantity demanded equals the quantity supplied at a given price. This tutorial will guide you through analyzing market equilibrium using the FreeRide package, which provides tools for modeling and analyzing supply and demand curves, calculating equilibrium prices and quantities, and visualizing market dynamics.
This tutorial will guide you through analyzing market equilibrium.

We'll start by exploring the key concepts of supply and demand, followed by a step-by-step guide on how to use FreeRide's modules to analyze market equilibrium. By the end of this tutorial, you'll have a solid understanding of how to apply these concepts in real-world scenarios.

Key Concepts
-------------

- **Demand Curve**: A demand curve represents the relationship between the price of a good and the quantity demanded by consumers. It typically slopes downward, indicating that as the price decreases, the quantity demanded increases.

- **Supply Curve**: A supply curve represents the relationship between the price of a good and the quantity supplied by producers. It usually slopes upward, indicating that as the price increases, producers are willing to supply more of the good.

- **Market Equilibrium**: The point where the demand and supply curves intersect. At this price (equilibrium price), the quantity demanded equals the quantity supplied (equilibrium quantity). This is the ideal price and quantity in a competitive market.
We'll start by exploring the key concepts of supply and demand, followed by a step-by-step guide on how to use FreeRide's modules to analyze market equilibrium.

Setup
-----
Expand All @@ -28,7 +19,7 @@ Next, let's import the necessary modules and create some demand and supply curve
Creating Demand and Supply Curves
----------------------------------

The `Demand` and `Supply` classes in FreeRide are used to model the demand and supply curves. These classes can be initialized using formulas for price as a function of quantity.
The `Demand` and `Supply` classes in FreeRide are used to model the demand and supply curves. These classes can be initialized using formulas. Currently, a coefficient must explicitly be included. That is, `"P = 12-1*Q"` works but "`P = 12 - Q"` does not.

Example:

Expand All @@ -40,7 +31,7 @@ Example:
d = Demand.from_formula('P = 12 - 1*Q')
# Define a supply curve
s = Supply.from_formula("P = 23 + 2*Q")
s = Supply.from_formula("P = 2 + 2*Q")
# Visualize the demand and supply curves
ax = d.plot(label="Demand")
Expand All @@ -49,7 +40,7 @@ Example:
ax.set_title("Demand and Supply Curves")
plt.show()
This code defines a demand curve with the formula `P = 12 - 1*Q` and a supply curve with the formula `P = 23 + 2*Q`. These equations represent the relationship between price (P) and quantity (Q) for the demand and supply of a good.
This code defines a demand curve with the formula `P = 12 - 1*Q` and a supply curve with the formula `P = 2 + 2*Q`. These equations represent the relationship between price (P) and quantity (Q) for the demand and supply of a good.

Analyzing Market Equilibrium
-----------------------------
Expand All @@ -60,7 +51,7 @@ Example:

.. code-block:: python
from freeride.market import Market
from freeride.equilibrium import Market
# Create a Market object with the demand and supply curves
m = Market(d, s)
Expand All @@ -74,14 +65,3 @@ In this code, the `Market` object is created by passing the demand and supply cu

The plot shows the equilibrium price and quantity, where the demand and supply curves intersect. Additionally, the total surplus is calculated and displayed.

Conclusion
----------

In this tutorial, we've learned how to model and analyze market equilibrium using the FreeRide package. By defining demand and supply curves, creating a market, and visualizing the results, we can better understand how supply and demand interact in a market.

Next Steps
----------

You can extend this analysis by experimenting with different demand and supply functions, analyzing shifts in the curves, or exploring other market scenarios. The FreeRide package provides an easy-to-use framework for performing these analyses and more.

For more information, check out the FreeRide documentation or explore additional features such as consumer surplus, producer surplus, and elasticity.

0 comments on commit 59c0b7d

Please sign in to comment.