Skip to main content
1-Visitor
March 11, 2014
Question

Defining Weibull and custom function when using MonteCarlo

  • March 11, 2014
  • 2 replies
  • 4574 views

We have recently started on the more advanced statistical features in Mathcad. We would like some advice.

Using Montecarlo to generate random data we would like to use the Weibull distribution and then later a custom function for our calculations. However, we are experiencing some problems which we believe is due to our lack of experience.

The first issue is that specifying different Weibull parameters when used in a Montecarlo does not seem to change the shape of the graph (see Cylinder Radius on Pg 4). The red trend was generated using MonteCarlo with a shape factor equal to 1 defined in the seond column of the Rvals matrix on Pg 3. Changing this value however does not change the shape of the graph away from exponential decay as would normally be expected with the Weibull.

Montecarlo.JPG

Are we defiing the parameters incorrectly or how do you change the shape for different shape factors inside the Rvals matrix.

The second issue we have is to define a customized distribution function in the dist matrix. As mentioned we woudl like to use the triangular or CuDist (Pg 1) distribution. However, we are struggling to define the limits. Using the Triang distribution we only get the average in the histogram (Pg 4) and not the triangular distribution expected as calculated on Pg 2.

Can anyone help please

Barend

2 replies

23-Emerald V
March 11, 2014

Hi Barend,

I'm not actually sure what you're trying to do yet, but a quick check on your worksheet seems to indicate that the Weibull shape factor does have an effect and gives me the shapes I'd expect from that distribution.

Cheers,

Stuart

1-Visitor
March 11, 2014

We managed to simulate the Weibull as well. No problem. The problem is when trying to force the Weibull or a custom function in the MonteCarlo, then it does not work as expected (see our model). We would like to understand how to apply the MonteCarlo for this. As per Alan's reply it seems as if the built-in MonteCarlo does have its issues.

19-Tanzanite
March 11, 2014

I think the in-built montecarlo function is awkward and inflexible. I prefer to write my own routine. See attached for a couple of simple examples: one using a triangular distribution and the other using a three-parameter Weibull.

Alan

1-Visitor
March 11, 2014

If we understand correctly, you therefore say that you do not use the MathCad built-in MonteCarlo at all, but generate your own random data according to your distribution. This means that the built-in feature is actually not a feature. The internal MonteCarlo seems to be much faster though, but then it seems limited in its application.

Are we understanding correctly. Speed is an issue as we are also applying it in more complex application where we have 20 variables. Running your model for 10000 iterations takes 100 seconds. Running our built-in model calculates almost immediately. True, we only have two variables where you have three, but the time seems hugely different. Is there any recommendation for speeding this up.

From experience, when you run complex models, what would the best hardware configuration be.

Barend