Simulation Software: Discrete Event and Continuous Time
Petri Nets and Differential Equations and programmable controllers all in one model with McSimAPN.
MJMcCann Consulting
Click to Home Page

McSimAPN does it all!
McSimAPN is made to work rather like an (electronic) ANALOGUE COMPUTER . Blocks are connected together to mimic the real world prototype. With a major added facility: it will simulate DISCRETE EVENT PROCESSES using the concepts of PETRI NETS to provide a simulation tool that has the discrete event modelling and the continuous systems modelling in one seamless combination.
There are limits, of course and big complex problems may need more powerful tools, but seeing how simple the model can be and still provide insight is an important first step.
McSimAPN stands for "McCann Simulator for Analogue and Petri-Nets" because it is like an analogue computer that does Petri Nets as well.

It is available free to clients as part of the service and as a free download for anyone to realise their dynamic systems simulations.
Download ZIP file version of McSimAPN with Help files and Demonstration models. Click HERE

Differential Equations for Continuous Systems.
The continuous blocks forming part of McSimAPN require integration. Over centuries, a lot of work has gone into getting near perfect numerical solutions to differential equations.
In McSimAPN, I have used the simpest possible, Euler integration method, because here the objective is a working model of a real world prototype, not ultimate precision in the solution of a set of differential equations.
Computational errors due to the crude integration can be reduced by finer resolution and, anyway,so long as the model doesn't become computationally unstable, all numerical integration schemes are conservative (in the sense of conservation of energy, momentum,mass) and the errors can be reduced below the level due to uncertainty in the model parameters.
Critically for this tool, using a discrete time stepping method allows a merger of discrete events with continous processes which needs special procedures in other methods such as Runge-Kutta.
McSimAPN does allow time-step size to change without breaking the model.

Event Chains and Petri-Nets for Discrete Event Systems.
Some of the most powerful discrete event simulation tools are based on set-theoretic concepts and use event chains to handle the calling of routines (which in many cases have to be written specially by the user) to calculate the consequences of an event and to set the conditions for the next event. The event chain is the sorted list of forthcoming events.
The events result in state changes, set membership changes and the setting of times for some subsequent events that then get listed in the event chain.
These powerful tools can deal with each item or token or object, that is moved from one set to another, carrying its own history and parameters so that each time it is operated on that data can determine what happens next.

A different formulation uses a PetriNet view of things to do the same sort of operation. Such a schema can be seen as a flow chart in which tokens move around. Transitions move the tokens from one place to another.
In the Petri-Net form used in McSimAPN, each active block has two transitions, an input transition to an internal place where a token stays for a period of time and an exit transition whence the token leaves if it has some place to go.
Each block generally represents some real world object, though it might be a computer programme or procedure.
The tokens in McSimAPN are indistinguishable one from another (they are not "coloured"). That's a big simplification, but it turns out that in many systems the place it's in really defines the relevant properties and so they don't need to be carried around.
Therefore McSimAPN is providing a Timed Monochromatic Petri Net formulation.
McSimAPN does, however, extend the idea of a token. Because the calculations are all done with floating point arithmetic, it becomes possible for the tokens to represent arbitrary sized quantities and to link the movement of tokens to the movement of materials which can be part of a continuous system model.

About Discrete Time Systems
In Discrete Event Systems, the time variable can progress in irregular jumps. Whereas Discrete Time Systems are generally assumed to move time along in regular discrete steps. A lot of linear systems theory uses this convenient formulation as it fits well with the use of powerful matrix processing software. Because McSimAPN does its integration and time stepping in discrete (usually small) time steps merging Discrete Time ideas into it is natural; it happens anyway.

