Friday, November 27, 2009

SINE INTEGRAL IN SCIPY

THE SINE INTEGRAL

The Sine Integral is a very important function in Physics, Astronomy, Electrodynamics, Mathematical Physics,Optics and Signal Processing.

A fundamental result in the sine integral is;

This result is analytically proven using contour integrals concept from complex theory.


TRYING IT IN MATLAB



MATLAB gives excellent results, particularly for the special case of (0-inf )it gives correct value.

TRYING IT IN SCIPY


In Scipy the sine integral (and the cosine integral) is via (si,ci) = sici function. It yields excellent values for numbers, however for infinity it yields nan (not a number). This should probably be corrected with an exception in the sici module.

It is worth noting that for sufficiently high values (which tend to infinity) the desired result of 1.57.... ( = pi/2) is obtained, which confirms the numerical evaluation is correct


REFERENCES

(1)
sici
(2) sine integral




Wednesday, November 25, 2009

RAISING IT TO THE POWER OF ......

LAWS OF EXPONENT

In the laws of exponents, a number can never be raised to an exponent to yield negative values. Only using complex exponents can negative values be obtained.


Trying the same formulation in python, it is worth noting that the formulation fails for a = 1 hence a special case output for a = 1.


Some sample output is ;


Similar treatments in MATLAB is also fruitful



The visible change is that iota in MATLAB it is i, while in Python it is j.


Saturday, November 7, 2009

BIZARRE BIZARRE PYTHON

IS THAT SOME WITCH CRAFT ?

Python .... maybe the one of the best programming languages has just gone crazy !

In the interpreter mode I got these crazy results trying to get numbers starting with zero...


Only on referring to Hetland that I got to know that the interpreter does an OCTAL !

REFERENCES
(1) Hetland