Unable to find explicit solution on vector equation with solve
Show older comments
Hello !
I'm trying to solve static mechanics equations, hence implying vectors.
I tried with a simple case but Matlab is unable to find an explicit solution, though it should be solvable. It seems to me as if there is an error in the code preventing Matlab to properly spot the unknowns (which are vector components).
Here's a minimal code example, with a couple of tries with solve :
syms g mS fS real positive
syms vR_S_1 vR_S_2 vR_S_3 real
vP_S = [0; 0; -mS * g];
vR_S = [vR_S_1; vR_S_2; vR_S_3];
S1 = solve([vP_S + vR_S == zeros(3, 1); vR_S(2)^2 == vR_S(3)^2 * fS^2 - vR_S(1)^2]', [vR_S(3), vR_S(1)])
S2 = solve([vP_S + vR_S == zeros(3, 1); vR_S_2^2 == vR_S_3^2 * fS^2 - vR_S_1^2]', [vR_S_3, vR_S_1])
S3 = solve(subs([vP_S + vR_S == zeros(3, 1); vR_S_2^2 == vR_S_3^2 * fS^2 - vR_S_1^2])', [vR_S_3, vR_S_1])
Any clue about what's going on ?
Many thanks in advance !
Accepted Answer
More Answers (1)
Walter Roberson
on 26 Feb 2026 at 18:49
Edited: Walter Roberson
on 26 Feb 2026 at 18:51
S1 = solve([vP_S + vR_S == zeros(3, 1); vR_S(2)^2 == vR_S(3)^2 * fS^2 - vR_S(1)^2]', [vR_S(3), vR_S(1)])
You are trying to solve 4 equations for two variables. Most of the time that is going to fail.
1 Comment
Walter Roberson
on 26 Feb 2026 at 20:43
By the way, the ' operator is the complex conjugate operator, not simply the transpose operator which is .' . When you use it the way you are using it, you introduce extraneous solutions.
If you solve vP_S + vR_S == zeros(3, 1) for vR_S then several components come out as zero
Categories
Find more on Symbolic Math Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!