Functions for microeconomic analysis
Project description
Overview
pyMicroeconomics is package for symbolic analysis and visualization of market equilibrium conditions with various supply and demand curve specifications. This is a wrapper of several packages such as Sympy and Matplotlib. When used interactively, it allows you to build a market equilibrium in an iterative way, starting from the demand and supply functions.
Uses:
- Define different types of supply and demand curves (linear, power, exponential, quadratic)
- Calculate market equilibrium points
- Compute consumer and producer surplus
- Visualize market equilibrium with interactive plots
Installation
pip install pyMicroeconomics
This package is designed to be used interactively in a Jupyter Notebook.
Usage Examples
Basic Market Equilibrium Analysis
from market_equilibrium import linear_demand, linear_supply, market_equilibrium
# Create demand and supply equations
demand = linear_demand()
supply = linear_supply(c_param=20, d_param=3) # q = 20 + 3p
# Calculate equilibrium
results = market_equilibrium(demand, supply)
# Display results
from market_equilibrium import display_equilibrium
display_equilibrium(results)
Interactive Plotting
from market_equilibrium import plot_equilibrium
# Create interactive plot with adjustable parameters
plot_equilibrium(results)
Example Functions
Demand Curves
- Linear: $q = a - b p$
- Power: $q = exp(a)*p^b$
- Exponential: $q = exp(ap + b)$
- Quadratic: $q = a - b p^2$
Supply Curves
- Linear: $q = c + d p$
- Power: $q = exp(c) * p^d$
- Exponential: $q = exp(c*p + d)$
- Quadratic: $q = c + d p^2$
Contributing
Contributions are welcome! Please submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Built using SymPy
- Visualization powered by Matplotlib and ipywidgets
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pymicroeconomics-0.0.5.tar.gz.
File metadata
- Download URL: pymicroeconomics-0.0.5.tar.gz
- Upload date:
- Size: 12.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc918a274d4ea9fc017282ec1bcb281e0e21faf31128e962d60d275f168b8427
|
|
| MD5 |
7728f28197c00e9af9a11ba77a5698a2
|
|
| BLAKE2b-256 |
a7a41996aa59800fbf61b64cab59769814511c06b0c272fffb8369052166fe29
|
File details
Details for the file pymicroeconomics-0.0.5-py3-none-any.whl.
File metadata
- Download URL: pymicroeconomics-0.0.5-py3-none-any.whl
- Upload date:
- Size: 11.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8787a85a28e5312c354bde48a08c6734ba35c9f94f408d0ac4b2375d65255f1
|
|
| MD5 |
7d11bcef6d4617c748fb9db959fb2c05
|
|
| BLAKE2b-256 |
3dc89819123f8c8ad3560b9dde29094daf1ecc04fa53f6b9fd2b4403b8f6305b
|