expint function with two arguments

4 Ansichten (letzte 30 Tage)
selin
selin am 10 Mär. 2017
Kommentiert: Torsten am 10 Mär. 2017

Hello, I would like to evaluate the integral in the picture for t_1=6, t_2=190, delta=0.0011, and kappa=2.1536. Since t_1<t_2, I expect the value of this integral to be positive. However, by using the following code, I get a negative value. In the code, I use the inbuilt expint function of Matlab. Since the denominator's power is 2, I first create a symbolic expression, expint(sym(2), sym(t)), following Matlab's tutorial (https://www.mathworks.com/help/symbolic/expint.html). I would appreciate very much if someone can help me find what is wrong with my code!

        a=sym(2);
        b0=[0.0011; 2.1536]; % b0=[delta; kappa]
        bb0=sym(b0);
        tt1=sym(6);
        tt2=sym(190);
        a1=expint(a,bb0(1)*tt1)-expint(a,(1+bb0(2))*tt1*bb0(1));
        a2=expint(a,bb0(1)*tt2)-expint(a,(1+bb0(2))*tt2*bb0(1));
        x=sym(a1-a2);
        y=vpa(x)

I would appreciate any feedback! I find it particularly difficult since I cannot see how the inbuilt expint function is working....

  1 Kommentar
Torsten
Torsten am 10 Mär. 2017
The denominator in expint is y, not y^2.
First apply integration-by-parts to arrive at "expint".
Best wishes
Torsten.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Special Functions finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by