solving an equation with no analytical solution

14 ビュー (過去 30 日間)
Assaf Lavi
Assaf Lavi 2016 年 3 月 2 日
コメント済み: John D'Errico 2016 年 3 月 3 日
Hi everybody, so I'm trying to solve an equation which doesn't have an analytical solution. I tried using numeric::solve but the problem is I have parameters in my equation and it says "Symbolic parameters are not allowed in nonpolynomial equations". "solve" doesn't help either.
The equation is: cos(b*x)=cos(a*b)+b*a*sin(a*b)-b*x*sin(b*a)
While a,b are constant parameters and x is the variable. I want the solution for x as a function of a and b. Is this even possible? Thanks!

採用された回答

John D'Errico
John D'Errico 2016 年 3 月 2 日
編集済み: John D'Errico 2016 年 3 月 2 日
Why do you assume that EVERY equation you might possibly write down has a solution?
There is no analytical solution for the problem you have written.
Since your problem has symbolic constants that can take on ANY values, then there also can never be a numerical solution. No numbers, no numerical solution. The two go together. If you substitute values for a and b, then of course it is possible to find a numerical solution, though still not an analytical one in general.
Sorry, but magic only works for Harry Potter, and he left town recently.
  8 件のコメント
Assaf Lavi
Assaf Lavi 2016 年 3 月 3 日
編集済み: Assaf Lavi 2016 年 3 月 3 日
Hi again! I realized my equation was not quite right and now I have a slightly simpler one with just one parameter (yay!):
cos(x)+xsin(a)=asin(a)+cos(a)
Also, I realized I'm only interested in values of -pi<a<pi. How do I do what you did but with only one parameter? I've never worked with Matlab before so I'm confused.
Thanks for all the help!
John D'Errico
John D'Errico 2016 年 3 月 3 日
ag = linspace(-pi,pi,250);
syms a x
E = cos(x)+x*sin(a) == a*sin(a)+cos(a);
xa = NaN(size(ag));
for i = 1:numel(ag)
xi = vpasolve(subs(E,a,ag(i)),x);
xa(i) = double(xi(1));
end
plot(ag,xa)
It does not seem terribly interesting though, and fairly sensitive to the value of a. There may be multiple solutions for some values of a, I only chose the first one that vpasolve found.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMathematics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by