Physique_et_informatique/ModeleLaTeX_TP-gnuplottex-f...

37 lines
1.5 KiB
Gnuplot
Executable File

set terminal epslatex font 8 color dashed
set output './ModeleLaTeX_TP-gnuplottex-fig4.tex'
set format '\num{%g}'
set key top right Left
set key width 1
set key heigh 1
set key spacing 1.5
set xlabel 'Temps t (\si{\second})' # attention il faut parfois utiliser certains guillemets
# notamment quand on utilise la commande \si, il faut impérativement des primes '...'
set ylabel 'Tension U (\si{\volt})'
R = 98000
# Création du fit des données
# ---
# la fonction de fit
f(x)=3.976*exp(-(x-0.022)/a)#+b
#g(x)=c*x+d
# l'index 0 indique que les données sont dans le premier tableau du fichier
# on utilise (u) les deux premières colonnes et les paramètres de fit sont a et b
fit f(x) 'condo/data_condo9.txt' index 0 u 1:2 via a#,b
#fit g(x) 'data9.txt' index 1 u 2:1 via c,d
#,\ f(x) title 'Régres. linéaire.' lc 'blue'
C=a/R*1000000
e=(0.15-C)/0.15*100
title_f(a,b) = sprintf('\(\tau = \SI{%.3f}{\second}\) ; \(C = \SI{%.3f}{\micro\farad}\) ; \(e={%.1f}\%\)', a, C, e)
#R2 = c*1000
#e2 = (100-R2) / 100 *100
#title_g(c,d) = sprintf('\(R_{pente}\;\;\;\,\) = \SI{%.1f}{\ohm} ; \(e_{mes.}\) = %.1f\%', R2, e2)
plot [0.022:0.1][0:4]\
'condo/data_condo9.txt' index 0 u 1:2:5:4 title '\(R=\SI{98000}{\ohm}\) ; \(C=\SI{0,150}{}\pm\SI{0,03}{\micro\farad}\)' pt 4 w xyerrorbars,\
f(x) title title_f(a,b) lc 'green'#,\
#'data_condo.txt' index 1 u 3:1:5:4 title '\(R_{anneaux}=\SI{100}{\ohm}\) ; \(R_{mes.}=\SI{100}{}\pm\SI{3}{\ohm}\)' pt 4 w xyerrorbars#,\
#g(x) title title_g(c,d) lc 'red',\