Friday, May 17, 2024

JaamSim: Simulation Tool Simplifying Complex Systems

- Advertisement -

The rate at which technology is progressing today, one has to be creative, futuristic and code efficiently on the go. What if you could use your Java scripting skills to simplify the behaviour of complex systems? How about bringing it all down to models and simulations of sequences of well-defined events? This is what JaamSim lets you do!

JaamSim, short for Java Animation Modelling and Simulation, is a discrete event-simulation software package that can run on Windows, Linux or OS X systems, and is supported by Apache2.0 free open source software license.

What to expect from discrete system-simulation software

The idea behind simulating a system is clear-cut—to replicate its functionality, imbibing all your ideas into it. The system is a bunch of components put together, each depicting a certain functionality at a certain time or under given conditions. The component could be a simulation entity, an entity generator or a source as it is colloquially called, a channel or entity conveyor, or an entity sink where the entire data converges.

- Advertisement -
Modelling a server in JaamSim
Fig. 1: Modelling a server

The stimulus flows from one section, through the entire model, and finally appears at the sink, creating the process flow. This is, of course, the basic requirement for the simplest of systems. As complexity adds on, you might need a queue, a branch, additional resources or even an entity container to hold multiple entities. box 155

Smooth processing. In JaamSim, a sub-class of thread allows for entities to move through its methods, otherwise called a process. To create a process flow, you can move around, resize and place the components, connecting stages one after another, and also set the time at which each entity will be added to the model and the time each would spend at every stage of the same.

As each model is created, Simulation Object stores inputs that define basic parameters such as run duration. While operating the system is as simple as selecting start/pause/stop/reset buttons from the control panel, the speed of simulation is decided by the real-time speed-up factor, as specified by you in the controls. By default, simulation time is equal to one real-time second. Multiple simulations can also be run one after another, each of which can be accessed by their run number and run index.

JaamSim Software package overview
Fig. 2: Experience your dream car

Event-driven design. Not just processes, JaamSim is built to handle event-driven models and a mix of both as well. A method can be processed in parallel or in series, allowing for the much-needed flexibility in system functionality. As a consequence, a new method runs serially and a new process runs in parallel, which means that when a method is halted, the process need not be started all over again.

The entire functioning is managed by Event Manager Object, which maintains separate lists for future events and conditional events, and handles these separately, too. The latest added events are handled first, but conditioned events are processed in the order in which these were entered.

Here, there, everywhere. The one feature you cannot leave out in a real-time system is the factor of dynamic variability. While these cannot be exactly accounted for in simulation, one can certainly consider randomness and statistical phenomena. Here, Probability Distribution feature comes to the aid of the designer.

The designer specifies the range and time span for such inputs, and these are randomly introduced into the system, paving the way for a nearly-accurate real-time model. JavaSim provides a huge list of distributions to select from, like uniform, triangular, exponential and log-logistic distributions. It also provides user-defined probability distributions, both continuous and discrete. All of these distributions can also be played around with, like the case of changing the random seed value.

De-cluttering the design maze

JaamSim provides Model Builder and Object Selector to help manoeuvre through the entire system design. While these let you view and select components of the system, each parameter can be customised via Input Editor. Control Panel provides required run control features for simulation. Outputs are mostly pre-programmed depending on the design, but the user can also create outputs for the model using attributes, and even custom outputs for individual blocks. Model outputs can be seen on Output Viewer, while Graphical Window displays a graphical representation of the same.

Look before you leap. Input data has specified formats, and the system can also involve algebraic expressions or Boolean logic. A given input is validated to make sure it satisfies the needed constraints before being applied to the system. Areas that require a red-green-blue (RGB) colour scheme can use standard colour keywords instead of explicit RGB values. This would be as simple as using pink instead of 255 192 203.

Handling numbers. Numerical details are given in International System of Units (SI units), unless otherwise specified, and a mouse hovering over the output name displays a tool-tip pop-up with a brief description of the selection.

The system being simulated can also have its parameters calculated using various options provided; a controller that signals component updates in the specified sequence, integrators or differentiators, wave generators, delay generators, polynomial calculators, etc.

User interface, the deciding factor

Aesthetics takes an all-new meaning today, and this software keeps up with the trend by letting you change the graphical appearance of the designed model. This feature also comes in handy when moving to designs of higher complexity, as then the placement or appearance might even affect functionality. For example, if a magnet is placed next to a transformer, there is a chance of signal interference.

Travelling with system parameters
Fig. 3: Travelling with system parameters

As you use the software, you can choose between a 2D or 3D view, the former giving a bird’s-eye view directly above xy simulation plane and the latter adding a sense of depth in all directions. These views only define the camera position, always giving you full-3D perspective graphics and letting you zoom, pan and orbit over the workspace. Well, there is nothing stopping you from doing a 3D animation.

The extras. A feature called Overlay Object can be used in the graphical display as position references, since these are positioned at the corner of a view window and do not move when the view is panned or zoomed. The software also generates graphs of selected parameters to help study behaviour in detail. You can even save a video of a model in operation, which can later be viewed on VLC player. As the generated video format is not compatible with all software, and is slightly on the higher side when it comes to storage space, developers recommend using software such as HandBrake for professional purposes.
Simulating a hydraulic generator, maybe

If the problem at hand involves dealing with fluids, a fluid objects palette in JaamSim provides exclusive objects for building dynamic models. The objects allow for details right from defining properties of the fluids under use, to fluid flow between source and destination, vessels for storage, pipes for transportation and also centrifugal pumps.

Taking a cue from experience

An extremely-fast simulation software that Jaamsim is, it lets one scale it to the largest of applications. Once you are familiar with the language and the tools, you can create additional palettes of high-level objects for advanced requirements. The developers have built the software with over 35 years of simulation practice, with every lesson learnt inculcated into the tool in some form.box 255

Built on this strong background, alongside a neat website (www.jaamsim.com), developers have gone on to start a company, JaamSim Software Inc., to develop, promote and offer support. Enough said! Looks like JaamSim is already inviting you to jump in and try your hand at simulation, if you have not already.

Download the latest version of the software: click here


Priya Ravindran is a freelance writer with EFY

SHARE YOUR THOUGHTS & COMMENTS

Unique DIY Projects

Electronics News

Truly Innovative Tech

MOst Popular Videos

Electronics Components

Calculators

×