|
Introduction
|
|
The Maple-NAG Connector allows you to combine the pre-eminent modeling, exploration, and application development abilities of Maple with the power and breadth of trusted NAG numeric routines.
Key features include:
•
|
NAG routines that can be used anywhere you use Maple commands. Both short and long NAG function names are available.
|
•
|
Fast prototyping and modeling environment gives quick results. Develop and test your code in the interactive Maple environment without the need for compiling or linking.
|
•
|
Simplified calling sequences make coding easier. Appropriate default values for many parameters are provided automatically.
|
•
|
NAG C Library documentation is integrated into the searchable, indexed Maple Help System and includes hundreds of examples coded in Maple.
|
|
|
Before You Begin
|
|
1. Install the NAG C Library
Make sure that a compatible version of the NAG C Library is installed. See NAG,Platforms for details.
2. Run the NAGVersion command
The NAGVersion command sets the version of the NAG C Library for use with the Maple-NAG Connector. The command sets the Mark, which is the major NAG C Library version number, as well as the performance choice for a given NAG C Library version. When run with no arguments, the command returns the current settings. When run to set new values, the command returns the previous values.
The general call to NAGVersion has the form,
NAG[NAGVersion]( Mark=mvalue, Performance=pvalue )
where mvalue and pvalue are replaced with suitable values. The argument Performance=pvalue is optional. For details, see the help page NAG,NAGVersion.
The command may be run as shown in the examples below.
| (1) |
>
|
NAG[NAGVersion](Mark=8,Performance='MKL');
|
| (2) |
| (3) |
To avoid having to enter this command in each new Maple session, the settings may be saved and re-used in either of the two following ways:
1. Construct the NAGVersion command with the saveversion option specified. This has the general form,
NAG[NAGVersion]( Mark=mvalue, Performance=pvalue, saveversion=true )
2. Place the NAGVersion command in a Maple initialization file.
For additional details, see the help page NAG,NAGVersion.
|
|
Using the Maple-NAG Connector
|
|
|
Getting Help
|
|
To access NAG help pages in the help system, enter the following command:
This action launches the main help page for the Maple-NAG Connector. Help pages for all functions are available through hyperlinks from the ?NAG help page. They are also accessible from the Help System's Table of Contents. To launch the help system, either call a single help page as described above, or select Help > Maple Help from the main menu. In the Table of Contents tab, select Toolboxes > Maple-NAG Connector.
For more information about accessing help pages in Maple, see help.
|
|
Maple Setup
|
|
Maple commands can be called from either the Worksheet mode or Document mode interface. However, it is recommended that you use the Worksheet mode and 1-D Math input when programming or using programming commands. To start a document in Worksheet mode, from the main menu select File > New > Worksheet Mode.
To switch from 2-D to 1-D entry, press the F5 key at the prompt. 1-D Math input is red.
To set Worksheet mode and 1-D entry as your defaults, follow these steps:
1. From the Tools menu, select Options. On the Interface tab, set the Default Format for New Worksheet to "Worksheet".
2. From the Tools menu, select Options. On the Display tab, set the Input Display to "Maple Notation".
Note that in 1-D, commands must end with a semi-colon.
For details on Worksheet Mode and 1-D Math input, see User Manual, Chapter 3.
|
|
Long and Short Forms
|
|
You can use the long form or the short form when running Maple-NAG Connector commands.
The long form is constructed in the following way (using a sample Maple-NAG Connector command, a02bcc):
| (4) |
Or equivalently, using the NAG long name to call the command:
>
|
NAG[nag_complex_imag](1+3*I);
|
| (5) |
To enable use of the short form, load the NAG package by entering the following command:
Now the above command may be called in the following way:
| (6) |
Or equivalently:
>
|
nag_complex_imag(1+3*I);
|
| (7) |
For more information on long and short form, see UsingPackages.
For more information on using the NAG C Library long name, see NAG,intro.
For help on the Maple-NAG Connector command a02bcc, see NAG,a02bcc.
|
|
Example
|
|
This example returns the value of the error function. See NAG,s15aec for details.
| (8) |
| (9) |
|
|
Sample Worksheet
|
|
A sample worksheet is provided for you to work through an entire problem, from setup to visualization. This worksheet demonstrates one of the many possible uses of the powerful NAG meshing routines that can be implemented in Maple using the Maple-NAG Connector.
View the sample worksheet.
|
|
Tips and Tricks
|
|
For information on the structure of the NAG Library and documentation, general and programming advice, use of NAG long names, a summary for new users, and other general topics, see NAG,intro.
|
|
New to Maple?
|
|
New to the NAG C Library?
|
For a quick overview of Maple, see:
|
|
For an introduction to the Maple-NAG Connector, see:
|
For a more comprehensive introduction to Maple, see:
|
|
For an introduction to the NAG C Library, see:
|
For an introduction to the Maple programming language and basic syntax, see:
|
|
For information about supported platforms, see:
|
|
|
|