Determinism
Simulations created in ProtoTwin are deterministic. This means that you get the same result each time you run the simulation with the same initial conditions. The position and rotation of an entity at any timestep will equal to the same value regardless of how many times you run the simulation.
The simulation of the Galton Board in the video above demonstrates determinism. The same colored balls accumulate into the same bottom bins after resetting the model and running it again.
Importance of Determinism
Determinism in the context of physics-based simulations is important because it enables reproducibility. Non-deterministic simulation makes the development and testing of control logic more difficult, frustrating and erodes trust in the reliability of the results obtained. Determinism is guaranteed across different browsers and operating systems. You can share your simulation model with a colleague and be confident that they will see the same results as you.
PLC Non-Determinism
Simulations created using ProtoTwin Connect when controlled by a PLC are non-determistic. This is because the PLC has its own clock, which is entirely separate from ProtoTwin’s clock. The integrated SoftPLC in ProtoTwin is completely deterministic however since the code is executed using the same clock cycle.
Hardware Determinism
ProtoTwin uses SIMD (Single Instruction, Multiple Data) instructions internally for improved performance. These instructions allow your processor to perform the same instruction on multiple data simultaneously. SIMD instructions provide a significant improvement in single-core and multi-core CPU performance. However, not all SIMD instructions are available on every processor.
SIMD instructions are emulated when they are not available on a particular processor. The emulated instructions might produce a slightly different result, which can result in different behavior across different processors. Fortunately, ProtoTwin is deterministic across most hardware, because almost all modern consumer Intel and AMD processors support all the SIMD instructions that are used. We’ve tested ProtoTwin for determinism on CPUs that are over a decade apart in age.