Wikier

Software overview

NAG Software

Norsk versjon: NAG Programvare


Software information

NAG Software is a collection of libraries and subroutines developed to address numerical and statistical problems. The software is developed by the Numerical Algorithms Group (NAG), a British non-profit organization established in 1970, which—through collaboration with academia and industry—provides robust and efficient tools for scientific computing.

The NAG libraries are widely used in academia, research, and industry to solve complex mathematical problems such as:

  • Linear algebra
  • Numerical integration
  • Differential equations
  • Optimization
  • Statistical computations

NAG software can be integrated into various development environments, including Fortran, C, Python, MATLAB, and more.

License Model at NTNU

NTNU holds an academic site license for the NAG libraries, which is available to students and staff at faculties that make use of the software, including the Department of Mathematical Sciences and the Faculty of Information Technology and Electrical Engineering (IE). The license covers use on Windows, Linux, and macOS, including Apple Silicon and Arm Linux platforms.

The use of the software is restricted to academic purposes, i.e., teaching and research. It may not be used for revenue-generating contract research or commercial activities.
NTNU users must employ a valid license key to access the NAG libraries on personal devices or when using the software outside NTNU’s computer rooms.

NAG license codes:

! NAG key begin
NPL6A60NA ANNUAL CR11929:14299810 2026/11/30 "z0ogTd+Uiwqg7McsndCKfs2mv+"
! NAG key end

! NAG key begin
NPL6A61NA ANNUAL CR11929:14299810 2026/11/30 "iwm7yfcli4yh9Ikmaoj9a+AhWT"
! NAG key end

! NAG key begin
NPL6A62NA ANNUAL CR11929:14299810 2026/11/30 "A6l+To1TaqEaTsjweixxl5WgfS"
! NAG key end

! NAG key begin
NPL6A70NA ANNUAL CR11929:14299810 2026/11/30 "VZcf6gE1eHFjHfc9DdGfbR9niW"
! NAG key end

! NAG key begin
NPL6A71NA ANNUAL CR11929:14299810 2026/11/30 "gjaXmgMwlnKgi9iu0d=wm5Mo98"
! NAG key end

! NAG key begin
NPL6A72NA ANNUAL CR11929:14299810 2026/11/30 "ernQhaMTmolnNEmJDibioPheB4"
! NAG key end

! NAG key begin
NPLA871NA ANNUAL CR11929:14299810 2026/11/30 "8+o=GmN8jRImkmokvoi+gycgIz"
! NAG key end

! NAG key begin
NPLA872NA ANNUAL CR11929:14299810 2026/11/30 "SDgYkhJ2kBUi8Tiw3dCgfePdmE"
! NAG key end

! NAG key begin
NPLUX60NA ANNUAL CR11929:14299810 2026/11/30 "TWbJMhqzcPUbpbb35bsWad1itu"
! NAG key end

! NAG key begin
NPLUX61NA ANNUAL CR11929:14299810 2026/11/30 "0sfbukI5cZLkgsb=iofTf1sj=n"
! NAG key end

! NAG key begin
NPLUX62NA ANNUAL CR11929:14299810 2026/11/30 "T4jxGb3dcqsh5qeuHpvHjtDmYa"
! NAG key end

! NAG key begin
NPMA871NA ANNUAL CR11929:14299810 2026/11/30 "mniyNieKgTXiWqkIVdZreMZmJi"
! NAG key end

! NAG key begin
NPMA872NA ANNUAL CR11929:14299810 2026/11/30 "qNm+dhr4mpPfadg9Ln2woy6okz"
! NAG key end

! NAG key begin
NPMI660NA ANNUAL CR11929:14299810 2026/11/30 "85l82pUxlTjp=GosvhjjncrpxF"
! NAG key end

! NAG key begin
NPMI661NA ANNUAL CR11929:14299810 2026/11/30 "Oqp9daVEcZfdzhaO1dd9fqteAd"
! NAG key end

! NAG key begin
NPMI662NA ANNUAL CR11929:14299810 2026/11/30 "TDgwIoRTmj9o+pjStoqfgp+ic0"
! NAG key end

! NAG key begin
NPMI670NA ANNUAL CR11929:14299810 2026/11/30 "JskaWnMLb7Qclaj6ghMUkJta2i"
! NAG key end

