4 Simple Steps to Create a Monte Carlo Simulation
Update Time: 20220808 17:46:56
In the 1940s, scientists working on the atomic bomb applied Monte Carlo simulations to calculate the probability of one fissioned uranium atom causing another fission reaction, the first simulation application, and much progress has been made since then. Today we will describe how to use Minitab to create Monte Carlo simulations for known engineering and DOE equations.
Because uranium was in short supply at the time and there was little room for trial and error in testing, Monte Carlo simulations have been focused on calculating reliable probabilities based on simulated data. Today, simulation data is often used in many scenarios, from materials engineering to medical device packaging sealing to steelmaking, such as those with limited resources or where collecting real data is too expensive or impractical. Using Engage or Workspace's Monte Carlo simulation tools can.
(1) Simulate a range of possible outcomes to help make decisions
(2) Predict financial outcomes or estimate project timelines
(3) Understand the variability in a process or system
(4) Identify problems in a process or system
(5) Manage risk by understanding the cost/benefit relationship
4 Steps to get started with any Monte Carlo simulation
Simulations can be very complex, depending on the number of factors involved. However, all Monte Carlo simulations essentially have four simple steps.
 Determine the transport equations
To create a Monte Carlo simulation, you need a quantitative model that contains the business activity, plan, or process to be explored. The mathematical expression for the process is called the "transport equation." This can be known as an engineering or business equation or based on a model created from a design of experiments (DOE) or regression analysis. With software such as Minitab Engage and Minitab Workspace, you can create complex, even equations with multiple, potentially interdependent responses.
 Define input parameters
For each factor in the transport equation, determine how its data will be distributed. Some inputs may follow a normal distribution, while others follow a triangular or uniform distribution. It would help if you then determined the distribution parameters for each input. For example, you need to specify the mean and standard deviation for the inputs that follow a normal distribution. If you are not sure which distribution the data follows, you can use the tools provided by Engage and Workspace to determine it.
 Setting Up Simulations
To run a valid simulation, you must create a large random data set (containing approximately 100,000 instances) for each input. These random data points simulate the values you will see for each input over a long time. Although it sounds like a lot of work, this is where Engage and Workspace shine. Once we submit the inputs and the model, everything is processed.
 Analyzing Process Output
You can use the transport equations to calculate the simulation results with the simulation data. Running enough simulated input data through the model will reliably indicate what the process will output over time, given the expected variation in the input.
4 Steps for Monte Carlo Using a Known Engineering Equation
A manufacturing company needs to evaluate the design of a proposed product, a small piston pump that must pump 12 ml of fluid per minute. Given the natural variation in piston diameter (D), stroke length (L), and strokes per minute (RPM), you want to estimate the potential performance of thousands of pumps. Ideally, thousands of pumps will have a flow rate with a standard deviation of no greater than 0.2 ccs.
 Determining the Transfer Equation
The first step in performing a Monte Carlo simulation is determining the transport equation. In this example, you use the known engineering equation for pump flow.
The flow rate in milliliters = π(D/2)2 ∗ L ∗ RPM
 Defining the input parameters
The distribution and parameters for each input in the transfer equation must be defined. The pump piston diameter and stroke length are known, but the number of strokes per minute (RPM) required to reach the desired 12 ml/min flow rate must be calculated. The volume pumped per stroke is calculated by the following equation: π(D/2)2 * L
If D = 0.8 and L = 2.5, then 1.256 ml of fluid is discharged per stroke. Therefore, to achieve a flow rate of 12 ml/min, the RPM is 9.549.
Based on the performance of other pumps manufactured, you can assume a normal distribution of piston diameters with a mean of 0.8 cm and a standard deviation of 0.003 cm. The stroke length is normally distributed with a mean of 2.5 cm and a standard deviation of 0.15 cm. Finally, the number of strokes per minute is normally distributed with a mean of 9.549 RPM and a standard deviation of 0.17 RPM.
 To set up the simulation in Engage or Workspace
Click the Insert tab in the top ribbon and select Monte Carlo Simulation.
We've made it very simple  you provide a name for each variable, select a distribution from the dropdown menu, and enter the parameters. We will follow what is described above. If you are unsure which distribution the data follows, you can use Data Determination. This will prompt you to upload a .csv file of the data, which can be selected from the following options.
 Simulation and analysis process output
