How to make solve stop when a non-trivial solution is first found

4 ビュー (過去 30 日間)
Tommi Muller
Tommi Muller 2020 年 6 月 1 日
回答済み: Abhisek Pradhan 2020 年 6 月 5 日
I have a system of quadratic equations I would like to solve, something like below:
syms q11 q12 q13 q21 q22 q23 q31 q32 q33
[q11_sol, q12_sol, q13_sol, q21_sol, q22_sol, q23_sol, q31_sol, q32_sol, q33_sol] = ...
solve(...
q11*q22 == q12*q21*((T(1,1)*T(2,2))/(T(2,1)*T(1,2))), ...
q22*q33 == q23*q32*((T(2,2)*T(3,3))/(T(3,2)*T(2,3))), ...
q11*q33 == q13*q31*((T(1,1)*T(3,3))/(T(3,1)*T(1,3))), ...
q31^2 + q32^2 + q33^2 == 1, ...
q21^2 + q22^2 + q23^2 == 1, ...
q11^2 + q12^2 + q13^2 == 1, ...
q21*q31 + q22*q32 + q23*q33 == 0, ...
q11*q31 + q12*q32 + q13*q33 == 0, ...
q11*q21 + q12*q22 + q13*q23 == 0);
where T is some matrix I defined.
My issue is that solving this system takes a long time, and I just want one non-trivial solution (just one solution that doesn't have 0's or 1's or -1's in it).
Is there a way for me to tell the solve function to stop when a non-trivial solution is first found?
  2 件のコメント
Star Strider
Star Strider 2020 年 6 月 1 日
Unrecognized function or variable 'T'.
Tommi Muller
Tommi Muller 2020 年 6 月 1 日
I mentioned that T is some predefined 3x3 matrix, but let's say for example that:
T = [-2/15, 8, 4; 2/5, -6, 6; -1/30, -1, 1/4];

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

採用された回答

Abhisek Pradhan
Abhisek Pradhan 2020 年 6 月 5 日
solve by default returns one of the many solutions. Now the problem lies in getting a solution which is not trivial. the following, link may help in working with full solution.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStress and Strain についてさらに検索

タグ

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by