solving exponential equation help

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.

Réponses (1)

John D'Errico
John D'Errico le 11 Juin 2017
Modifié(e) : John D'Errico le 11 Juin 2017

0 votes

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 commentaires

sudipta
sudipta le 11 Juin 2017
Modifié(e) : Walter Roberson le 11 Juin 2017
solve((exp(-pi*a/x)+exp(-pi*b/x)-1), x)
will not work for one value of a and b? Then which command to use? Can you help me out, please?
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 le 12 Juin 2017
Modifié(e) : John D'Errico le 12 Juin 2017
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.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Numerical Integration and Differential Equations dans Centre d'aide et File Exchange

Question posée :

le 11 Juin 2017

Modifié(e) :

le 12 Juin 2017

Community Treasure Hunt

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

Start Hunting!

Translated by