NSM

From VLECK
Jump to: navigation, search

This page is just a stub. Please take the time to turn it into something useful whenever you can.



Key features of NSM

NSM is a powerful environment for writing mathematical simulations programs. The underlying philosophy is based on systems theory (literature). The power of the program lies in highly structured

Getting NSM

The latest 32 bit Windows version of NSM is available for download here.

The latest 64 bit Windows batch version of NSM is available for download here. IMPORTANT: the 64 bit windows Batch version has not all the functions of the 32 bit version implemented.

The latest utility functions for NSM is available for download here. If proper installed, the list of functions can be found within NSM by running the command 'getutils()' in the command line of NSM.

Installation of the 32 bit NSM

Extract the downloaded NSM.zip file into a suitable directory e.g. 'C:\Program Files (x86)\'

Create a shortcut of the NSM.exe by rightclicking and choosing 'create shortcut' or 'pin to ...'

Extract the utility functions into another suitable directory e.g. 'D:\Userdata\'

To be able to use the utility functions within NSM you need to assign the installation directory of the utility functions to a global value within NSM. Doubleclick the NSM shortcut and type into the command line of NSM

> setglobalvalues("UtilsPath"; "D:\UserData\NSMUtils\")

and press ENTER (or use your own nsm utility function directory instead)

Set utilspath.jpg

Next type in commandline

> storeglobalvalues()

and press ENTER

Storeglobalvalues.jpg

32 bit NSM is now ready for use (NSM.exe as well as NSMBatch.exe)

Installation of the 64 bit NSM batch version

Extract the downloaded NSM64.zip file into a suitable directory e.g. 'C:\Program Files\'

To be able to use the utility functions within NSM batch you need to assign the installation directory of the utility functions to a global value within NSMBatch. Edit the NSMBatch.ini file: the UtilsPath should direct to the NSMUtils directory.

Simulation

difference vs differential equations

Fixed vs variable step size

Discrete events

Object oriented vs normalized tables

highly structured

nsm Programming language

see:

Mathematical workspace

Multidimensional

Implicit data types

command parameters

/c  ???
/p The GUI is not started
/r <deffilename> The GUI is not started, but the def-file is run.

running NSM without user-interface

To Run NSM without user-inteface, use NSMbatch.exe rather than nsm.exe.

NSMBatch.exe
Executes NSM programs in batch mode

NSMBatch [File=nsm_filename] [Method=(RUN,compile)] [ErrorFile=filename] [OutputFile=filename] [commands]

        Hello world example:
        NSMBATCH "Write(\"Hello World\")"

        Write random numbers:
        NSMBATCH Write(Random(10,2))

When the ErrorFile or OutputFile is not specified, the messages are send to stderr and stdout (usually both to the console)

NOTE that quotes within the script must be escaped with a backslash.

The commands must be specified with the NSM syntax as seperate strings e.g. "#define TEST" ID=330

In this case the name TEST is defined and the variable ID is specified with value 330.

The commands are compiled before the compilation of the .def file in order to use the #DEFINE statement.

The commands are executed afer compilation of the .def file but before the execution of the statements therein.

See Also