The next step is to give the equations. Here, the operation is very simple, provide the name for your output (the name we provided is Flow) and type in the correct transfer equation we identified above. You can also add upper and lower limits to see how the simulation compares.
Then, in the ribbon, select the number of simulations (100,000 is a good baseline) and click the button used to run the simulation.
For the random data generated to write this paper, the average flow rate based on 100,000 samples is 11.996. in terms of the average, we reach our target, but the minimum value is 8.7817, and the maximum value is 15.7057. this is a fairly large range. （The transfer variation (of all components) results in a standard deviation of 0.756 ml, which is well above the target value of 0.2 ml.
This pump appears to have too much design variation and needs further refinement before it can be put into production. Here, we see the benefit of simulation. If we had gone into production, we would probably have produced too many returned pumps. With the Monte Carlo simulation, we solved all these problems without the expense of building and testing thousands of prototypes or going into production too early.
You might want to see if these simulations hold up, so try it yourself! Running different simulations will result in slight variations, but the final results (with an unacceptable amount of flow rate variation) will remain consistent each time. This is what makes the Monte Carlo method so powerful.
Another optional step: parameter optimization
Knowing that the standard deviation is too high is valuable, but where Engage and Workspace stand out is their ability to help improve the situation. This is where parametric optimization comes into play.
Let's look at the first input: the piston diameter. With a mean value of 0.8, most data will be close to that value or within one or two standard deviations of the mean. But what if the smaller the piston diameter, the more efficient the Flow? Parameter optimization helps us to answer this question.
We need to specify a search range for each input to perform parameter optimization. In this case, for simplicity, I specify a search range of +/ 3 standard deviations for the algorithm. Engage or Workspace will help us find the best settings for each input to achieve our goal (in this case, reducing the standard deviation). Choosing the right range is critical; make sure that the entire range of your inputs is operational; it is useless if the best solution found cannot be replicated in a production environment.
The principle is similar if you have used the Response Optimizer in Minitab Statistical Software. Here are our results.
Based on these results, if you want to reduce the standard deviation, you should reduce the stroke length and the number of strokes per minute. The piston diameter can be kept similar in size. Remember, the key to Monte Carlo simulations is finding all of these results without building a new prototype or conducting a new experiment.
Monte Carlo Uses Design of Experiments (DOE) Response Equations
What if you don't know what equations to use or are trying to simulate the results of a unique process? In this case, we can combine Minitab Statistical Software's designbyexperiment capabilities with Engage or Workspace's simulation capabilities.
An electronics manufacturer has assigned you to improve its electrode cleaning operation, which prepares metal parts for plating. The manufacturer coats the raw material with a different layer of metal by plating to achieve the desired properties. The plating does not adhere to dirty surfaces, so the company has a continuous flow electrode cleaning system connected to an automatic plating machine. A conveyor belt immerses each part in a tank, and the voltage in the tank is transmitted through the part so that it is cleaned. Inadequate cleaning can result in high root mean square (RMS) values and poor surface finish. A properly cleaned part has a smooth surface and a low RMS.
Two key inputs can be adjusted to optimize this process: voltage (Vdc) and current density (ASF). For the electrode cleaning method, typical engineering limits for Vdc are 3 to 12 volts. Current density limits are 10 to 150 amps per square foot (ASF).
 Determining the Transfer Equation
You cannot use known formulas from the textbook for this process, but you can set up a response surface DOE in Minitab to determine the transfer equation. The response surface DOE is typically used to optimize the response by finding the best settings for a "critical few" controllable factors.
In this example, the response will be the surface quality of the part after cleaning.
Choose Statistics > DOE > Response Surface > Create Response Surface Design to create a response surface experiment in Minitab. Since we have two factors (voltage (Vdc) and current density (ASF)), we will choose a twofactor central composite design with a trial count of 13.
After Minitab creates a design experiment, you need to perform 13 trials, collect data, and record the surface roughness of 13 cleaned parts. With Minitab, you can easily analyze DOE results, simplify the model, and check assumptions using residual plots. Using the final model and Minitab's Response Optimizer, you can find the best settings for the variables. In this example, you set the voltage to 7.74 and the ASF to 77.8, resulting in a roughness value of 39.4.
The response surface DOE generates the following transport equation for the Monte Carlo simulation.
Roughness = 957.8  189.4(Vdc)  4.81(ASF) + 12.26(Vdc2) + 0.0309(ASF2)
 Defining the input parameters
