Trying to understand why my graphs are all flipped

4 次查看(过去 30 天)
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)
V_act_anode = 1×15
Inf 0.2616 0.2450 0.2353 0.2284 0.2230 0.2187 0.2150 0.2118 0.2090 0.2065 0.2042 0.2021 0.2002 0.1984
%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)
V_act_cathode = 1×15
Inf 0.2698 0.2612 0.2561 0.2525 0.2498 0.2475 0.2456 0.2439 0.2425 0.2411 0.2400 0.2389 0.2379 0.2370
%Total activation overpotential
V_act = V_act_cathode + V_act_anode;
display(V_act)
V_act = 1×15
Inf 0.5313 0.5061 0.4914 0.4809 0.4728 0.4662 0.4606 0.4557 0.4514 0.4476 0.4441 0.4410 0.4381 0.4354
%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)
V_ohm = 1×15
0 0.0003 0.0005 0.0007 0.0010 0.0013 0.0015 0.0018 0.0020 0.0022 0.0025 0.0028 0.0030 0.0033 0.0035
%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)
J_diff_anode = 1×15
1.0e-08 * 0 0.0259 0.0518 0.0777 0.1036 0.1296 0.1555 0.1814 0.2073 0.2332 0.2591 0.2850 0.3109 0.3368 0.3628
D_eff_anode = (e^1.5) * D_ij_anode;%effective reactant diffusivity
display(D_eff_anode)
D_eff_anode = 2.4033e-06
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)
J_diff_cathode = 1×15
1.0e-08 * 0 0.0130 0.0259 0.0389 0.0518 0.0648 0.0777 0.0907 0.1036 0.1166 0.1296 0.1425 0.1555 0.1684 0.1814
D_eff_cathode = (e^1.5) * D_ij_cathode;%effective reactant diffusivity
display(D_eff_cathode)
D_eff_cathode = 4.5537e-06
C_b_cathode = -((J_diff_cathode*row)/-D_eff_cathode)+ C_s_cathode;
%bulk concentration of reactant(oxygen)
display(C_b_cathode)
C_b_cathode = 1×15
1.0e-05 * 0.0017 0.0159 0.0302 0.0444 0.0586 0.0728 0.0871 0.1013 0.1155 0.1297 0.1440 0.1582 0.1724 0.1866 0.2009
%--------------------------------------------------------------------------
%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')
  1 个评论
Khilmi
Khilmi 2024-8-26
hi have you found the solution?
If so, would you like to share the solution with me, because I am experiencing the same problem as you. all my graphs are upside down and I don't understand how to solve it. I am very grateful for your answer. Thanks!

请先登录,再进行评论。

回答(2 个)

vidyesh
vidyesh 2023-10-19
编辑:vidyesh 2023-11-29
Hi Nathaniel,
Based on my understanding, you would like to know why your graphs are increasing when plotted instead of decreasing.
The relationship between Ohmic Potential and Current Density in the code is linear.
V_ohm = j .* R_in;
R_in' is a constant and 'V_ohmic' is the product of 'j' and a constant value. Consequently, Ohmic Potential naturally increases as Current Density increases.
On the other hand, the relationships between Concentration Overpotential and Current Density, as well as Cell Voltage and Current Density, are not linear. However, both of these relationships are directly proportional to Current Density, as indicated by the formulas used in the code.
To ensure accurate calculations, it is recommended to verify the correctness of the equations employed in the code.
Hope this answer helps.

Image Analyst
Image Analyst 2024-8-26
Maybe try
axis ij
or
axis xy
until the graph is in the orientation you want.

类别

Help CenterFile Exchange 中查找有关 Engines & Motors 的更多信息

产品


版本

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by