필터 지우기
필터 지우기

solving exponential equation help

조회 수: 1 (최근 30일)
sudipta
sudipta 2017년 6월 11일
편집: John D'Errico 2017년 6월 12일
exp(-pi*a/x)+exp(-pi*b/x)=1
Please help to solve the equation for obtaining x. a and b are known. Attaching value of a and b as mat file.

답변 (1개)

John D'Errico
John D'Errico 2017년 6월 11일
편집: John D'Errico 2017년 6월 11일
It did not work, because you are using the wrong tool to try to solve this, or you are using a tool in the wrong way.
Solve finds an analytical solution to an equation, or system of equations. Just because you want it to do something, does not mean the code will magically know what you want done.
You have 147 distinct values of a and b.
If you wanted to find the value of Rs that solves the problem for each pair of and b, thus producing 147 distinct results, solve cannot know this is what you wanted. A simple loop would suffice here, although more sophisticated code would do the trick too. Since the sophisticated solution would not be faster, just harder to read and understand, just use a loop.
Or, if you somehow wanted solve to produce one value for Rs that was the overall best possible solution, again, solve would not know that.
Finally, no matter which problem you are trying to solve, no analytical solution will exist, although numerical solutions will be possible.
  댓글 수: 3
Walter Roberson
Walter Roberson 2017년 6월 11일
X = sym( nan(size(a)) );
for K = 1 : numel(a)
this_solution = vpasolve( exp(-pi*a(K)/x) + exp(-pi*b(K)/x)-1), x);
if isempty(this_solution)
fprintf('No solution for a(%d)\n', K);
else
X(K) = this_solution;
end
end
John D'Errico
John D'Errico 2017년 6월 12일
편집: John D'Errico 2017년 6월 12일
Solve cannot give you an analytical solution. In fact, no analytical solution exists for most values of a and b.
vpasolve will give you a numerical solution if one does exist. Or you can use fzero.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by