Borrar filtros
Borrar filtros

How could I correct the "solve" function?

1 visualización (últimos 30 días)
KIHOON RYU
KIHOON RYU el 27 de En. de 2021
Comentada: Bjorn Gustavsson el 27 de En. de 2021
I want to get the answer with solve function.
if I use while loop below, MATLAB returns the empty syms 0-by-1.
E = 6.00;
syms x;
%% all the variables value is assigned %%
while E >= 2.00
eq = E == E_eq + (R*T)/F*log((1-x)/x) + (R*T)/F*g*(0.5 - x);
theta = vpasolve(eq,x, [-inf inf]);
data_plot = [data_plot; E, theta];
E = E - 0.01;
end
on the other hands,
if I use this loop, it shows the answer but only in a tiny range.
while E >= 2.00
eq = E == E_eq + (R*T)/F*log((1-x)/x); %% I just delete the "(R*T)/F*g*(0.5 - x)" term.
theta = vpasolve(eq,x, [-inf inf]);
data_plot = [data_plot; E, theta];
E = E - 0.01;
end
when I calculate same function with wolfram alpha, it shows the answer around 3E-34.
is there any way to get the answer under the value 1E-35?
or, do I wrong with using solve function?
  1 comentario
Bjorn Gustavsson
Bjorn Gustavsson el 27 de En. de 2021
Renormalize your equation, that is change "units", such that your solution is not so close to the finite precision smalles non-zero number.

Iniciar sesión para comentar.

Respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by