! NAG key begin
NPMI671NA ANNUAL CR11929:14299810 2026/11/30 "g4i0ScFpm7sm=bkpjeP6m6zbf3"
! NAG key end

! NAG key begin
NPMI672NA ANNUAL CR11929:14299810 2026/11/30 "=QaPMhtyaIvg7xcE4fgzlAXgt0"
! NAG key end

! NAG key begin
NPW3260NA ANNUAL CR11929:14299810 2026/11/30 "jSkkhiXEbL0n=1c54j6DebreBa"
! NAG key end

! NAG key begin
NPW3261NA ANNUAL CR11929:14299810 2026/11/30 "hPptOh5KnJqfvRoy9dYljevmuf"
! NAG key end

! NAG key begin
NPW3262NA ANNUAL CR11929:14299810 2026/11/30 "wCbd3oOmkKrgqogWhjoQj9InhA"
! NAG key end

! NAG key begin
NPW3270NA ANNUAL CR11929:14299810 2026/11/30 "b6jE3pS9oymeelm8JkVXo1YjxR"
! NAG key end

! NAG key begin
NPW3271NA ANNUAL CR11929:14299810 2026/11/30 "kqbiDloPpR9aUFbuUl5joHebrT"
! NAG key end

! NAG key begin
NPW3272NA ANNUAL CR11929:14299810 2026/11/30 "mljqsopunwLgt6cc+gQda53a+F"
! NAG key end
---------

! NAG key begin
NPL6A60NA ANNUAL CR11929:14299810 2026/11/30 "z0ogTd+Uiwqg7McsndCKfs2mv+"
! NAG key end

! NAG key begin
NPL6A61NA ANNUAL CR11929:14299810 2026/11/30 "iwm7yfcli4yh9Ikmaoj9a+AhWT"
! NAG key end

! NAG key begin
NPL6A62NA ANNUAL CR11929:14299810 2026/11/30 "A6l+To1TaqEaTsjweixxl5WgfS"
! NAG key end

! NAG key begin
NPL6A70NA ANNUAL CR11929:14299810 2026/11/30 "VZcf6gE1eHFjHfc9DdGfbR9niW"
! NAG key end

! NAG key begin
NPL6A71NA ANNUAL CR11929:14299810 2026/11/30 "gjaXmgMwlnKgi9iu0d=wm5Mo98"
! NAG key end

! NAG key begin
NPL6A72NA ANNUAL CR11929:14299810 2026/11/30 "ernQhaMTmolnNEmJDibioPheB4"
! NAG key end

! NAG key begin
NPLA871NA ANNUAL CR11929:14299810 2026/11/30 "8+o=GmN8jRImkmokvoi+gycgIz"
! NAG key end

! NAG key begin
NPLA872NA ANNUAL CR11929:14299810 2026/11/30 "SDgYkhJ2kBUi8Tiw3dCgfePdmE"
! NAG key end

! NAG key begin
NPLUX60NA ANNUAL CR11929:14299810 2026/11/30 "TWbJMhqzcPUbpbb35bsWad1itu"
! NAG key end

! NAG key begin
NPLUX61NA ANNUAL CR11929:14299810 2026/11/30 "0sfbukI5cZLkgsb=iofTf1sj=n"
! NAG key end

! NAG key begin
NPLUX62NA ANNUAL CR11929:14299810 2026/11/30 "T4jxGb3dcqsh5qeuHpvHjtDmYa"
! NAG key end

! NAG key begin
NPMA871NA ANNUAL CR11929:14299810 2026/11/30 "mniyNieKgTXiWqkIVdZreMZmJi"
! NAG key end

! NAG key begin
NPMA872NA ANNUAL CR11929:14299810 2026/11/30 "qNm+dhr4mpPfadg9Ln2woy6okz"
! NAG key end

! NAG key begin
NPMI660NA ANNUAL CR11929:14299810 2026/11/30 "85l82pUxlTjp=GosvhjjncrpxF"
! NAG key end

! NAG key begin
NPMI661NA ANNUAL CR11929:14299810 2026/11/30 "Oqp9daVEcZfdzhaO1dd9fqteAd"
! NAG key end

! NAG key begin
NPMI662NA ANNUAL CR11929:14299810 2026/11/30 "TDgwIoRTmj9o+pjStoqfgp+ic0"
! NAG key end

! NAG key begin
NPMI670NA ANNUAL CR11929:14299810 2026/11/30 "JskaWnMLb7Qclaj6ghMUkJta2i"
! NAG key end

