Using solve command for unknown vectors

5 ビュー (過去 30 日間)
Sacha Levy
Sacha Levy 2018 年 5 月 4 日
回答済み: Sacha Levy 2018 年 5 月 5 日
Hello, I believe the problem I have is rather simple but I am new to MATLAB and I did not manage to find a solution. I think the situation can be described with the following simple example:
If I want to find the vectors whose Euclidean norm is 4, I would write :
V = sym('V', [3, 1], 'real')
solve(sqrt(dot(V, V)) == sym(4), V, 'real', true)
But I get weird results where V1 is 4 or -4 and V2 = V3 = 0... In the real problem I have, the only result I get is "unable to find a solution", and I thought there might be a link with this, as I am trying to solve a system depending on three vectors, and that it quite obviously doesn't work as I would expect...
Thank you for your help.
Regards,
Sacha Levy
  1 件のコメント
Torsten
Torsten 2018 年 5 月 4 日
You have one equation and three unknowns - thus there are infinitely many solutions (given by the sphere around 0 with radius 4).
Best wishes
Torsten.

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

採用された回答

Walter Roberson
Walter Roberson 2018 年 5 月 5 日
See https://www.mathworks.com/matlabcentral/answers/356969-solving-absolute-value-inequality about cases in which solve returns a definite number when the solution is multiple numbers.
See https://www.mathworks.com/matlabcentral/answers/318722-please-let-me-have-a-help-with-the-solve-command for a problem that can show up when solving for multiple variables and expecting a struct of solutions to be returned. I did not test to see if they have resolved that one yet.

その他の回答 (2 件)

Sacha Levy
Sacha Levy 2018 年 5 月 5 日
編集済み: Sacha Levy 2018 年 5 月 5 日
Hello, I know there are inifinitely many solutions... The problem is: why does solve only return one random solution? I would expect to give the whole set of solutions... So I there is something I should or shouldn't do to get it to work the way I expect... At some point I had a closer result to what I expect, but I had been trying for a while and written in a form that was not convenient at all. Could you please tell me what should I do to normally solve this kind of problem?
Thanks for you help
Sacha Levy

Sacha Levy
Sacha Levy 2018 年 5 月 5 日
So it seems like in the situation I described, the problem simply comes from the fact 'ReturnConditions' must be set to true...
Thank you!

製品

Community Treasure Hunt

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

Start Hunting!

Translated by