Conversion of linear equations to form Ax=b

6 ビュー (過去 30 日間)
aliza mustafa
aliza mustafa 2022 年 9 月 15 日
編集済み: Torsten 2022 年 9 月 15 日
Hello everyone,
I have the following equations:
syms t u v w x y z
intersection_a = -t + w + x == 100;
intersection_b = t - u == 100;
intersection_c = v + w - y - z == 0;
intersection_d = u + v == 40;
I can convert it to form of Ax=b using equationsToMatrix(). But my question is if I have t = 100 and w+x+y = 100, then does the equation change? Do I need to put t = 100 etc in these equations? If I will, then there will be no t in equations. How I will be able to write then it in form of Ax= b where x = [t u v w x y z] '?
Thanks in advance.

採用された回答

Sam Chak
Sam Chak 2022 年 9 月 15 日
You have only 4 equations, but there are 6 unknowns. So, the linear system is clearly rank-deficient.
syms t u v w x y z
t = 100;
intersections = [-t + w + x == 100, ...
t - u == 100, ...
v + w - y - z == 0, ...
u + v == 40];
vars = [u, v, w, x, y, z];
[A, b] = equationsToMatrix(intersections, vars)
A = 
b = 
x = linsolve(A, b)
Warning: Solution is not unique because the system is rank-deficient.
x = 
  6 件のコメント
aliza mustafa
aliza mustafa 2022 年 9 月 15 日
Thanks for sharing about solve() function. Can you please suggest me that is it alright to add w + y + z = 100 as an equation in intersections[] ?
Torsten
Torsten 2022 年 9 月 15 日
If it has to be satisfied, it has to be included. Why do you ask for this specific equation ? Is it different from the others ?

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConversion Between Symbolic and Numeric についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by