Design Features of McSimAPN.
The original motivation in developing the continuous time aspects McSimAPN was to be able to test out control system ideas in an interactive mode, on a personal computer (under the Windows operating system). A previous (DOS) version was also used in simulations to provide operator training. Since many of the applications involved heat transfer, it now has some special features that make dealing with heat fluxes and the equivalent RC (resistance capacitance) circuits easy.
What's more, it incorporates Discrete Event modelling with the Petri-Net ideas. It has features:

  • interactive operation, see results as the simulation runs, make changes, see graphed results, flip switches on the fly.
  • all graphic interface, assemble, run modify.
  • simple block structure with set of components designed for flexibility, hundreds of state variables allowed.
  • stop and restart, save and come back to same point to try something different.
  • models stored as text files, editable by humans, but can be parsed into spreadsheets for parameterized modelling.
  • VBA extension option to build user defined programmable components for testing control systems etc.
  • run on any PC (Windows to 8.1 so far, 2014) without going through a set-up procedure
  • Takes up less than 1 MB.
  • Needs no installation, just unZIP it and run. Can run from thumb-drive.
  • McSimAPN in Use
    Design has concentrated on being able to compress a lot on to the screen and particularly to be interactive so that the network (equations, model) can be paused to make changes while in the middle of a run without any need to recompile or reset. In that sense, it emulates a hardware electronic analogue computer, on which it is modelled. (While it was never recommended practice, we could hot wire links in analogue computers at anytime.) As a result, it has the block structured form of an analog machine or the early digital analog simulators, rather than the statement structured form of CSMP, ACSL and sucessors.
    The modern tools like (commercial) Matlab/Simulink and (free) SciLab/Scicos or SciCosLab, have merged these block structured, diagrammatic forms with powerful numerical procedures, but lost the easy direct interaction of electronic analog computers.

    Although it is small and simple, McSimAPN is an effective simulation tool. It is not so fast at numerical integration as hard coded or purpose designed programmes but shows its advantages in ease of use since it runs in an essentially interpretive mode. The schema for the graphics (mimic diagrams) is functional rather than pretty. However, it is fun to play with and easy to learn and gets results quickly.

    As with most simulation tools, random variables for processes are available and are readily changed to fixed values. Particularly in discrete event systems, it's surprising how irregular the apparent behaviour of a plant can become, just because of the complex interactions, even with regular timings for the constituent processes.

    The discrete event(Petri-Net) components are animated by colour changes so activity, blockages, movement can be dispayed in action as the simulation progresses.

    The model can be generated entirely on screen, then saved at any point. The whole model including its current state is stored as a simple text file so it can be edited. The text file can be parsed into a spreadsheet (e.g. Excel) and/or generated from a spreadsheet so that the capabilities of a spreadsheet to put coordinated, calculated values in as timing, stock holding or other parameters can be exploited. In fact the program will read any text file, responding only to lines which have particular formatting to generate the simulation.

    Microsoft Excel spreadsheets can be (OLE) linked into the model to allow users to experiment with alternative control rules, signal processing, graphing, model optimization or any task that can be done by having simulation data linked into the spreadsheet and using its VBA programming capabilities. Model features can thus be programmed without having to recompile the simulation tool. Demonstration models are provided, though you may need to contact me to get this working, but if you have such a problem, I'd like to hear about it for mutual interest.

    You can download a copy in the form of a "ZIP" file (which includes HTML help and tutorial files) from here. This is fully functional but I can't offer support unless you contact me. After unZip, I suggest you start with the file "readmefirst.txt".

    Links in website:
    Home/Index Page

    About Dr McCann
    Dr M.J.McCann
    Training Courses
    Bristol University Contacting me
    Contact in UK
    Location USA
    Software Tools

    Click to Applications PageApplications

    Business & Commerce
    TV Advertising
    Drugs Competition
    Housing Demand
    Automobiles Demand
    Wallcoverings Battle
    Cash Flow
    Human Resources
    Project Management
    Patent Analysis

    Chemical Industry
    Cooling Tower
    Polymer Process
    Heat exchange
    Supercritical Fluid
    Distributed parameter
    Toxic gas allocation

    Control systems
    Initiation systems
    Ferrite Filters
    Microstrip Antennas

    Production & Process
    Automated manufacture
    Crimp and Press
    Glass making
    Glass molding
    Glass to metal seals
    Heat exchanger
    Helium Leak Testing
    RF Soldering
    Vacuum web coating

    Click to Applications PageApplications.

    Invitation. McCann can help if you have a design or operational problem that needs some technical support that is outside your team's experience, some quantitative assessment of what is really the cause of the difficulties, some design alternatives or just a fresh look by an intelligent interrogator.
    If you have a problem with the behaviour of a market sector, plant, process or item of equipment and would like to get a quantitative handle on it to improve yield or optimise performance, then contact me. I'm always ready to give a little time to discuss a new puzzle, in confidence, of course. We'll only worry about fees when there is some defined work. I can be flexible about how I work with you.
    Dr M.J.McCann,
    POB 902,
    Chadds Ford PA
    19317 USA.
    T: 1 302 654-2953
    M: 1 302 377-1508 (Cell)
    Request. Please let me know how you found this website and your interests by following this feedback link. Thank you Date: 2014.08.25
    File: mcsimapn.htm