First FlexSim Model
Welcome to FlexSim, the world’s best 3D simulation modeling and analysis software. FlexSim lets you take the things you know about a system, plus the things you can assume about the system, and translate those into a digital model where you can learn, experiment, and optimize the whole system.
Today, you’re going to build your very first FlexSim model! If you haven’t already, sign up for a free FlexSim Account to download and install the latest version of the FlexSim software. Before we begin, if you have a license but haven’t activated it yet, please do so now. There’s a link on how to do this in the description. If not, no problem—you’ll still be able to build this model using the free Express feature set.
From the Start Page, create a New Model and you’ll see a pop-up where you can set the model units—let’s use the defaults. The middle pane is the Model View, where you will lay out the digital model of your system to-scale and entirely in three dimensions. To the left is the 3D Object Library, which has many reusable, pre-configured components that you can use for fast and simple model building. Using your mouse, left-click and hold while dragging out a Source object, and then release left-click to drop it into the Model View. You just added a Fixed Resource object—these objects send and receive flow items, the physical components that flow through the system. This specific object, the Source, creates flow items.
Now that you have an object in view, we have a point of reference to look around the Model View. If you hold left-click on any empty space in the Model View and move your mouse, you can pan the view. Hold right-click to rotate the view and use the mouse’s scroll wheel to zoom in and out. If you’re lost and want to re-center the view, just right-click on an empty space, hover over “View,” and select “Reset View.”
There’s another way to add objects to the model. Double-click with the left mouse button on any empty space in the Model View to bring up a Quick Library, and choose the Queue object, which is right next to the Source. Flow items will spend most of their time doing one of three things—being transported, being processed, or queueing for their next event. This Queue is another Fixed Resource, and flow items from the Source will queue up here before being sent downstream.
Let’s add two more objects from the Library—a Processor, and a Sink. These are enough objects for a basic model, but they won’t do anything until we create relationships between them. We do this with Object Port Connections, which define possible flow item routes to and from Fixed Resources. The most common connection involves inputs and outputs. To make this connection, hold the “A” key to enter “Connect Objects” mode—then click the Source and then the Queue to connect them. In “Connect Objects” mode, you can keep clicking to connect one object to the next in the direction that items will flow, or you can quickly release the “A” key and then press and hold it again to reset things and connect two new objects together.
You can now see a visual indicator of the connection, with an outward-pointing red arrow showing the Output port on the Source, an inward-pointing red arrow showing the Input port on the Queue, and a black line between them. There’s another way to connect objects—left-click the Queue and notice the white arrow just outside of the manipulation handles. Left-click and drag from that arrow to the Processor to connect them. Choose your preferred connection method and finish up by connecting the Processor to the Sink.
One final thing before we run this simulation. For this example, we’re building a model of a product testing system, and we need to have the right inputs to represent the system’s behavior. Based on quick real-world observations, most products arrive for testing within 10 seconds of each other. There are also some outliers with 60 seconds or more between arrivals, bringing the average up to 15. The Exponential probability distribution is FlexSim’s default for these inter-arrival times, so we just need to edit the default value in the Source. If you left-click on the Source object, its Properties will show up in the right pane, where you will find properties for most of FlexSim’s tools and objects. In the “Source” area and under the “Inter-Arrival Time” field, you’ll see an expression for the default Exponential distribution. Click the “Edit Parameters” button to bring up the distribution parameters, and change the “Scale” to 15, then click away from the pop-up to save your edits.
We also have some observations for our Processor, which represents our testing station. Left-click on the Processor to bring up its Properties, and then find the “Process Time” field in the “Processor” area. The default value is a static number, so click the black arrow to the right of the field, hover over “Statistical Distribution,” and choose “Triangular.” This distribution wants three parameters—the minimum time testing will take, which is 8 seconds; the maximum time it will take, which is 30 seconds; and the testing time we observed most often, or mode, which is 15 seconds. While you’re here, let’s rename this Processor to “TestingStation” using the naming field at the top of the Properties pane.
This model is ready to run. Just above the Library and Model View you’ll find the Simulation Control Bar. It’s good practice to always press the “Reset” button to get everything to its starting state, and then press the “Run” button to run the simulation. It might take a few seconds for the Source to add our first flow item to the system. Press the “Skip” button to skip to the next simulation event, where our box passes right through the Queue and into the Processor, and then leaves the model through the Sink after processing. You’ll notice a few things in our model. We’re using statistical distributions, or stochastics, instead of fixed numbers for things like arrival rate in the Source or processing time in the Processor. Using random numbers adds—you guessed it—RANDOMNESS to the model, since just like in the real world there is often variability in how long things take. Simulation lets you capture this complexity in a way spreadsheets can’t. If you use the Run Speed slider to increase the simulation run speed, you’ll see the flow item queue grow and shrink over time, all thanks to variability.
The second thing you’ll notice is that the flow items teleport from object to object. Press the “Stop” button in the Simulation Control Bar and let’s introduce the Task Executer.
Task Executers are mobile resources that perform tasks, like transporting flow items between objects. Add an Operator to your model. The Operator will need to be connected to our system, but we’re going to use another connection type to do it. When you left-click the Operator, you’ll see a white square just under its manipulation handles. Click and drag between this square and the Queue to make a Center Port connection, a reference connection we’ll use to transport flow items between the Queue and the TestingStation. You can also use the “S” hotkey to enter “Center Port Connections” mode. Unlike the regular Object connections we did earlier—where the connection order matters for defining item flow—Center Port connections are for reference only and connection order doesn’t matter.
Now we need to make use of this reference connection. Click the Queue and find the “Output” area in its Properties. Click to check the box for “Use Transport” and a few new options will appear. By default, “Use Transport” will look to use the first object connected via a center port—in this case, the first and only Center Port connection is our Operator.
Reset and Run the model again to verify that the Operator is now loading flow items at the Queue, transporting them to the TestingStation, and then unloading them to begin processing.
There you go—a simple digital model of a small product testing system! Now it’s time to gather some data from it. Let’s add some charts and graphs to see what’s happening here. In the toolbar, click “Dashboards” and “Add Blank Dashboard” to open a new dashboard in a split pane between the Model View and Properties. The context-sensitive Library has now updated to show all our pre-built charts. First, let’s drag a State chart into the dashboard. It’s blank right now, so let’s click on it to bring up its Properties and find the “Objects” area where we can add objects to be displayed in this chart. The easiest way is using the Sampler, which is the eyedropper icon—click once to enter Sample mode and click again on the TestingStation to add it to the chart. This will show us how the TestingStation is utilized during the simulation run.
Drag out another State chart and this time Sample the Operator so we can see how they are utilized. Finally, drag out an Average Content chart and Sample the Queue so we can see the average size, or content, of the Queue. Reset and Run the model and speed things up so we can see some data. The TestingStation is well-utilized, but the average content in the Queue just keeps going up and up. How could we keep the Queue from backing up so much? Would it help if we added some more testing stations to the model?
First, let’s make the number of testing stations an editable parameter in our model so we can quickly adjust the number. Click the “Toolbox” tab in the left pane and double-click “Parameters” to open the default Model Parameter Table. The table will open as a new tab in the Model View pane, so let’s move it to a more convenient location. Click and drag the tab of the Parameters table around the FlexSim window to see the window docking options you have. Let’s dock it to the lower half of the Model View pane. There is already a default parameter, so let’s change its name to TestingStations. Now click the Value cell and then the black arrow button to show its parameters. We want to test how our model performs with a different number of testing stations (up to 5). Change the Type to “Integer” and make a Lower Bound of “1” and an Upper Bound of “5.” Now we need to make a reference for this value. Click the Sampler, click the Queue in the Model View, and then choose “Delete and Copy Out Objects.” Since the TestingStation is the only output object of the Queue, this will now add and remove these objects as we change this parameter value. By default, objects will be copied and placed with a slight offset in the X-axis so they are easier to distinguish. However, travel distance isn’t a factor in our study, so let’s remove that assumption by removing the offset. Click the “Edit Parameters” button and change the “X Offset” to 0.
Let’s give it a try. Change the Value to “5” and click the Reset button. All five of the testing stations were added to the same location, and you can tell by the additional connections showing up. Again, this is great for our model because operator travel distance isn’t a factor, but if it were, we’d add an offset to spread these objects out.
Now click Reset and Run the simulation again. The additional stations give us the capacity to process up to five flow items at the same time, and you can see in the dashboard that our Queue is hardly backed up at all. You’ll also notice that the additional testing stations have been automatically added to the State chart, and some of these stations are utilized quite a bit more than others. One station was too few, but five looks like too many. What’s the right amount? Let’s do an experiment!
If you’re using FlexSim under the free Express feature set, you won’t have access to the tools we’re about to use to analyze this model. If you’d like to try these features for yourself, contact your local FlexSim representative, tell us about the work you’re doing, and let’s talk about an evaluation license!
First, a little prep work. Double-click “PerformanceMeasures” in the Toolbox and move this table inside the same pane as Parameters. Use the up arrow to add a few more performance measures, for a total of three. What are the key performance indicators for our project? The first one is testing station utilization, so change the name in the first row to reflect this. For its value, sample the testing station State chart, hover over “Utilization,” and choose “Utilization Average.” This will return an average utilization across all active testing stations. The second measure will be operator utilization, so rename the second row and Sample “Utilization Average” from the Operator’s State chart. Finally, we want to keep a close eye on the queue’s average content—rename the third row, Sample the Average Content chart, hover over “AverageWIP” (or Work in Progress), and choose “AverageWIP Average.” If you Reset and Run the simulation now, you’ll see these performance measures update as the model runs. And now we’re ready to test some scenarios.
In the menu bar at the very top of the FlexSim window, click “Statistics” and then “Experimenter” to bring up the Experimenter window. This is FlexSim’s scenario manager, where you can set up “Jobs” to run and evaluate. Parameters are the drivers for different scenarios, and ours is already set up. Expand the Parameters option and check the “TestingStations” box, and this parameter will be added to the list of scenarios on the right. Use the up arrow to add four more scenarios, and change their values to “1,” “2,” “3,” “4,” and “5.” You probably guessed that each scenario would evaluate a different number of testing stations in our model.
Next, we’ll set up how our simulation replications will run for this experiment. Let’s update the number of Replications per Scenario to “25” so we can get a large enough sample size for more valid results. And each replication will use different random numbers, so the results for each one will be a little different. For the Stop Time, we want each replication to run for 8 hours. The easiest way to do this is to change the time from 8am to 4pm, eight hours in the future, and FlexSim will automatically update the correct stop time of 28,800 time units.
We’re ready to go. Click on the “Run” tab, and then click the “Run” button so FlexSim can get to work. Each bar segment represents a replication, where an entire eight-hour period is simulated. FlexSim’s Experimenter is multi-threaded, so it will run a replication on each CPU core simultaneously. When a replication is finished, that segment will turn green, and the experiment is finished when everything shows up green. Click View Results and let’s see what happened!
The first thing you’ll see is a chart of all the replications we did for each scenario, each with box and whisker plots. This is Testing Station Utilization, and you’ll notice that Scenario 1—with just a single testing station—had the highest average utilization at just over 80%. There are significant decreases in utilization in both Scenarios 2 and 3 before tapering off in Scenarios 4 and 5. Click the drop down for “Testing Station Utilization” to choose a different performance measure, “Operator Utilization.” Here, we see an immediate improvement in utilization with Scenario 2, and no further improvement with the other scenarios. Finally, the “Average Queue Content” measure also shows Scenario 2 with a clear improvement to a near-zero average queue size. Based on the data, Scenario 2 looks like a clear winner, and if you want to dive deeper into the results, you can click “Replications Plot” and choose something like “Scenario Comparison” to check for statistical significance, or generate a report to evaluate the data in a different program.
Congratulations on building and analyzing your first FlexSim model! If you’d like to continue your simulation journey, we have many free resources available to you—including video tutorials, Q&A entries, documentation, and much more. Check out the links in the description to keep exploring. And we hope you’ll get in touch with us soon—we’d love to hear about your next project!