필터 지우기
필터 지우기

how to find specific variable values for solving equation system

조회 수: 3 (최근 30일)
fima v
fima v 2022년 2월 25일
댓글: Torsten 2022년 2월 25일
Hello,i have the following equation system.
is there a way in matlab to find P1..P6 values so
pr(2)=pr(1)+5
pr(3)=pr(2)+5
etc..
x1=10;
pr(1)=x1-p1-p5-p6;
pr(2)=x1+p1-p5-p6;
pr(3)=x1-p2+p5-p6;
pr(4)=x1+p2+p5-p6;
pr(5)=x1-p3+p6;
pr(6)=x1-p4+p3+p6;
pr(7)=x1+p4+p3+p6;

답변 (1개)

Torsten
Torsten 2022년 2월 25일
편집: Torsten 2022년 2월 25일
Yes.
You have 13 linear equations for 13 unknowns P = [pr(1),...,pr(7),p1,...,p6].
Write the system as
A*P = B
and solve for P as
P = A\B
In your case:
x1 = 10;
A = [1 0 0 0 0 0 0 1 0 0 0 1 1;...
0 1 0 0 0 0 0 -1 0 0 0 1 1;...
0 0 1 0 0 0 0 0 1 0 0 -1 1;...
0 0 0 1 0 0 0 0 -1 0 0 -1 1;...
0 0 0 0 1 0 0 0 0 1 0 0 -1;...
0 0 0 0 0 1 0 0 0 -1 1 0 -1;...
0 0 0 0 0 0 1 0 0 -1 -1 0 -1;...
-1 1 0 0 0 0 0 0 0 0 0 0 0;...
0 -1 1 0 0 0 0 0 0 0 0 0 0;...
0 0 -1 1 0 0 0 0 0 0 0 0 0;...
0 0 0 -1 1 0 0 0 0 0 0 0 0;...
0 0 0 0 -1 1 0 0 0 0 0 0 0;...
0 0 0 0 0 -1 1 0 0 0 0 0 0];
B = [x1 ; x1 ; x1 ; x1 ; x1 ; x1; x1 ; 5 ; 5 ; 5 ; 5 ; 5 ; 5];
P = A\B
  댓글 수: 2
fima v
fima v 2022년 2월 25일
Hello i need d1 d2 d3 d4 d5 d6 to be 5
how do i formulate the matrices method you proposed?
so i get p1 p3 p6 p4 such values that will do d1..d6=5
x1=10;
p1=2.5;
p5=5;
p6=10;
p3=3.75;
p4=+2.5;
pr(1)=x1-p1-p5-p6;
pr(2)=x1+p1-p5-p6;
pr(3)=x1-p1+p5-p6;
pr(4)=x1+p1+p5-p6;
pr(5)=x1-p3+p6;
pr(6)=x1-p4+p3+p6;
pr(7)=x1+p4+p3+p6;
d1=pr(2)-pr(1)
d2=pr(3)-pr(2)
d3=pr(4)-pr(3)
d4=pr(5)-pr(4)
d5=pr(6)-pr(5)
d6=pr(7)-pr(6)
Torsten
Torsten 2022년 2월 25일
I already defined the matrix equation above and determined the solution vector
P = [pr(1);pr(2);pr(3);pr(4);pr(5);pr(6);pr(7);p1;p2;p3;p4;p5;p6]

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Dynamic System Models에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by