Warning: Explicit solution could not be found. > In solve at 81 - Symbolic Math Toolbox

2 views (last 30 days)
These are the equations:
X1_1 + X2_1 - 23687/100
X1_2 + X2_2 - 4980831654290391/4398046511104
X1_3 + X2_3 - 40309/25
X1_4 + X2_4 - 7701/10
X1_5 + X2_5 - 10829/25
2*(X1_1/2 - X2_1/2)^2 - 4050288284713621/4398046511104
2*(X1_2/2 - X2_2/2)^2 - 6817447548526841/274877906944
2*(X1_3/2 - X2_3/2)^2 - 4273253568628633/137438953472
X1_1 + X1_2 + X1_3 + X1_4 + X1_5 - 3489233779827237/2199023255552
X2_1 + X2_2 + X2_3 + X2_4 + X2_5 - 5713678544657883/2199023255552
Does this system has valid solutions OR Matlab is not able to find them?
  4 Comments
Daniel Shub
Daniel Shub on 21 May 2011
Can you post some code that can be cut and pasted into the command window to recreate the error. Including you solve method, and how you define Tequazioni.

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 21 May 2011
There is indeed no solution.
The 4th line says X1_4 = constant1 - X2_4
The 5th line says X1_5 = constant2 - X2_5
The 9th line has X1_4 + X1_5 so that is going to be constant1 + constant 2 - (X2_4 + X2_5)
The 10th line has X2_4 + X2_5 .
Everything else on line 9 and line 10 can be resolved down to explicit values by way of the previous lines (lines 1-3 and 6-8)
Add substituted line 9 to line 10; because one has +(X2_4+X2_5) and the other has -(X2_4+X2_5) the X2_4 and X2_5 will cancel out leaving a constant sum. If that constant sum is not equal to 0 then the system has no solutions. The constant sum does indeed not equal to 0.

More Answers (1)

condor
condor on 21 May 2011
Please consider this code:
tic
display('Computing...');
drawnow;
load DATI(2)_test
variabili=sym('X', [2 5]);
variabili=sym(variabili, 'positive');
%FORMULA GENERALE CALCOLO MEDIA-VARIANZA
syms n i
Xi = sym('X[i]');
mean = symsum(Xi,i,1,n)/n;
variance = symsum((Xi-mean)^2,i,1,n);
b=2;
variance_b = subs(variance,n,b);
Xb = arrayfun( @(x) sprintf( 'X[%d]', x ), 1:b, 'UniformOutput', false ); % Cell array of vector - Gruppo 2
for j=1:5
%5 equazioni - SOMMA COLONNE (ogni riga corrisponde ad un gruppo)
equaz.SommaColonne(1,j)=sum(variabili(1:2,j))-SommaColonne(1,j);
end
for u=1:3
%3 equazioni - VARIANZA COLONNE (ogni riga corrisponde ad un gruppo)
equaz.VarianzaColonne(1,u)=subs(variance_b,Xb,variabili(1:2,u))-VarianzaColonne(1,u);
end
%2 equazioni - SOMMA RIGHE (ogni riga corrisponde ad un gruppo)
equaz.SommaRighe(1,1)=sum(variabili(1,1:5))-SommaRighe(1,1);
equaz.SommaRighe(2,1)=sum(variabili(2,1:5))-SommaRighe(2,1);
RSommaColonne=reshape(equaz.SommaColonne,5,1);
RVarianzaColonne=reshape(equaz.VarianzaColonne,3,1);
Tequazioni=[RSommaColonne' RVarianzaColonne' equaz.SommaRighe']';
Soluzioni=solve(Tequazioni);
toc
DATI(2)_test.mat CAN BE DOWNLOADED HERE: http://www.speedyshare.com/files/28573299/DATI_2_test.mat

Categories

Find more on Symbolic Math Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!