Trying to understand why my graphs are all flipped
My ohmic overpotential curve, concentration overpotential curve and cell j-v curve are suppose to be flipped meaning my voltage is meant to decrease when my current density increases (negative gradient)
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.0e-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(j/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(j/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(j,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 = j .* R_in;%ohmic overpotential of cell
display(V_ohm)
%J-V curve
figure
plot(j,V_ohm)
title(‘J-V ohmic curve’)
xlabel(‘Current density’)
ylabel(‘Ohmic overpotential’)
%————————————————————————–
%Determining glucose concentration
%Anode
J_diff_anode = j/(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 = j/(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));
%concentration overpotential at cathode
V_conc_cathode = (R*T)/(n_cathode*F)*log(i_L_c./(i_L_c-j));
%concentration overpotential
V_conc =V_conc_cathode + V_conc_anode;
%J-V curve
figure
plot(j,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(j,V_cell)
title(‘J-V curve’)
xlabel(‘Current density’)
ylabel(‘Cell voltage’)My ohmic overpotential curve, concentration overpotential curve and cell j-v curve are suppose to be flipped meaning my voltage is meant to decrease when my current density increases (negative gradient)
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.0e-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(j/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(j/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(j,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 = j .* R_in;%ohmic overpotential of cell
display(V_ohm)
%J-V curve
figure
plot(j,V_ohm)
title(‘J-V ohmic curve’)
xlabel(‘Current density’)
ylabel(‘Ohmic overpotential’)
%————————————————————————–
%Determining glucose concentration
%Anode
J_diff_anode = j/(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 = j/(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));
%concentration overpotential at cathode
V_conc_cathode = (R*T)/(n_cathode*F)*log(i_L_c./(i_L_c-j));
%concentration overpotential
V_conc =V_conc_cathode + V_conc_anode;
%J-V curve
figure
plot(j,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(j,V_cell)
title(‘J-V curve’)
xlabel(‘Current density’)
ylabel(‘Cell voltage’) My ohmic overpotential curve, concentration overpotential curve and cell j-v curve are suppose to be flipped meaning my voltage is meant to decrease when my current density increases (negative gradient)
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.0e-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(j/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(j/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(j,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 = j .* R_in;%ohmic overpotential of cell
display(V_ohm)
%J-V curve
figure
plot(j,V_ohm)
title(‘J-V ohmic curve’)
xlabel(‘Current density’)
ylabel(‘Ohmic overpotential’)
%————————————————————————–
%Determining glucose concentration
%Anode
J_diff_anode = j/(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 = j/(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));
%concentration overpotential at cathode
V_conc_cathode = (R*T)/(n_cathode*F)*log(i_L_c./(i_L_c-j));
%concentration overpotential
V_conc =V_conc_cathode + V_conc_anode;
%J-V curve
figure
plot(j,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(j,V_cell)
title(‘J-V curve’)
xlabel(‘Current density’)
ylabel(‘Cell voltage’) matlab, fuelcell MATLAB Answers — New Questions