You can now set up parameter definitions for the Monte Carlo simulation inputs and bring them into Engage or Workspace.
Note that the standard deviation must be known or estimated based on existing process knowledge. This applies to all Monte Carlo inputs. Voltage is normally distributed with a mean of 7.74 Vdc and a standard deviation of 0.14 Vdc. Amps per square foot (ASF) is normally distributed with a mean of 77.8 ASF and a standard deviation of 3 ASF.
 Setting up the simulation in Engage or Workspace
This is the same as step 3. Click Insert > Monte Carlo Simulation in the ribbon, add your input, define its parameters, and then enter your model. In this example, if you have the latest version of Minitab, you can rightclick and click Send to Engage or Send to Minitab Workspace. If you don't, you can copy it manually from the Minitab output and paste it into the Model field in Engage or Workspace.
 Simulation and analysis process output
The summary shows that the distribution of RMS roughness is not normal, even though the underlying inputs are normally distributed. The summary also shows that the transport variance for all components results in a standard deviation of 0.521, which is a good process result based on your knowledge of the process. We can determine what we will see in this process based on a DOE of only 13 trials. Again, since this is based on simulated data, your answer will be slightly different, but generally speaking, the answer should be correct. We can look at parameter optimization to finetune our answer and find the best solution if necessary.
Share:
Previous: SiP and Chiplet have become the hottest packaging technology.
Related Products

PIC32MZ1025DAL169
Microchip
BGA169 > 
EQCO400T8
Microchip
Equalizer; UTP cable equalizer; 3.3VDC; > 
TCHIPUSBMX250F128B
Microchip
PREPROGRAMMED CHIPKIT USB BOOTLOADER > 
MIC228934YMLTR
Microchip
IC LED DRVR RGLTR DIM 750MA 8MLF > 
ATSAMD10D14AMUT
Microchip
CortexM0+, 16KB FLASH,4KB SRAM  24 QFN > 
ZL30155GGG2
Microchip
Universal Clock Translator 40C to 85C 1 > 
TC9400EJD
Microchip
Rectangular Connector; Body Material:Pol > 
TC7129CKW
Microchip
41/2 Digit AnalogtoDigital Converters > 
TC4422CAT
Microchip
9A HIGHSPEED MOSFET DRIVERS,MOSFET & Po > 
TC4420COA
Microchip
Low Side MOSFET Power Driver, 6A, 4.5 → > 
TC1272AZVNBTR
Microchip
3 PIN RESET MONITOR, 40C to +125C, 3SO > 
SY58051UMG
Microchip
ULTRAPRECISION CML AnyGate WITH INTERNA > 
SY10E416JC
Microchip
QUINT DIFFERENTIAL LINE RECEIVER > 
SST25VF032B804IS2AFT
Microchip
Flash 2.7V to 3.6V 32Mbit SPI Serial Fla > 
SR087SGG
Microchip
Adjustable OffLine Inductorless Switchi >
Hot Stocks
More SM843251156KA
 SCH3114NU
 PIC32MX795F512LT80I/PF
 PIC32MX575F512H80I/PT
 PIC24FJ128GA308I/PT
 PIC18LF252I/SO
 PIC18F4550I/ML
 PIC18F4420
 PIC18F2620
 PIC18F25K50I/SO
 PIC18F25K22I/SS
 PIC16LF73I/SO
 PIC16F916I/SP
 PIC16F913I/SP
 PIC16F616I/P
 PIC16F1827I/SO
 PIC16F1826I/SO
 PIC16C71104/P
 PIC16C57HS/P
 PIC12LF1822I/MF
 MRF24WB0MB/RM
 MICRF220AYQS
 MICRF219AAYQS
 MICRF102BM
 MIC5841BN
 MIC502BN
 MIC24051YJL TR
 MCP79410TI/MNY
 MCP6566TE/OT
 MCP604TI/SL
 MCP23S08E/SS
 KSZ8041NL
 KS8695PX
 HV9911NGG
 COM20022ITQFP
 ATSAM4SD32BAAU
 ATMEGA16820AU
 ATMEGA16216MU
 AT93C4610TU2.7
 AT90S85158JI
 AT45DB161BTC
 AT29C51270JI
 AT25DF161SSHB
 AT24CM01XHDB
 16F84A04/P