%% 2007-2008 %% TP INSTRUMENTATION 3 %% Question B-2 %% http://jonaphy.free.fr/TP_INSTRUMENTATION clear all close all %% Données %% f=[2.000 3.000 4.000 5.000 6.000 10.00 12.00 14.00 16.00 20.00]; C=[376.4 166.6 94.3 60.2 42.1 14.7 10.2 7.4 5.6 3.5]; Us=[42.97*10^-3 95.47*10^-3 163.4*10^-3 242.2*10^-3 309.4*10^-3 693.8*10^-3 875*10^-3 1.043 1.193 1.556]; Ue=10.00; k=Ue./Us; %% %% Calcul des coefficients %% n=1; pas=0.1; coef=polyfit(C,k,n) x=fix(min(C)-0.2*min(C)):pas:fix(max(C)+0.2*max(C)); y=0; mess=['Courbe y=']; for m=1:(n+1) y=y+coef(m).*x.^(n+1-m); mess=[mess,'+(',num2str(coef(m)),')x^',num2str(n+1-m)]; end %% %% Affichage de k en fonction de C %% %% et de la courbe calculée (pour vérfication) %% semilogx(C,k,'*'); hold on semilogx(x,y); legend('Points expérimentaux',mess,2) title('C (en échelle log) en fonction de k') xlabel('Capacité C (en nF)') ylabel('k') %% %% Détermination d'une valeur de la courbe %% actif=1; if (actif==1) xi=input('Valeur de capacité (nF) ? '); yi=0; for m=1:(n+1) yi=yi+coef(m).*xi.^(n+1-m); end yi end