From 668b5299bde0b8f49efa09f9a783a9d97f27066d Mon Sep 17 00:00:00 2001 From: Arthur Date: Mon, 23 Dec 2024 13:20:37 +0100 Subject: [PATCH] Folder creation 4 useful py scripts --- utils/gauss_legendre_weights.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 utils/gauss_legendre_weights.py diff --git a/utils/gauss_legendre_weights.py b/utils/gauss_legendre_weights.py new file mode 100644 index 0000000..554bbc7 --- /dev/null +++ b/utils/gauss_legendre_weights.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# Resume: The script the roots and weights of the legendre polynomials +# of order n. +# See https://mathworld.wolfram.com/Legendre-GaussQuadrature.html + + +# w_i = (2 * (1-roots[i]**2)) / ((i+1)**2 * (PL(roots[i]))**2) + + +# SUM(W_i) = 2.