! NAG key begin
NPMI671NA ANNUAL CR11929:14299810 2026/11/30 "g4i0ScFpm7sm=bkpjeP6m6zbf3"
! NAG key end

! NAG key begin
NPMI672NA ANNUAL CR11929:14299810 2026/11/30 "=QaPMhtyaIvg7xcE4fgzlAXgt0"
! NAG key end

! NAG key begin
NPW3260NA ANNUAL CR11929:14299810 2026/11/30 "jSkkhiXEbL0n=1c54j6DebreBa"
! NAG key end

! NAG key begin
NPW3261NA ANNUAL CR11929:14299810 2026/11/30 "hPptOh5KnJqfvRoy9dYljevmuf"
! NAG key end

! NAG key begin
NPW3262NA ANNUAL CR11929:14299810 2026/11/30 "wCbd3oOmkKrgqogWhjoQj9InhA"
! NAG key end

! NAG key begin
NPW3270NA ANNUAL CR11929:14299810 2026/11/30 "b6jE3pS9oymeelm8JkVXo1YjxR"
! NAG key end

! NAG key begin
NPW3271NA ANNUAL CR11929:14299810 2026/11/30 "kqbiDloPpR9aUFbuUl5joHebrT"
! NAG key end

! NAG key begin
NPW3272NA ANNUAL CR11929:14299810 2026/11/30 "mljqsopunwLgt6cc+gQda53a+F"
! NAG key end

The license codes are valid until 30 November 2026.

