Chat with us, powered by LiveChat Monte Carlo Simulation - Wridemy

Monte Carlo Simulation

Lab 9 – Monte Carlo Simulation

Engineering Computer Apps

Las_Vegas_slot_machines.jpg

Figure 1. Vegas Slot Machines (By Yamaguchi先生, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=57295504 (Links to an external site.))

Introduction

For this lab, we’re going to use the Monte Carlo method to estimate the value of pi. Wikipedia has a pretty good definition of the Monte Carlo Method (Links to an external site.):

“Monte Carlo methods, or Monte Carlo experiments, are a broad class of computational (Links to an external site.) algorithms (Links to an external site.) that rely on repeated random sampling (Links to an external site.) to obtain numerical results. The underlying concept is to use randomness (Links to an external site.) to solve problems that might be deterministic (Links to an external site.) in principle. They are often used in physical (Links to an external site.) and mathematical (Links to an external site.) problems and are most useful when it is difficult or impossible to use other approaches. Monte Carlo methods are mainly used in three problem classes:[1] (Links to an external site.) optimization (Links to an external site.)numerical integration (Links to an external site.), and generating draws from a probability distribution (Links to an external site.).

In physics-related problems, Monte Carlo methods are useful for simulating systems with many coupled (Links to an external site.) degrees of freedom (Links to an external site.), such as fluids, disordered materials, strongly coupled solids, and cellular structures (see cellular Potts model (Links to an external site.)interacting particle systems (Links to an external site.)McKean–Vlasov processes (Links to an external site.)kinetic models of gases (Links to an external site.)).

Other examples include modeling phenomena with significant uncertainty (Links to an external site.) in inputs such as the calculation of risk (Links to an external site.) in business and, in mathematics, evaluation of multidimensional definite integrals (Links to an external site.) with complicated boundary conditions (Links to an external site.). In application to systems engineering problems (space, oil exploration (Links to an external site.), aircraft design, etc.), Monte Carlo–based predictions of failure, cost overruns (Links to an external site.) and schedule overruns are routinely better than human intuition or alternative “soft” methods.[2] (Links to an external site.)

Our task will be to apply this Monte Carlo method to numerically estimate the value of pi. The value of pi can be estimated numerically by comparing the area of a circle to the square in which it is inscribed.

circleSquare.PNG

Figure 2. Circle Inscribed in a Square

The reason why this works can be shown with some simple arithmetic:

equations.PNG

Procedure

As usual, create a script, include a comment at the top explaining the purpose of the script, your name, and the date it was created.

1. Use the men function to ask the user how accurate they would like their estimate. Set the choices to .1, .01, and .001. Write a switch statement to set a variable tol to .1, .01 or .001 based on the user’s choice.

2. Write a separate function to perform the Monte Carlo simulation. Starting with n = 100, generate n random ordered pairs (x,y) between 0 and 1.

While the absolute value of the difference between your estimate and the true value of pi is less than or equal to your tolerance, perform the Monte Carlo simulation and report to the user how many iterations it took to achieve the desired accuracy.

3.

Turn-in Instructions

You will need to submit .m files for each function you define. Each .m file should include your name and function description in comments. Upload your files via Canvas. Let me know if you have any questions!

Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.

Do you need an answer to this or any other questions?

About Wridemy

We are a professional paper writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework. We offer HIGH QUALITY & PLAGIARISM FREE Papers.

How It Works

To make an Order you only need to click on “Place Order” and we will direct you to our Order Page. Fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

Are there Discounts?

All new clients are eligible for 20% off in their first Order. Our payment method is safe and secure.

Hire a tutor today CLICK HERE to make your first order