BNALib
A Visual Basic
Numerical Analysis Library

BNALib is compatible with Visual
Basic 5.0 and 6.0 and is only $99.
Welcome to BNALib
The BNALib
software package is a comprehensive collection of state-of-the-art subroutines,
functions, and demonstration programs that provide powerful and efficient
numerical analysis computing capability for Visual Basic programmers. The software is provided in source code form
and you are entitled to distribute any binary applications created with BNALib
royalty free. However, please note that
you cannot redistribute the BNALib source code in any form.
Each numerical
method is a robust and easy to use digital computer algorithm designed to help
you solve practical and challenging problems in engineering, science, and other
technical applications. Many of these
routines have been used for many years to solve problems in the field of
Aerospace Engineering.
BNALib can be used for analysis
involving one or more of the following types of numerical calculations:
Systems of Linear Equations - Ordinary Differential Equations
Partial Differential Equations - Stiff
Differential Equations
Integration (Quadrature) - Differentiation
- Nonlinear Equations
Optimization - Interpolation - Least
Squares Curve Fit
Nonlinear Curve Fit - Chebyshev
Approximations - Statistics
Complex Numbers - Special
Functions - Trigonometry
Vector Algebra - Matrix
Algebra - Calendar/Julian Date Calculations
XY Plotting - Utility Routines
The BNALib
software package is a comprehensive numerical analysis tool box which consists
of three key features designed to make your technical programming effort
easier. The following is a brief
description of each of these important elements.
Structured Source Code
Complete source
code is provided for both fundamental and state-of-the-art Visual Basic
subroutines and functions. These digital
computer algorithms perform a variety of basic and sophisticated
number-crunching tasks, which may be too time-consuming or difficult to program
and debug yourself. Structured
programming practice is followed throughout in order to help you visualize and
understand each numerical process. You
are encouraged to modify and enhance the code as you see fit. Remember that any computer algorithm can
always be improved and customized!
Complete Demonstration Programs
A considerable
amount of time and energy has gone into the effort to supply you with
user-friendly and interactive demonstration programs. These programs illustrate the proper procedures
for working with each BNALib routine.
They provide guidelines that you can follow when setting up,
initializing, and solving your own numerical applications. Many of these programs also provide an
example problem for solution, and each program displays information about the
algorithm results. Several programs also
provide the user with information about how well the software performed as well
as error messages. The BNALib
demonstration programs provide a convenient way to prototype the solution
of your problems before integrating them into a larger software
application. Many BNALib users
have simply modified one or more demonstration programs to solve their unique
problems. The following is a typical
screen display:
Comprehensive User’s Manual
The BNALib
user’s manual is a comprehensive document, which describes the proper
procedures for integrating the BNALib algorithms into your Basic
applications. Complete coding instructions
are included for user-defined support routines, along with many examples. This documentation is a programmer’s guide to
the art and science of numerical analysis, and includes many programming hints,
tips, and technical advice. An extensive
bibliography is also included, along with an explanatory and practical
applications appendix. We have attempted
to find the proper mix of mathematics, Basic source code, graphics and program
examples to help you accomplish your programming task.
System Requirements
All BNALib
demonstration programs, functions, and subroutines require version 5.0 or 6.0
of Microsoft Visual Basic. The source
code and demonstration programs require about 1.5 megabytes of hard disk space.

