Thanks to visit codestin.com
Credit goes to github.com

Skip to content

This repository serves as a collection of Python code examples for the IE304 Simulation class. The examples provided here are designed to illustrate various simulation concepts and techniques discussed in the course.

Notifications You must be signed in to change notification settings

dorukanc/simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IE304 Simulation Class Repository

This repository contains Python scripts for simulation exercises conducted in the IE304 Simulation class.

Contents

  1. Monte Carlo Simulation of π
  2. Parking Lot Simulation
  3. Machine Failure and Repair Simulation
  4. Normal Distribution Simulation
  5. Input Data Analysis

Monte Carlo Simulation of π

The montecarlo.py script utilizes the Monte Carlo method to estimate the value of π. It generates random points within a square and calculates the ratio of points falling inside a quarter circle to the total points. By multiplying this ratio by 4, it approximates the value of π. The script then visualizes the points inside the circle and the square boundary using Matplotlib.

Alt text


Parking Lot Simulation

The parkingspot.py script simulates the system state of a parking lot over a period of time using a discrete-event simulation approach. It models car arrivals and departures based on a time-varying arrival rate following a sinusoidal pattern. The script utilizes the SimPy library for event-driven simulation and Pandas for data storage and visualization. It plots the system state (number of cars in the parking lot) against time.


Machine Failure and Repair Simulation

The sys_state_simulation.py script simulates the failure and repair process of machines over a specified time period. It models machine failures and repairs using exponential distributions for failure and repair times. The script prints the system state, next failure time, next repair time, and area under the curve of system state over time. It terminates when either all machines fail or the simulation time ends.


Normal Distribution Simulation

The areaunderfunc_sim.py script simulates the estimation of the area under a normal distribution curve using Monte Carlo simulation. It generates random points within a rectangle and calculates the ratio of points falling under the normal distribution curve to the total points. By multiplying this ratio by the area of the rectangle, it approximates the area under the curve. The script visualizes the points falling under the curve using Matplotlib.

Alt text

Input Data Analysis

This section provides an analysis of the input data using Python. It includes fitting the data to both normal and exponential distributions, plotting histograms with different bin sizes along with the fitted PDFs, displaying fitted parameters, and performing Kolmogorov-Smirnov tests for both distributions. The results are interpreted, including null hypotheses about the distribution of the data.

Alt text

Feel free to explore and utilize these scripts for simulation exercises in the IE304 Simulation class.

About

This repository serves as a collection of Python code examples for the IE304 Simulation class. The examples provided here are designed to illustrate various simulation concepts and techniques discussed in the course.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages