expint function with two arguments

2 次查看(过去 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