Unable to find explicit solution on vector equation with solve
Afficher commentaires plus anciens
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 !
Réponse acceptée
Plus de réponses (1)
Walter Roberson
le 26 Fév 2026 à 18:49
Modifié(e) : Walter Roberson
le 26 Fév 2026 à 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 commentaire
Walter Roberson
le 26 Fév 2026 à 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
Catégories
En savoir plus sur Symbolic Math Toolbox dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!