Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: expint gives unexpected result
Replies: 5   Last Post: Aug 16, 2014 12:33 AM

 Messages: [ Previous | Next ]
 Peter Mairhofer Posts: 41 Registered: 8/18/10
expint gives unexpected result
Posted: Aug 14, 2014 6:17 PM

I compare expint() with numerical calculation.

The real part matches reasonably well but the imaginary part has a -2pi
jump *after* zero.

At least for real values I would not expect this.

Furthermore, [1] states that Ei is ambiguous but E1 is not.

Where does this discrepancy come from and how to fix it?

Thanks
Peter

PS: Here is a small piece of code that compares the function with real
arguments:

Ts = 1e-4;
t = [ -10:Ts:-Ts Ts:Ts:1 ];t=t(:);

figure, plot(t, real([Ts*cumtrapz(exp(-t)./t) , (expint(t(1))-expint(t))]));
legend('cumtrapz','E_1');

figure, plot(t, imag([Ts*cumtrapz(exp(-t)./t) , (expint(t(1))-expint(t))]));
legend('cumtrapz','E_1');

[1] http://en.wikipedia.org/wiki/Exponential_integral

Date Subject Author
8/14/14 Peter Mairhofer
8/15/14 Roger Stafford
8/15/14 Peter Mairhofer
8/15/14 Nasser Abbasi
8/15/14 Roger Stafford
8/16/14 Roger Stafford