Ordering Information
The cost of the BNALib
software suite is $99. The software can
be purchased using the secure and flexible e-commerce services provided by PayPal. After placing your order,
you will receive an email, within 24 hours, with a password that can be used to
extract the zipped BNALib source code library.
Click here to
download the Zipped source
code file (password protected)
_______________________________________________________________________________________________
The following is a
brief description of each of the numerical algorithms in the BNALib
software suite:
Linear Algebra
LINEAR1 - solves a system of linear equations using the method of
LU decomposition
LINEAR2 – solves a system of linear equations using the method of
Gauss-Jordan elimination
LINEAR3 – solves a system of tridiagonal linear equations using the
method of Gauss elimination with partial pivoting
IMPROVE – solves a system of linear equations using an iterative
improvement technique
Differential Equations
RK4 - solves a system of first order vector differential equations
using the classic Runge-Kutta fourth order method
RKF45 - solve systems of first order vector differential equations
using a Runge-Kutta-Fehlberg 4(5) method with step size control
RKF56 - solve systems of first order vector differential equations
using a Runge-Kutta-Fehlberg 5(6) method with step size control
RKF78 - solve systems of first order vector differential equations
using a Runge-Kutta-Fehlberg 7(8) method with step size control
RKV - solve systems of first order vector differential equations
using a seventh-order Runge-Kutta-Verner method with step size control
NYM4 - solves a system of second-order vector differential
equations using a fourth-order Nystrom method
ADAMSPC - solves systems of first order vector differential
equations using an Adams/Bashforth/Moulton predictor-corrector method
STIFF - solves a user-defined system of stiff first-order ordinary
differential equations
POISSON - solves the two-dimensional, elliptic partial differential
Poisson equation using the method of finite-differences
HEAT - solves the one-dimensional parabolic partial differential
heat equation using the Crank-Nicolson solution method
WAVE - solves the one-dimensional hyperbolic partial differential
wave equation using a finite-difference solution method
SHOOT - solves second-order, two-point boundary value (TPBVP)
problems using the shooting method
DIVDIFF - solves second-order, two-point boundary value problems
(TPBVP) using the method of divided differences
Integration (Quadrature)
SIMPSON - numerically integrates a user-defined table of x and y data
values of the form y = f(x) using Simpson’s method
SPLINE - numerically integrates a user-defined table of x and y
data of the form y = f(x) using the method of cubic splines
ROMBERG - numerically integrates a user-defined analytic function
of the form y = f(x) using Romberg’s method
INTEGRA2 - numerically estimates the value of a definite double
integral of a user-defined analytic function of the form z = f(x,y) using a
Composite Simpson solution method
INTEGRA3 - numerically estimates the value of a definite triple
integral of a user-defined analytic function of the form w = f(x,y,z) using a
Composite Simpson integration method
ASIMPSON - numerically integrates a user-defined analytic function
of the form y = f(x) using an adaptive Simpson solution method
GAUSLEG - numerically integrates a user-defined analytic function
of the form y = f(x) using a Gauss-Legendre solution method
GK - numerically integrates a user-defined analytic function of the
form y = f(x) using a 15-point Gauss-Kronrod method
Differentiation
DERIV1 - numerically estimates the first, second, third, and fourth
derivatives of a user-defined analytic function of the form y = f(x) using the
method of central divided differences
DERIV2 - estimates the first derivative of user-supplied tabulated
data of the form y = f(x) using Lagrange’s method
DERIV3 - estimates the first derivative of user-supplied tabulated
data of the form y = f(x) using the method of cubic splines
DERIV4 - numerically estimates the first derivative of a
user-defined analytic function of the form y = f(x) using Ridder’s method of
polynomial extrapolation
DERIV5 - numerically estimates the first derivative of an analytic
user-defined function of the form y = f(x) using an iterative
divided-difference method
NUMGRAD - numerically estimates the gradient of an analytic
user-defined vector function using Ridder’s method of polynomial extrapolation
NUMJAC - estimates the Jacobian of a user-defined system of
analytic equations using the method of forward divided differences
Nonlinear Equations
QUADRATIC - solve for the real roots of a quadratic equation
CUBIC - solve for the real roots of a cubic equation
QUARTIC - solve for the real roots of a quartic equation
POLYROOT - solves for the real and complex roots of a polynomial of
order less than or equal to 36 using
REALROOT - solves for the real root of a user-defined function of
the form y = f(x) using Brent’s method
IMMROOT - solves for the real root of a user-defined function of
the form y = f(x) using a variable order, improved memory method
NLINEAR - solves for the real roots of an unconstrained system of
nonlinear equations using
LMNLE - solves for the real roots of an unconstrained system of
nonlinear equations using the Levenberg-Marquardt method
BROYDEN - solves for the real roots of an unconstrained system of
nonlinear equations using Broyden’s method
CNLE - solve a user-defined system of constrained nonlinear
equations
Optimization
MINIMA1 - solves for a minimum or maximum of an unconstrained
scalar function of one variable
MINIMA2 - solves for a minimum or maximum of an unconstrained
analytic function of the form y = f(x) using Brent’s method
MINIMIZ1 - solves for a minimum or maximum of an unconstrained
scalar function of several variables using analytic partial derivatives
supplied by the user
MINIMIZ2 - solves for a minimum or maximum of a scalar function of
several variables using a numerical gradient computed by the software
NLP - solves the multi-variable, constrained, nonlinear
optimization or programming problem (NLP) using the method of multipliers and
Quasi-Newton minimization
Interpolation
CSFIT1 - calculate a natural cubic spline interpolation of
tabulated x and y data of the form y = f(x) provided by the user
CSFIT2 - calculates a clamped cubic spline interpolation of
tabulated x and y data of the form y = f(x) input by the user
INTERP1 - performs a linear interpolation of tabulated x and y data
of the form y = f(x) input by the user
INTERP2 - performs a bilinear interpolation of tabulated x, y and z
data of the form z = f(x,y) provided by the user
Curve Fit
FFIT - performs a curve fit of user-supplied tabular data of the
form y = f(x) to simple analytic equations
LSQFIT - performs a least squares curve fit of tabulated x and y
data of the form y = f(x) input by the user
SURFIT - performs a 2-dimensional curve fit of x, y and z tabulated
data of the form z = f(x,y) input by the user
NLFIT - performs a curve fit of user-defined x and y data of the
form y = f(x) to a nonlinear equation also defined by the user
Chebyshev Approximations
CHEBEVAL - evaluates Chebyshev coefficients which characterize a
user-defined analytic function or tabular data of the form y = f(x)
CHEBCOEF - determines the Chebyshev coefficients which approximate
a user-defined analytic function or tabular data of the form y = f(x)
CHEBDER - determines the Chebyshev derivative coefficients for a
user-defined analytic function or tabular data of the form y = f(x)
CHEBINT - determines the Chebyshev integral coefficients for a
user-defined analytic function or tabular data of the form y = f(x)
Fast Fourier Tranforms
FFT1 - calculates the forward and inverse Fast Fourier Transform
(FFT) of one-dimensional real and complex data
PRTFFT1 - provides a formatted screen display of the data generated
by the Fast Fourier Transform (FFT) subroutine FFT1
FFT2 - performs the forward and inverse Fast Fourier Transform
(FFT) of two-dimensional real and complex data
PRTFFT2 - provides a formatted display of the Fast Fourier
Transform (FFT) data generated by subroutine FFT2
Statistics
STATS - calculates the mean, variance and standard deviation of a
user-defined array of one-dimensional data
CHI - provides information about the Chi-squared distribution of
statistical data provided by the user
FDIST - calculates information about the f distribution of
statistical data provided by the user
TDIST - provides information about t distribution of statistical
data
Special Functions
AIRY - evaluates the Airy functions Ai(z) and Bi(z) and their
derivatives for a user-defined real argument
BESSEL - computes the Bessel functions and derivatives for Bessel
functions of the first and second kind
BETA - evaluates the Beta function for a user-defined real argument
BETAI - evaluates the incomplete Beta function for a user-defined
argument
DLOG10 - calculates the common or base 10 logarithm of a number
ELLIPTIC - calculates complete elliptic integrals of the first and
second kind
ERF - calculates value of the Gaussian error function
FRESNEL - calculates the sine and cosine Fresnel integrals
GAMMA - evaluates the Gamma function for a positive and real
user-defined argument
GAMMALN - evaluates the log of the Gamma function for a positive
and real user-defined argument
PSI - evaluates the Psi function for a user-defined real argument
Complex Numbers
CMPXADD - returns the result of adding two complex numbers
CMPXDIV - returns the result produced by dividing two complex
numbers
CMPXMULT - multiplies two complex numbers together
CMPXRECP - calculates the reciprocal of a complex number
CMPXPOWR - returns the result of raising a complex number to an
integer power
CMPXROOT - calculates the Nth root of a complex number
CMPXSQRT - calculates the square root of a complex number
CMPXSUB - subtracts two complex numbers
Trigonometry
ASIN - computes the inverse sine
ACOS - computes the inverse cosine
ATAN3 - computes the four quadrant inverse tangent
SINH - computes the hyperbolic sine
COSH - computes the hyperbolic cosine
TANH - computes the hyperbolic tangent
ASINH - computes the inverse hyperbolic sine
ACOSH - computes the inverse hyperbolic cosine
ATANH - computes the inverse hyperbolic tangent
Matrix Algebra
MATADD - calculates the sum of two real matrices
MATSUB - subtracts two real matrices
IMATRIX - calculates an identity matrix whose size is specified by
the user
TRANSPOSE - calculates the transpose of a real matrix
MATXVEC - multiplies a column vector by a real matrix
MATXMAT - performs multiplication of two real matrices
RANK - computes the rank of a real matrix
TRACE - calculates the trace of a real, square matrix
INVERSE - calculates the inverse of a real square matrix
DETERMIN - calculates the determinant of a real square matrix
EIGEN - computes the real and complex eigenvalues and eigenvectors
of a real or complex square matrix
Vector Algebra
UVECTOR - calculates the unit vector of a 3-component column vector
VECMAG - calculates the scalar magnitude of a real 3-component
vector
VECADD - performs vector addition
VECSUB - performs vector subtraction
VDOT - determines the dot product of two vectors
VCROSS - determines the cross product of two vectors
VECSTP - calculates the scalar triple product
VECVTP - calculates the vector triple product
Utility Routines
CDATE - calculates the calendar date from the Julian date
JULIAN - computes the Julian date for any valid calendar date
XYPLOT - displays a simple x-y plot of data provided by the
user
SCALE - takes unscaled minimum and maximum values for a graphics
axis and returns new and easy to read scale values
QSORT - sorts a one-dimensional array of real data using the
Quicksort algorithm
ROUND - rounds a real, double precision number to a user-specified
number of decimal places
DOWNLOADS
A
PDF version of the BNALib user's manual
You will need
version 5.0 or later of Adobe Acrobat Reader to view or print these files. This program is available free at www.adobe.com.
The following are
several BNALib demonstration programs.
Numerical integration with a 15-point Gauss-Kronrod method
Solution of systems of differential equations with Runge-Kutta-Felhberg routines
Solution of a single nonlinear equation
Demonstration program for several of the BNALib special functions
One-dimensional minimization demonstration program
The following are
several example subroutine source code files included in the BNALib
software package.
Solution of a system of linear equations using the Gauss-Jordan method
Runge-Kutta-Fehlberg 4(5) method for solving systems of differential equations
The T-distribution statistical function
Bug Fixes
The following line of source code
FOR K = 1 TO 2 * L - 1
should be
FOR K = 0 TO 2 * L - 1
Thanks to Nelson N. for finding this bug.

Web contents Copyright 1997-2008
by C. David Eagle, Jr. All rights
reserved.