expint function with two arguments

조회 수: 1 (최근 30일)
selin
selin 2017년 3월 10일
댓글: Torsten 2017년 3월 10일

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
Torsten
Torsten 2017년 3월 10일
The denominator in expint is y, not y^2.
First apply integration-by-parts to arrive at "expint".
Best wishes
Torsten.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Mathematical Functions에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by