In this page, Let's use one of special features of RINPn: script execution.
The RINPn can execute a script file written in the "Vnano", to perform procedural, algorithmic, or other complicated calculations.
The vnano is a compact script engine & language for embedded use in applications. The vnano has simple C-like syntax. For details of syntax of the Vnano, see: "Features of the Vnano as a Language" in the Vnano Official Website. To create a script of the Vnano, no development environments (e.g.: compiler) is required. Simply create a text file of which name ends with the extention ".vnano", and write code in there.
There is an example script file "Example.vnano" in the folder of the RINPn. This example script calculates the numerical integration value of cos(x) from 0 to 1:
For detailed explanations about the above code, see: https://www.vcssl.org/en-us/code/archive/0001/7800-vnano-integral-output/
To execute this script in the GUI mode, there are two methods:
Choose the favorite method from the above.
For example, execute the example script in the previous section "Example.vnano":
As the above, the output value of the script will be displayed on the "OUTPUT" text-field. The output value "0.8414709848" is matched well with the value of sin(1) which is the theoretical integration value of cos(x) from 0 to 1, so it indicates that the above example script has run correctly.
By the way, if you want to execute a script file in the different folder with the folder at which you has launched the RINPn, it is necessary to input the absolute file path ("C:\...\Example.vnano", "/home/.../Example.vnano", etc.) of the script to execute it. (If you are using Microsoft® Windows®, right-click the script file with pressing Shift key, and then you can copy the file path from the right-click menu.)
As same as the GUI mode, you can execute a script on CUI mode, by inputting the name or the path of the script file.
For executing a script file in the current directory, pass only name of the script file to the "rinpn" command:
When a script file is in a different directory with the current directory, you can specify the relative file path of it, instead of the file name:
Also, if necessary, you can specify the absolute file path as follows,
By the way, when processing of a script is heavy, it might be helpful to raise the optimization level specified in "Settings.txt" as "acceleratorOptimizationLevel", to make the processing faster.
Even when the value of the optimization level is 0, probably the processing speed is enough to use the RINPn in the standard way of a calculator software, so the default value of the optimization level is set to 0. However, if you execute numerical calculation programs frequently on the RINPn, the processing speed might not be sufficient with the default optimization level.
You can write new scripts from scratch, but sometimes the code archive in the official website of the VCSSL/Vnano may be helpful:
Useful scripts are being distributed on the code archive, with commentary articles explaining algorithms, background knowledge, and so on.
Solve The Lorenz Equations Numerically |
|
![]() |
Solve the Lorenz equations, and output data to plot the solution curve (well-known as the "Lorenz Attractor") on a 3D graph. |
Output Data of Numerical Integration For Plotting Graph |
|
![]() |
Example code computing integrated values numerically, and output data for plotting the integrated functions into graphs. |
Compute Integral Value Numerically |
|
![]() |
Example code computing integral values numerically by using rectangular method, trapezoidal method, and Simpson's rule. |