Warning: Solution does not exist because the system is inconsistent.

17 visualizaciones (últimos 30 días)
I'm not sure whats wrong with my code here, but it wont solve the system of equations. Maybe I'm missing something.
w1 = 0.05*pi;
w2 = 0.1*pi;
w3 = 0.2*pi;
syms b1 b2 b3
Bw1 = 2*b1*cos(2*w1)+2*b2*cos(2*w1)+b3 == 0;
Bw2 = 2*b1*cos(2*w2)+2*b2*cos(2*w2)+b3 == 1;
Bw3 = 2*b1*cos(2*w3)+2*b2*cos(2*w3)+b3 == 0;
[A,B] = equationsToMatrix([Bw1, Bw2, Bw3], [b1, b2, b3]);
X = linsolve(A,B);
  1 comentario
Daniel Pollard
Daniel Pollard el 11 de Feb. de 2021
I've not used the symbolic toolbox, but I'd have a guess that if it says "the system is inconistent" and won't solve your system of equations, I'd have a guess that perhaps your equations aren't consistent with each other.

Iniciar sesión para comentar.

Respuesta aceptada

Bjorn Gustavsson
Bjorn Gustavsson el 11 de Feb. de 2021
Editada: Bjorn Gustavsson el 11 de Feb. de 2021
Have a look at the equations. If you rewrite them you will get:
Bw1 = ( b1 + b2 ) * 2*cos(2*w1) + b3 == 0;
Bw2 = ( b1 + b2 ) * 2*cos(2*w2) + b3 == 1;
Bw3 = ( b1 + b2 ) * 2*cos(2*w3) + b3 == 0;
That will explicitly show you that you can only solve for b3 and the sum of b2 and b1.
HTH

Más respuestas (0)

Categorías

Más información sobre Mathematics en Help Center y File Exchange.

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by