SOLVE-ONLY one solution

24 ビュー (過去 30 日間)
SYML2nd
SYML2nd 2023 年 2 月 17 日
コメント済み: Walter Roberson 2023 年 2 月 19 日
I am trying to solve a system of two equations which I know they intersect in three points. I am using this code (which I simplified)
syms x y
[x_sol,y_sol] = solve(Eqn1,Eqn);
Why it displays only the first solution and not the three solutions?
  2 件のコメント
Torsten
Torsten 2023 年 2 月 17 日
Maybe if we knew the equations and the code you use, we could give an answer.
Torsten
Torsten 2023 年 2 月 19 日
Use
[x_sol, y_sol] = vpasolve([a*exp(-b*x) == y, c*x^3 + d*x^2 + e*x + f == y], [x, y]);
instead of
[x_sol, y_sol] = solve([a*exp(-b*x) == y, c*x^3 + d*x^2 + e*x + f == y], [x, y]);

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

採用された回答

Walter Roberson
Walter Roberson 2023 年 2 月 17 日
solve() will return multiple solutions only if the equations are simultaneous multinomials -- though in some cases it is able to convert trig equations into internal polynomials.
It does not even return multiple solutions to equations involving exp() in terms of the LambertW function when those are available.
In all other cases, it will return a single closed-form solution if it can find one, and otherwise a single numeric solution.
In some cases, especially ones involving trig functions, it is able to compute parameterized additional solutions, if you request 'returnconditions', true
  2 件のコメント
SYML2nd
SYML2nd 2023 年 2 月 19 日
編集済み: SYML2nd 2023 年 2 月 19 日
I tried but it does not work. Does it exists an other method (not using 'solve' maybe) that does not have this problem?
Thanks
Walter Roberson
Walter Roberson 2023 年 2 月 19 日
You could try solving iteratively, solve one equation for one variable, substitute the result into the remaining equations, and so on. Depending on what the equations are like, you might find a step for which there are multiple solutions, in which case you can iterate over all of the possibilities, hoping that they will lead to valid solutions.
Unfortunately it does not take all that much before formulas are too complicated to make progress on.

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

その他の回答 (0 件)

カテゴリ

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

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by