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

2 次查看(过去 30 天)
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?

采纳的回答

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 CenterFile Exchange 中查找有关 Stress and Strain 的更多信息

标签

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by