<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#! /usr/bin/python
# -*- coding: utf-8 -*-

#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
#
"""Methodes de quadratures.
Auteur: Mettre votre nom
Date: 20-06-2025
"""

######################################
# Imports                            #
######################################

import matplotlib.pyplot as plt
from math import *

######################################
# Algorithme d'exemple:              #
# Trace de courbes                   #
######################################

def f1(x):
    return log(x+1)

def f2(x):
    return x+1


X=[2*k/5 for k in range(6)]
Y1=[f1(h) for h in X]
Y2=[f2(h) for h in X]
plt.plot(X,Y1,label="courbe de f1")
plt.plot(X,Y2,label="courbe de f2")
plt.legend()
plt.show()


######################################
# Algorithme 1:                      #
# Trace d'exp                        #
######################################


######################################
# Algorithme 2:                      #
# Fonction en escalier               #
######################################


######################################
# Algorithme 3:                      #
# Trace d'escalier                   #
######################################


######################################
# Algorithme 4:                      #
# Affine par morceaux                #
######################################


######################################
# Algorithme 5:                      #
# Trace d'ffine                      #
######################################


######################################
# Question 1:                        #
# Un calcul d'integrale              #
######################################


######################################
# Algorithme 6:                      #
# Rectangles a gauche                #
######################################


######################################
# Algorithme 7:                      #
# Calcul de precision                #
######################################


######################################
# Algorithme 8:                      #
# Point milieu                       #
######################################


######################################
# Question 2:                        #
# Integrale de fonction affine       #
######################################


######################################
# Algorithme 9:                      #
# Trapezes                           #
######################################


######################################
# Algorithme 10:                     #
# Comparaison des methodes           #
######################################


######################################
# Question 3:                        #
# Verdict                            #
######################################

</pre></body></html>