Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Mechanical Engineering Expert

The purpose of this assignment is to investigate a Monte Carlo Simulation to numerically calculate the area under a Gaussian PDF as in Figure 8.10-a of your text (the Q(y) function).

One of the most useful methods to determine the integral of function that cannot be performed in closed form are the so-called Monte Carlo methods. For the particular method that we are using here, matlab will generate a large number of gaussian distributed random numbers. The fraction of these numbers greater than a value. y will be the value of Q(y).

This works because the PDF for a gaussian is normalized, iePx(x)dx = 1

To generate a 1 dimensional array of gaussian random numbers in matlab use the randn(M,N) function.

For example to generate 10000 random numbers we can use

N=10000;

x=randn(1,N);

If we want to determine the number of values of x that are greater than zero we can use code similar to the following

x0=x ./abs(x); % converts the array elements to ±1

x1=(x0+1)/2; % converts the array elements to 1s and 0s

n0 = (z1*ones(N,1))/N;

% n0 is the fraction of array elements that are greater than 0

Of course, due to the symmetry of the pdf, the answer should be .5. Implementing this code should give one confidence that the method works. Note that the answer might not come out to be .5 unless N is big enough. Try for N=10, N=100, N=1000, N=10000;, N=100000;

N=1000000, and N=10000000;

randn(M, N) generates gaussian random numbers with 0 mean and unity variance. To change to a mean in and variance a. remember the new sequence can be formed form the orginal sequence, x, by

σx(x + m)

To compare to a value y rather than 0, just subtract y from the random variables and test for greater than zero.

Assignment:

1. Complete the code for arbitrary, m, σx and y.

2. Test when m = 0, σx = 1, and y = 0 and various N's to verify your answer is .5.

3. Rerun part 2 when σx = .01, .1, 10, and 100. Are your results what you expect? Why or why not?

4. Test when m = 5, σx = 1, and y = 5, 7, 9, 11. Are your results what you expect? Why or why not?

5. Reran part 5 when σx = .01, .1, 10, and 100. Are your results what you expect? Why or why not?

Note: this should be implemented using no for loops.

Mechanical Engineering, Engineering

  • Category:- Mechanical Engineering
  • Reference No.:- M91521044
  • Price:- $30

Priced at Now at $30, Verified Solution

Have any Question?


Related Questions in Mechanical Engineering

Fluid mechanics assignment - viscous flow in pipesq1 as

Fluid Mechanics Assignment - Viscous Flow in Pipes Q1. As shown in the figure below, water "bubbles up" 3 in. above the exit of the vertical pipe attached to three horizontal pipe segments. The total length of the 0.75-i ...

Fluid mechanics assignment - finite control volume analysis

Fluid Mechanics Assignment - Finite Control Volume Analysis and Dimensional Analysis Q1. The wind blows through a 7ft × 10ft garage door opening with a speed of 5 ft/s as shown in the figure. Determine the average speed, ...

Alocate ten minutes for the presentationuse audio visual

Allocate ten minutes for the presentation Use audio / visual / technological supports / aids where appropriate Use a minimum of 3 properly referenced articles. THEMES PRESENTATION TOPIC MEMORY Discuss the three learning ...

Life cycle assessmentfor your chosen service eg white board

LIFE CYCLE ASSESSMENT For your chosen service (e.g. white board markers), identify two alternatives of getting the service (e.g. brand A, brand B). Choose the most environmentally friendly option by conducting life cycle ...

Problem on shaft -assuming no frictional losses a torque of

Problem on Shaft - Assuming no frictional losses, a torque of T = 750lb·in is applied through the shaft of gear F in order to drive the roller chain at point B at a constant speed. The chain sprocket has a pitch diameter ...

Force exerted by jet on moving cart1 you need to determine

Force Exerted By Jet On Moving cart. 1. You need to determine the velocity of water that comes out from the nozzle of this system. need the equation please formulate the equation. 2. This water will strike a small cart a ...

Structural mechanics questions -q1 a 150-lb bucket is

Structural Mechanics Questions - Q1. A 150-lb bucket is suspended from a cable on the wooden frame. Determine the resultant internal loadings on the cross section at D, and at E. Q2. The shaft is supported at its ends by ...

Mechanical engineering assignment task - solve the given

Mechanical Engineering Assignment Task - Solve the given problem. Task 1 - A spring with a one-turn loop of 40mm mean radius is formed from a round section of wire having 5 mm diameter. The straight tangential legs of th ...

Assignment -q1 explain the difference between the

Assignment - Q1. Explain the difference between the metacentric height of a ship during 'Partially Afloat condition and 'Free Floating' condition; aid a sketch to support your answer. Q2. With the aid of sketches, explai ...

Expansion processes of a perfect gasassignment1 attend the

Expansion Processes of a Perfect Gas Assignment: 1. Attend the laboratory class and complete the lab tests according to the supervisor's requirement. Students will not allowed to submit their report if they do not come t ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As