# Regulation and Economic Development - Simulated Graphs

Published: 6 March 2024| Version 1 | DOI: 10.17632/xtzxf87dxb.1
Contributor:
Sunil Maria Benedict

## Description

The provided Python code generates and visualizes simulated data for various economic and regulatory concepts. Here's a description for each section of the code: 1. Regulatory Entropy Simulation: Randomly generates n probability values (p_values) and calculates regulatory entropy as the negative sum of the product of each probability and its logarithm. Visualization: Displays a bar plot representing the regulatory conditions and their corresponding probabilities. 2. Economic Potential Energy Simulation: Creates a potential function using the sine function over a range of economic states and calculates economic potential energy through numerical integration (trapezoidal rule). Visualization: Plots the potential function and shades the area under the curve to represent economic potential energy. 3. Regulatory Inertia Simulation: Generates n random acceleration values and calculates regulatory inertia by multiplying acceleration with a constant mass value. Visualization: Displays a scatter plot of regulatory inertia over time. 4. Economic Resonance Frequency Simulation: Computes the resonance frequency of an economic system based on given spring constant and mass values. Visualization: No plot is generated as the resonance frequency is a constant value. 5. Regulatory Potential Energy Simulation: Generates displacement values from equilibrium and calculates regulatory potential energy using the formula for spring potential energy. Visualization: Displays a scatter plot of regulatory potential energy over time. 6. Economic Friction Coefficient Simulation: Randomly generates applied force and frictional force values and calculates the economic friction coefficient. Visualization: Displays a scatter plot of economic friction coefficients over time. 7. Regulatory Gradient Simulation: Generates cumulative regulatory levels and computes the gradient of these levels. Visualization: Plots both the cumulative regulatory levels and their gradient over time, with a legend. 8. Economic Entropy Simulation: Generates random economic variables and calculates their entropy based on histogram density. Visualization: Displays a histogram of economic variables with their density and calculates economic entropy. In summary, the code provides a diverse set of simulated economic and regulatory data, accompanied by visualizations that offer insights into the dynamics of each concept. The plots facilitate an understanding of the relationships and behaviors within these economic and regulatory simulations.

## Steps to reproduce

import numpy as np import matplotlib.pyplot as plt n = 100 p_values = np.random.rand(n) regulatory_entropy = -np.sum(p_values * np.log(p_values)) # Plotting Regulatory Entropy plt.figure(figsize=(8, 6)) plt.bar(range(n), p_values) plt.title('Regulatory Entropy') plt.xlabel('Regulatory Conditions') plt.ylabel('Probability') plt.show() # Simulating data for Economic Potential Energy economic_states = np.linspace(0, 10, 100) potential_function = np.sin(economic_states) economic_potential_energy = np.trapz(potential_function, economic_states) # Plotting Economic Potential Energy plt.figure(figsize=(8, 6)) plt.plot(economic_states, potential_function) plt.fill_between(economic_states, potential_function, alpha=0.3) plt.title('Economic Potential Energy') plt.xlabel('Economic States') plt.ylabel('Potential Function') plt.show() mass = 5 acceleration = np.random.normal(0, 1, n) regulatory_inertia = mass * acceleration plt.figure(figsize=(8, 6)) plt.scatter(range(n), regulatory_inertia) plt.title('Regulatory Inertia') plt.xlabel('Time') plt.ylabel('Inertia') plt.show() economic_spring_constant = 2 economic_mass = 3 economic_resonance_frequency = 1 / (2 * np.pi * np.sqrt(economic_spring_constant / economic_mass)) regulatory_spring_constant = 1.5 displacement_from_equilibrium = np.random.normal(0, 1, n) regulatory_potential_energy = 0.5 * regulatory_spring_constant * displacement_from_equilibrium**2 plt.figure(figsize=(8, 6)) plt.scatter(range(n), regulatory_potential_energy) plt.title('Regulatory Potential Energy') plt.xlabel('Time') plt.ylabel('Potential Energy') plt.show() applied_force = np.random.rand(n) frictional_force = np.random.normal(0, 1, n) economic_friction_coefficient = -frictional_force / applied_force # Plotting Economic Friction Coefficient plt.figure(figsize=(8, 6)) plt.scatter(range(n), economic_friction_coefficient) plt.title('Economic Friction Coefficient') plt.xlabel('Time') plt.ylabel('Friction Coefficient') plt.show() regulatory_levels = np.cumsum(np.random.normal(0, 1, n)) regulatory_gradient = np.gradient(regulatory_levels) # Plotting Regulatory Gradient plt.figure(figsize=(8, 6)) plt.plot(range(n), regulatory_levels, label='Regulatory Levels') plt.plot(range(n), regulatory_gradient, label='Regulatory Gradient') plt.legend() plt.title('Regulatory Gradient') plt.xlabel('Time') plt.ylabel('Regulatory Levels') plt.show() # Simulating data for Economic Entropy economic_variables = np.random.normal(0, 1, n) economic_density, _ = np.histogram(economic_variables, bins=10, density=True) economic_entropy = -np.sum(economic_density * np.log(economic_density)) # Plotting Economic Entropy plt.figure(figsize=(8, 6)) plt.hist(economic_variables, bins=10, density=True, alpha=0.7) plt.title('Economic Entropy') plt.xlabel('Economic Variables') plt.ylabel('Density') plt.show()

## Institutions

CMR Group of institutions

## Categories

Mathematics, Economics, Econometrics, Econophysics, Computer Modeling in Economics