Skip to content

loika/IPP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

IPP

"Integral and processor parallelization".

  • Generic badge

Introduction

the objective is to compute the approximation of an integral with or without parallelization to compare for each method. The function to integrate is $f(x) = \cos(x^2)\dfrac{\exp(\frac{-x^2}{2})}{\sqrt{2\pi}}$. we have

$$I(A,B) = \int_A^B,f(x)d,x \approx \sum_{i = 1}^N f(x_i)d_{w_i}\qquad ,A \leq x_i \leq B \quad d_{w_i} \in \mathbb{R}$$ For the calculation of the integral with parallelization, we will use the formula of charles :

$$I(A,B) = \sum_{j = 1}^M I(A_j,B_j) $$

Notation

  • $A,B$ the bounds of the integration interval
  • $N$ the number of subintervals of the subdivision
  • $M$ number of cpu cores
  • $[A_j,B_j]$ subintervals of $[A,B]$
  • $x_i$ points
  • $d_{w_i}$ pounds

subject to :

  • $N \geq M > 0$
  • $-\sqrt{\frac{\pi}{2}} \leq A < B \leq \sqrt{\frac{\pi}{2}}$

methode

For the approximation of the integral, we use Gaussian quadrature with the three-point Gaussian-lengender formula:

$$I(-1,1) \approx \dfrac{5}{9}f\left(-\sqrt{\frac{3}{5}}\right) + \dfrac{8}{9}f(0) + \dfrac{5}{9}f\left(\sqrt{\frac{3}{5}}\right)$$

The approximation calculation of $I(A_j,B_j)$ is done with a change of variable

to get started

change $N,A,B$ in program.py.

if __name__ == '__main__'

pre-requisites

  • Generic badge

the use of program progmanopt requires :

  • Generic badge
  • Generic badge
  • Generic badge

if the packages are not installed. you can install them the command :

pip install -r requirements.txt

if the command did not work, you can install the packages one by one with the command

pip install [package]

Contributor

Links

packages

Documentation

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages