how to find specific variable values for solving equation system
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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;
0 commentaires
Réponses (1)
Torsten
le 25 Fév 2022
Modifié(e) : Torsten
le 25 Fév 2022
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 commentaires
Torsten
le 25 Fév 2022
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]
Voir également
Catégories
En savoir plus sur Systems of Nonlinear Equations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!