# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt

import matplotlib
matplotlib.rcParams['mathtext.fontset'] = 'stix'
matplotlib.rcParams['font.family'] = 'STIXGeneral'


#%% FONCTION

def f(x, K=10,a=1): #le "C=1", il fait que si tu précises rien, genre "f(3)", il prend par défaut C=1
    
    return 1-(1/(1+K*a/x))**x


#LISTE DES X
X = np.linspace(0,10,1000) #début, fin, nombre de points

#LISTE DES Y
Y1 = f(X, K=10, a=0.3)

#%% GRAPHE

fig = plt.figure(figsize=(6,6))
ax = fig.add_subplot(111)

ax.set_xlim(0,10) #Limites de l'axe X
ax.set_ylim(0,1.1) #Limites de l'axe Y

ax.set_xlabel(r'$x$', fontsize = 20) #Titre axe X
ax.set_ylabel(r'$q/q_m$', fontsize = 20) #Titre axe Y


ax.plot(X,Y1, label=r'$\frac{q}{q_m}=f(x,C=100)$', lw=4) #label : nom dans la légende, lw : épaisseur du trait

#%% OPTIONNEL

#ax.grid(True) #Grille
#ax.legend(loc=2 ,prop={'size':20}) #Legende


