Physique_et_informatique/ModeleLaTeX_TP-gnuplottex-fig13.gnuplot

34 lines
1.3 KiB
Plaintext
Raw Normal View History

2023-02-06 21:15:30 +01:00
set terminal epslatex font 8 color dashed
set output './ModeleLaTeX_TP-gnuplottex-fig13.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 = 1182
# Création du fit des données
# ---
# la fonction de fit
f(x)=(9.232)*exp(-(x-2.831)/a)
fit f(x) 'condo/data_condo_2_100µF_1182Ω.txt' index 0 u 1:2 via a
C=a/R*1000000
e=(100-C)/100*100
title_f(a,b) = sprintf('\(\tau = RC = \SI{%.3f}{\second}\) ; \(C = \SI{%.3f}{\micro\farad}\) ; {%.1f}\%', a, C, e)
# Pour Gnuplot directement en ligne de commande
#plot [0.55:5][0:4] 'data_condo.txt' index 0 u 1:2
set style line 1 lt 0 lw 4
plot [2.83:4.63][0:9.3]\
9.232*exp(-(x-2.831)/(R*100e-6*1.2)) w filledc y1=0 fc rgb 'grey90' title '',\
9.232*exp(-(x-2.831)/(R*100e-6*0.8)) w filledc y1=0 fc 'white' title '',\
9.232*exp(-(x-2.831)/(R*100e-6)) ls 1 title '\(U(t)=9.232\cdot e^{-(t-5.296)/0,1182}\) ; i(C)=20\%',\
'condo/data_condo_2_100µF_1182Ω.txt' index 0 u 1:2:5:4 title '\(R=\SI{1182}{\ohm}\) ; \(C=\SI{100}{}\pm\SI{20}{\micro\farad}\)' pt 4 lc rgb 'blue' w xyerrorbars,\
f(x) title title_f(a,b) lc 'green'