Step 3 - How to Execute Scripts
Let's explore one of RINPn's advanced features on this page: script execution.
Sponsored Link
RINPn can execute scripts written in "Vnano" to perform procedural, algorithmic, or other complex calculations.

What is Vnano?
Vnano is a compact scripting engine and language designed for embedded use in applications. It features a simple C-like syntax. For more details on the syntax of Vnano, visit the "Features of the Vnano as a Language" page on the Vnano Official Website.
To create a Vnano script, you don't need any development environments such as compilers. Simply create a text file with the ".vnano" extension and write your code within.
Example Script
An example script, "Example.vnano," is included in the RINPn folder. This script calculates the numerical integration of cos(x) from 0 to 1:
// Integration parameters
double A = 0.0;
double B = 1.0;
int N = 100000;
// Integrant function
double f(double x) {
return cos(x);
}
// Perform integration
double delta = (B - A) / N;
double value = 0.0;
for(int i=0; i<N; ++i) {
double x = A + i * delta;
value += ( f(x) + f(x+delta) + 4.0 * f(x+delta/2.0) ) * delta / 6.0;
}
output(value);
For a detailed explanation of the code above, visit: https://www.vcssl.org/en-us/code/archive/0001/7800-vnano-integral-output/.
How to Execute a Script in GUI mode
To execute a script in GUI mode, there are two methods:
- Method 1: Click the "Script" button on the window and select the script file you wish to execute.
- Method 2: Enter the name or path of the script file into the "INPUT" text field, then press the Enter key or click the "=" button to execute it.
Choose the method that you prefer.

For example, to execute the "Example.vnano" script mentioned earlier:
Example.vnano
OUTPUT:
0.8414709848
As shown above, the output value from the script will be displayed in the "OUTPUT" text field. The output "0.8414709848" closely matches the theoretical value of sin(1), which is the integration result of cos(x) from 0 to 1, confirming that the script has executed correctly.
Additionally, if you are using Microsoft Windows, you can hold down the Shift key and right-click the script file to copy its path from the context menu. This is especially handy when you need to enter the path of the script file into the INPUT text field of RINPn.
How to Execute a Script in CUI mode
Similar to GUI mode, you can execute a script in CUI mode by entering 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:
rinpn Example.vnano
(Result) 0.8414709848
If the script file is in a different directory than the current one, you can specify the relative file path instead of just the file name:
rinpn ./example/Example.vnano # Execute a script in the "example" directory
Additionally, if necessary, you can specify the absolute file path as follows:
rinpn "/home/.../Example.vnano" # For Linux, etc.
About Optimization Levels
When processing a script is particularly demanding, you might find it beneficial to increase the optimization level specified in "Settings.txt" under "acceleratorOptimizationLevel" to enhance processing speed.
While the processing speed at an optimization level of 0 is generally sufficient for standard calculator software use, and hence the default level is set to 0, you might need a higher setting if you frequently execute complex numerical calculations on RINPn.
Get New Scripts from the Code Archive
While you can create scripts from scratch, the code archive on the official VCSSL/Vnano website can also be a valuable resource:
- Code Archive » Vnano
- https://www.vcssl.org/en-us/code/#vnano
This archive offers a variety of useful scripts, complete with commentary articles that explain the algorithms, background knowledge, and more.
Solve The Lorenz Equations Numerically |
|
![]() |
This script solves the Lorenz equations and outputs data to plot the solution curve, famously known as the "Lorenz Attractor," on a 3D graph. |
Output Data of Numerical Integration For Plotting Graph |
|
![]() |
An example script that computes integrated values numerically and outputs data for graph plotting. |
Compute Integral Value Numerically |
|
![]() |
This script calculates integral values using the rectangular method, trapezoidal method, and Simpson's rule, suitable for numerical integration. |
- Introduction - Overview of RINPn and How to Get Started
- Step 1 - Using RINPn in GUI Mode
- Step 2 - Using RINPn in CUI Mode (Command-Line Terminal)
- Step 3 - How to Execute Scripts
- Step 4 - How to Add Functions/Variables by Scripts (Library Scripts)
- Step 5 - Implement Functions/Variables in Java™ (Plug-in Development)
- Step 6 - How to Embed into Other Software
- Appendix - List of Built-in Functions/Variables