Download Source
The software is available through NTNU’s software distribution service on SharePoint:

  • Navigate to [[https://studntnu.sharepoint.com/sites/software|NTNU Software Distribution]] (requires Feide authentication using your NTNU username and password).
  • Search for //NAG Library// or relevant variants, such as //NAG Toolbox for MATLAB//. Then select the appropriate version for your operating system (Windows, Linux, or macOS, including Apple Silicon and Arm Linux).

NAG’s Official Website:

  • Access the NAG website and navigate to the Downloads or NAG Library section
  • Select the desired library (e.g., Fortran, C, Python, or Java) and platform. You will need a license key issued by NTNU to activate the download.
  • Documentation, including the Installer’s Note and Users’ Note, is available on NAG’s website and provides detailed instructions on the installation process.

Installation Guide (Under treatment)
This is a general step-by-step guide for installing the NAG Library (Numerical Algorithms Group) on personal devices. Please note that certain details may vary depending on the operating system and the selected version, such as the C Library, Fortran Library, or Python Wrappers.

NAG’s Official Website:
🔧 Installation Guide for the NAG Library – Step by Step

🔹 1. Create an Account and Log In

  • Go to ng.com.
  • Create a user account or log in with an existing NTNU-affiliated account if you have a license agreement through the university.

🔹 2. ownload the Appropriate Version

  • Go to Download section.
  • Select the version suitable for your system:
    • OS: Windows / macOS / Linux
    • Programming Language: C / Fortran / Python

🔹 3. Install the NAG Library

For Windows:

*Run the .exe installation file as an administrator.

*Follow the installation wizard and select the installation directory.

*Enter the license key during installation (it can also be entered manually at a later time).

For Linux/macOS:

*Extract the .tar.gz file:

Run the installation script:

Specify the installation directory and license information when prompted.

🔹 4. Add the License File

  • Contact NTNU IT or the responsible faculty member to obtain the license file or license key.
  • Place the license file in the appropriate directory, for example:
    • Windows: C:\Program Files\NAG\license\
    • Linux/macOS: /nag/license/

🔹 5. Configure Environment Variables (Linux/macOS)

*Edit //.bashrc //or //.zshrc//:

🔹 6. Test the Installation

*Run a sample command:

or

🔹 7. Integration (Optional)

Connect to Python (if installed):

For use with Fortran or C, link the libraries during compilation:

Tips and Troubleshooting:

  • Ensure that you have a valid license.
  • Verify that you are using the appropriate compiler for the library (e.g., Intel Fortran or gfortran).
  • Consult the documentation for specific command-line options and examples.

The official documentation and user manuals for the NAG Libraries are primarily available at nag.com and support.nag.com. Search for the NAG Library Manual, Users’ Notes, or Installer’s Notes for comprehensive guidance.

The NAG Libraries (Numerical Algorithms Group Libraries) include several toolboxes, which are specialized add-on packages designed to integrate NAG’s more than 1,900 mathematical and statistical algorithms into various programming environments. These toolboxes facilitate the use of NAG’s functionality for numerical computations—such as linear algebra, optimization, and machine learning—within environments such as MATLAB, Python, and .NET.

Presented below is a concise general description of the available NAG toolboxes, adapted to the NTNU context.

Description of Available NAG Toolboxes

The NAG toolboxes are interfaces that provide access to the core algorithms of the NAG Library (Mark 30 as of 2025) within specific development environments. They are designed for academics, engineers, and researchers who require robust and precise computations. Each toolbox includes documentation, code examples, and support for platforms such as Windows, Linux, and macOS (including Apple Silicon and Arm Linux).

1. NAG Toolbox for MATLAB

  • Description: A toolbox that integrates over 1,400 NAG algorithms directly into MATLAB, providing access to functions for linear algebra, optimization, differential equations, statistics, and more.Key Features:
    • Seamless integration with MATLAB syntax and workflow.
    • Includes functions such as e04uc (nonlinear optimization) and f07 (linear equations).
    • Comprehensive documentation available via nagdoc in MATLAB.
  • Use Case: Ideal for NTNU students in courses such as TMA4180 (Optimization) or TTK4150 (Numerical Methods), where MATLAB is used for numerical simulations.
  • Example: x = f07adf(a, b) solves a system of linear equations in MATLAB.

2. NAG Library for Python (naginterfaces)

  • Description: A Python toolbox providing access to NAG algorithms via the naginterfaces package, including optimization, statistics, and machine learning.
  • Key Features:
    • Installed via pip (pip install naginterfaces) or through NAG downloads.
    • Supports modern Python versions (e.g., 3.12) and integrates with libraries such as NumPy.
    • Includes functions such as opt.lsq_gencon for constrained least squares problems.
  • BUse Case: Suitable for data science, machine learning, and scientific programming at NTNU, particularly for projects that require Python.
  • Example: from naginterfaces.library.opt import lsq_gencon for optimization tasks.

3. NAG Library for .NET

  • Description: A toolbox providing NAG algorithms as CLI DLL files for .NET environments, such as C# and Visual Basic.
  • Key Features:
    • Supports application development within Microsoft’s .NET framework.
    • Includes functions for financial mathematics, data analysis, and numerical computations.
  • Use Case: Used in software development for engineering or finance at NTNU, where .NET is the preferred platform.
  • Example: Calling G02 (regression) in a C# project.

4. NAG Library for Java

  • Description: A toolbox providing over 1,700 NAG algorithms as JAR files for Java developers.Key Features:
    • Robust and flexible for Java-based projects.
    • Covers optimization, statistics, and special functions.
  • Use Case: Suitable for NTNU students in computer science or engineering developing Java applications.
  • Example: Using e01 (interpolation) in a Java application.

5. NAG Data Mining Components

  • Description: A toolbox integrated into the NAG Library, focused on data processing and machine learning, including functions for data imputation, k-means clustering, PCA, and classification trees.Key Features:
    • Optimized for large datasets and statistical analysis.
    • Available in multiple languages (Python, C++, Fortran).
  • Use Case: Relevant for data science courses or research projects at NTNU that require machine learning algorithms.
  • Example: Using k-means clustering for grouping data.

6. NAG Automatic Differentiation (AD) Library

  • Description: A toolbox for automatic differentiation, capable of computing derivatives of complex functions with high precision.Key Features:
    • Supports sensitivity analysis and optimization.
    • Integrated with NAG’s core algorithms in environments such as Python and C++.
  • Use Case: Used in advanced numerical courses or research projects at NTNU, such as financial modeling or physics.
  • Example: Computing gradients in machine learning models.

7. NAG Fortran Compiler og Fortran Builder

  • Descripion: A toolkit that includes a Fortran compiler and a development environment (Fortran Builder) for building and testing NAG algorithms in Fortran.
  • Key Features:
    • Supports the Fortran 2003/2008 standards and integrates with the NAG Library.
    • Includes a graphical interface for simplified coding and debugging.

Download/Install/Run:

User Support

For technical support regarding NAG Amos at NTNU, you may contact the following:

1. NTNU IT, Orakel Services:

2. NAG Official Support

Supplier information

Manufacturer: See more about NAG Software at Numerical Algorithms Group Ltd