Starting my x-axis values not from zero
21 views (last 30 days)
Show older comments
Trying to start x-axis which is my current density(j) values from the value 7e-3. Can anyone help out with this.
clc;
clear;
%Variables
m=15;
k = 15;
a_anode = 0.54; %transfer coefficient at anode
a_cathode = 0.52; %transfer coeffiecent at cathode
R = 8.314;%Gas constant
F = 96485;%Faraday constant
T = 300; %Temperature of cell
A_electrodes = 2; %area of electrodes
R_in = A_electrodes*2.5; %Internal resistance of the cell
n_anode = 2; %moles per reactant at the anode
n_cathode =4;%moles per reactant at the cathode
D_anode = 2.4e-6; %diffusion coefficient of glucose in bird
D_cathode = 1.8e-5;%diffusion coefficient of oxygen in bird
d_l_a = 0.005; %diffsuion layer thickness anode
d_l_c= 0.005 ;%diffsuion layer thickness cathode
j = linspace(0.005e-3,0.7e-3,k);%Current density of the cell
jT = j';
C_s_anode = 5.55e-8; %concentration of reactant at the catalyst
C_s_cathode = 1.71e-8; %concentration of reactant at the catalyst
A_anode = 2; %active area of electrode
A_cathode = 2; %active area of electrode
row = 0.005; %diffusion distance
e = 0.4;%porosity of the structure
D_ij_anode = 9.5e-6; %binary diffusion coefficient(glucose in human dura mater)
D_ij_cathode = 1.8e-5;%Diffsuion coefficent of oxyegen in plain medium
i_ref_a = 3.5e-3; %anode reference exchange current density
L_anode = 0.3; %catalyst loading anode
P_anode = 2130; %Pressure at anode
P_ref_anode = 1.2; %reference pressure at the anode
T_ref_anode = 298; %reference temperature at anode
i_ref_c = 1.95e5; %anode reference exchange current density
L_cathode = 0.3; %catalyst loading anode
P_cathode = 50; %Pressure at anode
P_ref_cathode = 700; %reference pressure at the anode
T_ref_cathode = 298; %reference temperature at anode
%%
%Effective exchange current density
%Anode
i0_a = i_ref_a * A_anode * L_anode *(P_anode/P_ref_anode)^0.5 *(-(130/R*T)*(1-(T/T_ref_anode)));
%Cathode
i0_c = i_ref_c * A_cathode * L_cathode *(P_cathode/P_ref_cathode)^1 *(-(66/R*T)*(1-(T/T_ref_cathode)));
%%
%Activation Overpotential
%Anode
V_act_a = (R*T)/(a_anode*n_anode*F)*log(jT/i0_a);%activation potential at anode
V_act_anode = abs(V_act_a);
display(V_act_anode)
%Cathode
V_act_c = (R*T)/(a_cathode*n_cathode*F)*log(jT/i0_c);%activation potential at cathode
V_act_cathode = abs(V_act_c);
display(V_act_cathode)
%Total activation overpotential
V_act = V_act_cathode + V_act_anode;
display(V_act)
%J-V curve
figure
plot(jT,V_act)
title('J-V Vact curve')
xlabel('Current density')
ylabel('Activation overpotential')
%%
%Ohmic overpotential
%R_cell_anode = Rin .* A_anode; %resisitance of fuel cell
%R_cell_cathode = Rin .* A_cathode; %resisitance of fuel cell
%R_cell = R_cell_anode + R_cell_cathode;
V_ohm = jT .* (R_in);%ohmic overpotential of cell
display(V_ohm)
%J-V curve
figure
plot(jT,V_ohm)
title('J-V ohmic curve')
xlabel('Current density')
ylabel('Ohmic overpotential')
%%
%Determining glucose concentration
%Anode
J_diff_anode = jT/(n_anode*F);%diffusion flux of reactants
display(J_diff_anode)
D_eff_anode = (e^1.5) * D_ij_anode;%effective reactant diffusivity
display(D_eff_anode)
C_b_anode = -((J_diff_anode*row)/-D_eff_anode)+ C_s_anode;
C_b_anodeT = C_b_anode';
Glucose_conc = (C_b_anodeT * 180.156)*100000;
%Cathode
J_diff_cathode = jT/(n_cathode*F);%diffusion flux of reactants
display(J_diff_cathode)
D_eff_cathode = (e^1.5) * D_ij_cathode;%effective reactant diffusivity
display(D_eff_cathode)
C_b_cathode = -((J_diff_cathode*row)/-D_eff_cathode)+ C_s_cathode;
%bulk concentration of reactant(oxygen)
display(C_b_cathode)
%%
%Concentration overpotential
%limiting current at anode
i_L_a = (n_anode*F*D_eff_anode*(C_b_anode/d_l_a));
%limiting current at cathode
i_L_c = (n_cathode*F*D_eff_cathode*(C_b_cathode/d_l_c));
%concentration overpotential at anode
%V_conc_anode = (R*T)/(n_anode*F)*log(i_L_a./(i_L_a-j));
V_conc_anode = (R*T)/(n_anode*F)*log(C_b_anode/C_s_anode);
%concentration overpotential at cathode
%V_conc_cathode = (R*T)/(n_cathode*F)*log(i_L_c./(i_L_c-j));
V_conc_cathode = (R*T)/(n_cathode*F)*log(C_b_cathode/C_s_cathode);
%c_anode = (R*T)/(n_anode*F)*log(1/1+a_anode);
%c_cathode = (R*T)/(n_cathode*F)*log(1/1+a_cathode);
%V_conc_anode = c_anode .*log(i_L_a./i_L_a-j);
%V_conc_cathode = c_cathode .*log(i_L_c./i_L_c-j);
%concentration overpotential
V_conc = V_conc_cathode + V_conc_anode;
%J-V curve
figure
plot(jT,V_conc)
title('J-V Vconc curve')
xlabel('Current density')
ylabel('Cocnetration overpotential')
%%
%Cell potential
Et =1.3; %thermodynamic potential of fuel cell
%Fuel cell voltage
V_cell1 = Et - V_act - V_conc - V_ohm;
V_cell = abs(V_cell1);
%%
%Power of fuel cell
P_cell = V_cell .* j;
P_cell1 = abs(P_cell);
%%
%J-V curve
figure
plot(jT,V_cell)
title('J-V curve')
xlabel('Current density')
ylabel('Cell voltage')
0 Comments
Answers (2)
Simon Chan
on 16 Mar 2022
Modify like the following for each plot.
figure
h = plot(jT,V_cell); % Get the data (Modify)
ax=gca; % Get the handle (Modify)
title('J-V curve')
xlabel('Current density')
ylabel('Cell voltage')
ax.XTick(1) = h.XData(1); % <--- Add this line
0 Comments
Star Strider
on 16 Mar 2022
‘Trying to start x-axis which is my current density(j) values from the value 7e-3. Can anyone help out with this.’
Probably not, at least not without some clarification. The independent variable is defined as the transpose of ‘j’, defined here as:
j = linspace(0.005e-3,0.7e-3,k);%Current density of the cell
so ‘7e-3’ is outside the xlim range, and ‘7e-4’ is the upper end of the range.
Please clarify what you want to do.
%Variables
m=15;
k = 15;
a_anode = 0.54; %transfer coefficient at anode
a_cathode = 0.52; %transfer coeffiecent at cathode
R = 8.314;%Gas constant
F = 96485;%Faraday constant
T = 300; %Temperature of cell
A_electrodes = 2; %area of electrodes
R_in = A_electrodes*2.5; %Internal resistance of the cell
n_anode = 2; %moles per reactant at the anode
n_cathode =4;%moles per reactant at the cathode
D_anode = 2.4e-6; %diffusion coefficient of glucose in bird
D_cathode = 1.8e-5;%diffusion coefficient of oxygen in bird
d_l_a = 0.005; %diffsuion layer thickness anode
d_l_c= 0.005 ;%diffsuion layer thickness cathode
j = linspace(0.005e-3,0.7e-3,k);%Current density of the cell
jT = j';
C_s_anode = 5.55e-8; %concentration of reactant at the catalyst
C_s_cathode = 1.71e-8; %concentration of reactant at the catalyst
A_anode = 2; %active area of electrode
A_cathode = 2; %active area of electrode
row = 0.005; %diffusion distance
e = 0.4;%porosity of the structure
D_ij_anode = 9.5e-6; %binary diffusion coefficient(glucose in human dura mater)
D_ij_cathode = 1.8e-5;%Diffsuion coefficent of oxyegen in plain medium
i_ref_a = 3.5e-3; %anode reference exchange current density
L_anode = 0.3; %catalyst loading anode
P_anode = 2130; %Pressure at anode
P_ref_anode = 1.2; %reference pressure at the anode
T_ref_anode = 298; %reference temperature at anode
i_ref_c = 1.95e5; %anode reference exchange current density
L_cathode = 0.3; %catalyst loading anode
P_cathode = 50; %Pressure at anode
P_ref_cathode = 700; %reference pressure at the anode
T_ref_cathode = 298; %reference temperature at anode
%%
%Effective exchange current density
%Anode
i0_a = i_ref_a * A_anode * L_anode *(P_anode/P_ref_anode)^0.5 *(-(130/R*T)*(1-(T/T_ref_anode)));
%Cathode
i0_c = i_ref_c * A_cathode * L_cathode *(P_cathode/P_ref_cathode)^1 *(-(66/R*T)*(1-(T/T_ref_cathode)));
%%
%Activation Overpotential
%Anode
V_act_a = (R*T)/(a_anode*n_anode*F)*log(jT/i0_a);%activation potential at anode
V_act_anode = abs(V_act_a);
display(V_act_anode)
%Cathode
V_act_c = (R*T)/(a_cathode*n_cathode*F)*log(jT/i0_c);%activation potential at cathode
V_act_cathode = abs(V_act_c);
display(V_act_cathode)
%Total activation overpotential
V_act = V_act_cathode + V_act_anode;
display(V_act)
%J-V curve
figure
plot(jT,V_act)
title('J-V Vact curve')
xlabel('Current density')
ylabel('Activation overpotential')
% xlim([7E-3 max(xlim)])
%%
%Ohmic overpotential
%R_cell_anode = Rin .* A_anode; %resisitance of fuel cell
%R_cell_cathode = Rin .* A_cathode; %resisitance of fuel cell
%R_cell = R_cell_anode + R_cell_cathode;
V_ohm = jT .* (R_in);%ohmic overpotential of cell
display(V_ohm)
%J-V curve
figure
plot(jT,V_ohm)
title('J-V ohmic curve')
xlabel('Current density')
ylabel('Ohmic overpotential')
%%
%Determining glucose concentration
%Anode
J_diff_anode = jT/(n_anode*F);%diffusion flux of reactants
display(J_diff_anode)
D_eff_anode = (e^1.5) * D_ij_anode;%effective reactant diffusivity
display(D_eff_anode)
C_b_anode = -((J_diff_anode*row)/-D_eff_anode)+ C_s_anode;
C_b_anodeT = C_b_anode';
Glucose_conc = (C_b_anodeT * 180.156)*100000;
%Cathode
J_diff_cathode = jT/(n_cathode*F);%diffusion flux of reactants
display(J_diff_cathode)
D_eff_cathode = (e^1.5) * D_ij_cathode;%effective reactant diffusivity
display(D_eff_cathode)
C_b_cathode = -((J_diff_cathode*row)/-D_eff_cathode)+ C_s_cathode;
%bulk concentration of reactant(oxygen)
display(C_b_cathode)
%%
%Concentration overpotential
%limiting current at anode
i_L_a = (n_anode*F*D_eff_anode*(C_b_anode/d_l_a));
%limiting current at cathode
i_L_c = (n_cathode*F*D_eff_cathode*(C_b_cathode/d_l_c));
%concentration overpotential at anode
%V_conc_anode = (R*T)/(n_anode*F)*log(i_L_a./(i_L_a-j));
V_conc_anode = (R*T)/(n_anode*F)*log(C_b_anode/C_s_anode);
%concentration overpotential at cathode
%V_conc_cathode = (R*T)/(n_cathode*F)*log(i_L_c./(i_L_c-j));
V_conc_cathode = (R*T)/(n_cathode*F)*log(C_b_cathode/C_s_cathode);
%c_anode = (R*T)/(n_anode*F)*log(1/1+a_anode);
%c_cathode = (R*T)/(n_cathode*F)*log(1/1+a_cathode);
%V_conc_anode = c_anode .*log(i_L_a./i_L_a-j);
%V_conc_cathode = c_cathode .*log(i_L_c./i_L_c-j);
%concentration overpotential
V_conc = V_conc_cathode + V_conc_anode;
%J-V curve
figure
plot(jT,V_conc)
title('J-V Vconc curve')
xlabel('Current density')
ylabel('Cocnetration overpotential')
%%
%Cell potential
Et =1.3; %thermodynamic potential of fuel cell
%Fuel cell voltage
V_cell1 = Et - V_act - V_conc - V_ohm;
V_cell = abs(V_cell1);
%%
%Power of fuel cell
P_cell = V_cell .* j;
P_cell1 = abs(P_cell);
%%
%J-V curve
figure
plot(jT,V_cell)
title('J-V curve')
xlabel('Current density')
ylabel('Cell voltage')
.
5 Comments
See Also
Categories
Find more on Engines & Motors in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!