フィルターのクリア

How could I correct the "solve" function?

1 回表示 (過去 30 日間)
KIHOON RYU
KIHOON RYU 2021 年 1 月 27 日
コメント済み: Bjorn Gustavsson 2021 年 1 月 27 日
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 件のコメント
Bjorn Gustavsson
Bjorn Gustavsson 2021 年 1 月 27 日
Renormalize your equation, that is change "units", such that your solution is not so close to the finite precision smalles non-zero number.

サインインしてコメントする。

回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by