From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Bug: Ci(x) and Chi(x) for negative values

Hi,

 

There are three problematic math functions in the Mathematics -> Elementary & Special Functions -> Exponential Integrals palette:

 

1) 'Cosine Integral.vi' and 'Hyperbolic Cosine Integral.vi' both return real values for negative input values. Neither function is defined in the real domain for negative input values, so should return NaN for inputs <0.

 

2) 'Dilogarithm.vi' is really evaluating Spence's Integral (as its icon says). The dilogarithm function Li2(x) and spence's integral isn't the same function, so it can't be both. Spence's Integral F(x)=Li2(1-x). The solution would be to a) Make the 'Dilogarithm.vi' really evaluate the dilogarithm function (and fix its icon), and b) To make an additional 'Spence's Integral.vi' that does what 'Dilogarithm.vi' does today.

 

Cheers,

Steen

CLA, CTA, CLED & LabVIEW Champion
0 Kudos
Message 1 of 7
(3,013 Views)

Hello SteenSchmidt

 

Thank you for your valuable input. I will create a bug report for this and raise it with R&D. 

 

I have tested everything you mentioned below, but just wanted to verify the 'Hyperbolic Cosine Integral.vi' that you mentioned. 

 

This correctly returns a value of 74.2099 when the input is -5. (i.e.: cosh(-5) = 74.2099). Is there a crucial Mathematical fundamental that I am missing here?

 

Regards,

Shazil M.
CLAD
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 2 of 7
(2,958 Views)

Hi Shazil,

 

It's not the Cosh(z) function that there are problems with, it's the Hyperbolic Cosine Integral:

 

Chi.png 

 

Chi(-5) should return a complex number (20.09+i*pi actually), but the LabVIEW Chi function returns a real number which is only the real part of the proper result. Since the LabVIEW Chi function can't return a complex result, the next best thing would be to make it return NaN instead I think. The same with the Cosine Integral (Ci(z)). The ordinary trig funtions Cos and Cosh works just fine as far as I know.

 

/Steen

CLA, CTA, CLED & LabVIEW Champion
0 Kudos
Message 3 of 7
(2,952 Views)

Hi Steen, 

 

Thanks for the description. Im glad this was clarifed. 

 

Regards,

Shazil M.
CLAD
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 4 of 7
(2,938 Views)

Hello Steen, 

 

Just to let you know these bugs have been reported. I would like to thank you once again for pointing these out. 

 

Best Regards,

Shazil M.
CLAD
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 5 of 7
(2,904 Views)

Thanks Shazil,

 

Do you have a CAR for reference?

 

/Steen

CLA, CTA, CLED & LabVIEW Champion
0 Kudos
Message 6 of 7
(2,888 Views)

Yes. You can track the CAR using the following reference: 512845

 

Thanks,

Shazil M.
CLAD
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 7 of 7
(2,878 Views)