50 views (last 30 days)

Trying to solve a system of non-linear equations, but I get the above error message.

Here is my code:

clear all

syms h_1 h_2 h_3 h_4 h_5 h_6 l m_1 m_2 m_3 m_4 m_5 m_6

eq1 = h_6*m_1*m_6+2*h_5*m_1*m_5+h_4*m_1*m_4-2*h_6*(m_3)^2-4*h_5*m_2*m_3-2*h_3*m_1*m_3-2*h_4*(m_2)^2-2*h_2*m_1*m_2-h_1*m_1^2+(h_4*h_6-(h_5)^2)*l == 0;

eq2 = 2*h_6*m_2*m_6-4*h_6*m_3*m_5-4*h_4*m_1*m_5-4*h_5*m_3*m_4-2*h_4*m_2*m_4-4*h_2*m_1*m_4-2*h_1*m_1*m_2+(2*h_3*h_5-2*h_2*h_6)*l == 0;

eq3 = -2*h_6*m_3*m_6-4*h_5*m_2*m_6-4*h_3*m_1*m_6-4*h_4*m_2*m_5-4*h_2*m_1*m_5+2*h_4*m_3*m_4-2*h_1*m_1*m_3+(2*h_2*h_5-2*h_3*h_4)*l == 0;

eq4 = h_6*m_4*m_6-2*h_6*m_5^2-2*h_5*m_4*m_5-4*h_3*m_2*m_5-h_4*m_4^2+2*h_3*m_3*m_4-2*h_2*m_2*m_4+h_1*m_1*m_4-2*h_1*m_2^2+(h_1*h_6-h_3^2)*l == 0;

eq5 = -2*h_6*m_5*m_6-4*h_5*m_4*m_6-4*h_3*m_2*m_6-2*h_4*m_4*m_5+2*h_1*m_1*m_5-4*h_2*m_3*m_4-4*h_1*m_2*m_3+(2*h_2*h_3-2*h_1*h_5)*l == 0;

eq6 = -h_6*m_6^2-2*h_5*m_5*m_6+h_4*m_4*m_6-2*h_4*m_3*m_6+2*h_2*m_2*m_6+h_1*m_1*m_6-2*h_4*m_5^2-4*h_2*m_3*m_5-2*h_1*m_3^2+(h_1*h_4-h_2^2)*l == 0;

eq7 = h_1*h_4*h_6-h_2^2*h_6-h_1*h_5^2+2*h_2*h_3*h_5-h_3^2*h_4-1 == 0;

sols = solve([eq1,eq2,eq3,eq4,eq5,eq6,eq7],[h_1, h_2, h_3, h_4, h_5, h_6, l], 'returnconditions', true)

The m_i are known and I need the solution in terms of the m_i. I know there is a solution but I need to confirm as I cannot solve this by hand.

Is this to hard to solve or is my code wrong? Thanks for any help

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

Start Hunting!
## 3 Comments

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/717930-warning-unable-to-find-explicit-solution-for-options-see-help#comment_1265280

⋮## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/717930-warning-unable-to-find-explicit-solution-for-options-see-help#comment_1265280

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/717930-warning-unable-to-find-explicit-solution-for-options-see-help#comment_1265300

⋮## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/717930-warning-unable-to-find-explicit-solution-for-options-see-help#comment_1265300

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/717930-warning-unable-to-find-explicit-solution-for-options-see-help#comment_1266445

⋮## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/717930-warning-unable-to-find-explicit-solution-for-options-see-help#comment_1266445

Sign in to comment.