Вы находитесь на странице: 1из 3

function pola2()

clear, clc, close all


h=figure(1); hold on
h2=figure(2); hold on
h3=figure(3); hold on
rep='D:\Silviu\Test_deuxieme_membrane\';
% file=[rep 'G0 Rfrence
H400\46_courbe_pola.lvm'];[Imono,Umono,U,P1,P2]=polacal(file,90);
% figure(1),plot(Imono,Umono,'.-','color','k','LineWidth',2);
% figure(2),plot(Imono(2:end),P1(2:end),'.-','color','k','LineWidth',2);
% figure(2),plot(Imono(2:end),P2(2:end),'+-','color','k','LineWidth',2);
% figure(3),plot(Imono(2:end)*2.4934*90,P1(2:end),'.','color','k','LineWidth',2);
% figure(3),plot(Imono(2:end)*0.5015*90,P2(2:end),'+','color','k','LineWidth',2);
file=[rep'MEA2_normal\19_courbe_pola_rs232.lvm'];[Imono,Umono,U,P1,P2]=polacal
(file,77);%polacal? imono,umono?
figure(1),plot(Imono,Umono,'.-','color','r','LineWidth',2);
% figure(2),plot(Imono(2:end),P1(2:end),'.-','color','r','LineWidth',2);
% figure(2),plot(Imono(2:end-5),P2(2:end-5),'+-','color','r','LineWidth',2);
% figure(3),plot(Imono(2:end)*2.4934*77,P1(2:end),'.','color','r','LineWidth',2);
% figure(3),plot(Imono(2:end-5)*0.5015*77,P2(2:end-5),'+','color','r','LineWidth',2);
% file=[rep
'MEA2_RH50\19_courbe_pola_rs232.lvm'];[Imono,Umono,U,P1,P2]=polacal(file,77);
% figure(1),plot(Imono,Umono,'.-','color','b','LineWidth',2);
file=[rep 'G1Mardi nouvelle
membrane\20_courbe_pola_rs232.lvm'];[Imono,Umono,U,P1,P2]=polacal(file,77);
figure(1),plot(Imono,Umono,'.-','color','g','LineWidth',2);
file=[rep 'G1Mercredi nouvelle membrane
seche\21_courbe_pola_rs232.lvm'];[Imono,Umono,U,P1,P2]=polacal(file,77);
figure(1),plot(Imono,Umono,'.-','color','b','LineWidth',2);
%
file=[rep
'G1_2014_03_17\21_courbe_pola_rs232.lvm'];[Imono,Umono,U,P1,P2]=polacal(file,7
7);
figure(1),plot(Imono,Umono,'.-','color','k','LineWidth',2);
% %
% file=[rep
'G1Lundi\20_courbe_pola_rs232.lvm'];[Imono,Umono,U,P1,P2]=polacal(file,77);
% figure(1),plot(Imono,Umono,'.-','color','y','LineWidth',2);
%
% file=[rep
'MEA2_normal_fin\19_courbe_pola_rs232.lvm'];[Imono,Umono,U,P1,P2]=polacal(file
,77);
% figure(1),plot(Imono,Umono,'+-','color','r','LineWidth',2);
%
% file=[rep
'MEA2_retour_normal\19_courbe_pola_rs232.lvm'];[Imono,Umono,U,P1,P2]=polacal(f
ile,77);
% figure(1),plot(Imono,Umono,'*-','color','r','LineWidth',2);

%
% file=[rep
'MEA3_ini\19_courbe_pola_rs232.lvm'];[Imono,Umono,U,P1,P2]=polacal(file,77);
% figure(1),plot(Imono,Umono,'.--','color','k','LineWidth',2);
title('Polarization curves')
ylabel('Cell voltage (V)','FontSize',12);xlabel('Current
(A/cm)','FontSize',12);
set(gca,'XLim',[0 1.3],'YLim',[0.5 1],'FontSize',12,'LineWidth',2);
box on
% L(1)=cellstr('G0 rfrence H400');
L(1)=cellstr('G1 H400 H2-100%');
% L(3)=cellstr('G1 H400 H2-100% H2-Invers');
% L(2)=cellstr('G1 normal ');
L(2)=cellstr('G1 nouvelle membrane normal');
L(3)=cellstr('G1 nouvelle membrane seche');
L(4)=cellstr('G1 nouvelle membrane normal 1');
% L(8)=cellstr('G1 H400 H2-100% Fin');
% L(9)=cellstr('G1 H400 H2-100% Retour');
% L(10)=cellstr('G1 H400 H2-100% MEA3');
legend(L)
saveas(h,[rep 'pola.emf'],'emf')

% figure(2)
% L2(1)=cellstr('G0 Cathode');
% L2(2)=cellstr('G0 Anode');
% L2(3)=cellstr('G1 Cathode');
% L2(4)=cellstr('G1 Anode');
% legend(L2,4)
% title('Pressure drop')
% ylabel('Pressure drop (mBar)','FontSize',12);xlabel('Current
(A/cm)','FontSize',12);
% saveas(h2,[rep 'pertes de charge.emf'],'emf')
%
% figure(3)
% legend(L2,4)
% title('Pressure drop')
% ylabel('Pressure drop (mBar)','FontSize',12);xlabel('Flow rate Air/H2
(Nl/h)','FontSize',12);
% saveas(h3,[rep 'pertes de charge2.emf'],'emf')
end
function [Imonod,Umonod, U0_5, P1mono, P2mono]=polacal(file_name,S)
Data=dlmread(file_name,'\t',23,0);
d_pts=diff(Data(:,26))~=0;%j ai pas compris qu'est qu'il fait
% plot(d_pts)
% whos
% pause
vect0=find(d_pts==1);
vect=[1;vect0;max(size(Data))];
U=zeros(1,max(size(vect))-1);I=U;
for j=1:max(size(vect))-1
Timev=Data(vect(j):vect(j+1),1);
P1v=Data(vect(j):vect(j+1),2);

P2v=Data(vect(j):vect(j+1),3);
Uv=Data(vect(j):vect(j+1),4);
Iv=Data(vect(j):vect(j+1),5);
t_mean=round(length(Timev)/2);
U(j)=mean(Uv(t_mean:end));
I(j)=mean(Iv(t_mean:end));
P1(j)=mean(P1v(t_mean:end));
P2(j)=mean(P2v(t_mean:end));
end
nb_diff_palier=floor((max(size(vect))-1)/2);
Umonod=(U(1:nb_diff_palier)+U(end:-1:nb_diff_palier+1))/2;
Imonod=(I(1:nb_diff_palier)+I(end:-1:nb_diff_palier+1))/2/S;
P1mono=(P1(1:nb_diff_palier)+P1(end:-1:nb_diff_palier+1))/2;
P2mono=(P2(1:nb_diff_palier)+P2(end:-1:nb_diff_palier+1))/2;
pval=polyfit(Imonod(8:9),Umonod(8:9),1);
U0_5=round(100*(pval(1)*0.5+pval(2)))/100;
if Imonod(9)<0.5
U0_5=0;
end
clear U I
end

Вам также может понравиться