# What is InterCall?

InterCall is a Mathematica package that provides:
• easy access to all the routines in the NAG subroutine library.
• straightforward declaration of default settings for arguments in external routines.

With InterCall you can:

• import routines written in Fortran or C and call them as if they were Mathematica functions.
• call external routines on a remote computer.
• develop and test the robustness and correctness of external libraries.
• write your own interface to other external libraries.

# Why Use InterCall?

• To extend the type of problems that Mathematica can solve.
• The full scope of routines in standard numerical libraries become available to Mathematica users.
• Intelligent defaults are supplied automatically by InterCall when you call an external routine.
• Inspecting and modifying defaults is simple and uses commands named GetDefault and SetDefault.
• Independent documentation, for calling external routines from within Mathematica, is not required.

# Who Should Use InterCall?

• Anyone whose work involves numeric processing and who wants Mathematica's ease of use.
• Mathematica users who need to access numerical libraries on a remote machine.
• Current users of numerical libraries who want a simple development environment.
• Teachers of courses such as numerical methods.
• Engineers, scientists, economists, physicists, mathematicians, statisticians etc.

# How Does One Use InterCall?

Here is a simple session showing how to use InterCall to call a NAG library routine:

```        In[1]:= <<InterCall.m;

Copyright (c) 1992-93 T. D. Robb.
```
Connect to a computer that has the NAG subroutine library
```        In[2]:= InterCall["sollya.maths.uwa.edu.au -l abbott"];
```
Note that computers anywhere on the internet can be specified.

Load the NAG library defaults database

```        In[3]:= <<InterData.m
```
Suppose that you want to integrate the oscillatory function x cos(30x) sin(x) from 0 to 2Pi. First use "find" to locate an appropriate NAG routine:
```        In[4]:= find["quadrature" && "finite" && "one" && "oscil"]

D01AKF (NAG)
interval, method suitable for oscillating functions.
```
Check the default values for d01akf:
```        In[5]:= GetDefault[d01akf]

D01AKF[ (* TYPE=S *)
\$F -> In,                 (* DATA=RF[R] *)
\$A -> In,                 (* DATA=R *)
\$B -> In,                 (* DATA=R *)
\$EPSABS -> 0.,            (* DATA=R *)
\$EPSREL -> 0.00001,       (* DATA=R *)
\$RESULT :> Out,           (* DATA=R *)
\$ABSERR :> d01akf`abserr, (* DATA=R *)
\$W :> Null,               (* DATA=R[\$LW] *)
\$LW -> 2000,              (* DATA=I *)
\$IW :> Null,              (* DATA=I[\$LIW] *)
\$LIW -> \$LW/8 + 2,        (* DATA=I *)
\$IFAIL -> -1              (* DATA=I *)
] (* CODE="LIBRARY" *)

Out[5]= d01akf[\$F_, \$A_, \$B_] -> \$RESULT
```
This indicates that the user only has to supply \$F (the function), \$A (the lower integration limit), and \$B (the upper integration limit). Other parameters such as \$EPSREL have been assigned default values (here 0.00001).

Compute the integral of x Cos[30x] Sin[x] from 0 to 2Pi:

```        In[6]:= d01akf[ Function[x, x Cos[30x] Sin[x]], 0, 2Pi ]

InterCall::opened: Opened connection to host sollya
InterCall::import: Importing: {D01AKF}
Using remote driver version 2.0 on host sollya

Out[6]= 0.006989082655373541
```
Here the function x Cos[30x] Sin[x] is being "emulated" using Mathematica. Alternatively you can pass compiled fortran or C directly to d01akf from within Mathematica.

Here is the absolute error in the last integral

```        In[7]:= d01akf`abserr
-14
Out[7]= 4.399258735077181 10
```
InterCall completely integrates the symbolic capabilities of Mathematica with the numeric routines of any external library. You can pass a Mathematica function, array, or any other expression, as an argument to any external routine and InterCall will send the correct type of information to that external routine.

# System Requirements:

InterCall runs under Mathematica version 2, and requires a Unix kernel or a Macintosh with a TCP/IP network connection.

Remote drivers to access external code on a remote computer are available for Apollo, Connection Machine, Convex, DEC/Ultrix, HP9000, IBM RISC, Iris, Sparc, Sun-3 and VAX/VMS. Drivers for AViiON, MIPS and Sony are under development.

# InterCall includes:

• all the files needed to run InterCall on your computer.
• various remote drivers (available upon request)
• a detailed TeX manual describing how to use InterCall with Notebook examples

```Analytica International Pty Ltd
PO Box 522
Nedlands, WA 6909
Australia
Phone: +61 (0)8 9357 5027
Fax  : +61 (0)8 9388 0885
```
InterCall was developed by:

Dr. Terry Robb