Scientific programming language
In computer programming, a scientific programming language is a programming language optimized for the use of mathematical formulas and matrices..[1] Although these functions can be performed using any language, scientific programming languages provide both a syntax and a standard library that facilitates their use. Such languages include ALGOL, APL, Fortran, J, Julia, Maple, MATLAB, Python and R.[2][3][4][5] Scientific programming languages should not be confused with scientific language in general, which refers loosely to the higher standards in precision, correctness and concision expected from practitioners of the scientific method.
Examples
Linear algebra
Scientific programming languages provide facilities to work with linear algebra. For example, the following Python program solves a system of linear equations:
import numpy
A = numpy.random.random((20, 20)) # A is a 20x20 matrix
b = numpy.random.random((20,)) # b is a 20x1 column vector
x = numpy.linalg.solve(A, b) # x is the solution to A * x = b
Working with large vectors and matrices is a key feature of these languages, as linear algebra lays the foundation to mathematical optimization, which in turn enables major applications such as deep learning. In Python alone, specialized libraries with the same API as the standard NumPy can be found in CuPy, JAX, PyTorch and TensorFlow.
Mathematical optimization
In a scientific programming language, we can compute function optima with a syntax close to mathematical language. For instance, the following program finds the minimum of the polynomial :
from scipy.optimize import minimize
def f(x):
return x[0] ** 2 - 3 * x[0] * x[1] + 5 * x[1]**2 - 7 * x[1] + 3
initial_guess = [0., 0.]
(x_min, y_min) = minimize(f, initial_guess)["x"]
The use of an initial guess is specific to the algorithm used. With more knowledge of the function to be minimized, more efficient algorithms can be used. For instance, convex optimization provides faster computations when the function is convex, quadratic programming provides faster computations when the function is at most quadratic in its variables, and linear programming when the function is at most linear.
See also
References
- ^ "Definition of scientific language". PC Magazine Encyclopedia. Ziff Davis. Retrieved 13 May 2021.
- ^ Ning, Andrew. "Scientific Programming Languages". Flight, Optimization, and Wind Laboratory. Brigham Young University. Retrieved 13 May 2021.
- ^ Zachary, Joseph. "Introduction to Scientific Programming: Computational Problem Solving Using Maple and C". Joseph L. Zachary. University of Utah. Retrieved 13 May 2021.
- ^ Karakan, Burak (1 May 2020). "Python vs R for Data Science". Towards Data Science. Retrieved 13 May 2021.
- ^ "scientific language - Definition of scientific language". YourDictionary. The Computer Language Company Inc. Retrieved 27 March 2014.