CodeCogs - A iteractive open source Numerical library in C/C++, with wrappers for .NET and Excel Welcome... Login
Site Map
shopping cart
OSX compatibleWindows compatibleLinux compatible
Search CodeCogs
Numerical Components
Worked Examples

Valid RSS

mathsspecial

Sine Power Integral

Available under GPL (Free) and Commercial licence
get a GPL licence
COST (GBP)
this unit 1.76
sub units 0.00
add a commercial licence to your cart
0
viewed 3006 times and licensed 16 times

Evaluates the sine power integral.

Controller: CodeCogs    Contact Controller

+View version details
Contents hide toc

Interface

#include <codecogs/maths/special/sine_power_integral.h>

using namespace Maths::Special;

double sine_power_integral (double a, double b, int n)
Evaluates the sine power integral.
ExcelReal cc_sine_power_integral (Real a, Real b, Integer n)
This function is available as a Microsoft Excel add-in.

Function Documentation

Sine Power Integral Calculator
  
Add calculator to website or email
 
doublesine_power_integraldoublea
doubleb
intn )
This function evaluates the sine power integral with given parameters, defined by

(1)
\displaystyle \mathrm{sinepower}(a, b, n) = \int_a^b \sin(t)^n \mathrm{d}t

The algorithm uses the fact that

(2)
\displaystyle \int \sin^n(t) \mathrm{d}t = \frac{1}{n} \left( \sin^{n-1}(t) \cos(t) + (n-1) \int \sin^{n-2}(t) \mathrm{d}t \right)
Example:
#include <codecogs/maths/special/sine_power_integral.h>
#include <iostream>
#include <iomanip>
 
int main()
{
  std::cout << std::setprecision(10);
  std::cout << "For lower and upper bounds a = 0 and b = 10, " << std::endl;
  std::cout << "and 0 <= n < 10, the value of the integral is" << std::endl;
  for (int n = 0; n < 10; n++)
  {
    std::cout << "n = " << n << " : ";
    std::cout << Maths::Special::sine_power_integral(0, 10, n) << std::endl;
  }
  return 0;
}
Output:
For lower and upper bounds a = 0 and b = 10,
and 0 <= n < 10, the value of the integral is
n = 0 : 10
n = 1 : 1.839071529
n = 2 : 4.771763687
n = 3 : 1.308824601
n = 4 : 3.545048474
n = 5 : 1.061758823
n = 6 : 2.947543192
n = 7 : 0.913186379
n = 8 : 2.577621119
n = 9 : 0.8124365163
Parameters:
athe lower limit of integration
bthe upper limit of integration
nthe power of the sine function
Returns:
An approximation of the sine power integral.
References:
John Burkardt's library of statistical C++ routines, http://www.csit.fsu.edu/~burkardt/cpp_src/prob/prob.html
Authors:
Lucian Bentea (September 2005)
Source Code:

You do not own any licences for this module.
To view or download source code you must get a GPL licence or buy a commercial licence.

buy now     get GPL     add to cart

For advanced download and development options Register with CodeCogs. Already a Member, then Login.


Page Comments

Format Excel Equations

  You must login to leave a messge


Last Modified: 18 Oct 07 @ 17:07     Page Rendered: 2009-01-05 22:49:52

Valid CSS!   Valid XHTML 1.0 Transitional