solving exponential equation help
2 ビュー (過去 30 日間)
古いコメントを表示
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.
0 件のコメント
回答 (1 件)
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
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
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 Center および File Exchange で Calculus についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!