solve system of equations imposing two variables not to be equal

조회 수: 4 (최근 30일)
Pietro Lodi Rizzini
Pietro Lodi Rizzini 2022년 12월 29일
답변: Torsten 2022년 12월 29일
syms l11 l12
syms l21 l22
syms l31 l32
syms l41 l42
syms v11 v12
syms v21 v22
eq1 = [l11; l12; 1] == C1 * [v11; v12; 1];
eq2 = [l21; l22; 1] == C1 * [v21; v22; 1];
eq3 = [l31; l32; 1] == C2 * [v11; v12; 1];
eq4 = [l41; l42; 1] == C2 * [v21; v22; 1];
res = solve([eq1, eq2, eq3, eq4], [l11, l12, l21, l22, l31, l32, l41, l42, v11, v12, v21, v22])
I am trying to solve the above system of equations, but the result always has v11 == v21 and v12 == v22. I would like to impose those values to be different. I tried to use assume() but the result turns out to be empty. Howeer, I know that a volution with v11 != v21 and v12 != v22 must exist. How can I find it?

채택된 답변

Torsten
Torsten 2022년 12월 29일
Solution is
C1 = C2 = 1
v11 = l11, v12 = l12, v21 = l21, v22 = l22
v11 = l31, v12 = l32, v21 = l41, v22 = l42
So if
l11 = l31 -> v11 = l11
l12 = l31 -> v12 = l12
l21 = l41 -> v21 = l21
l22 = l42 -> v22 = l22
If one of the conditions
l11 = l31, l12 = l31, l21 = l41, l22 = l42
is not satisfied, the system has no solution.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by