Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


Math Forum » Discussions » Software » comp.soft-sys.matlab

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

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Peter Mairhofer

Posts: 36
Registered: 8/18/10
expint gives unexpected result
Posted: Aug 14, 2014 6:17 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.