필터 지우기
필터 지우기

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