I have been informed this is a bug in version 2012. I will keep everybody posted on progress regarding fixing it, or perhaps a workaround.
Differences in SOLVE output between MATLAB version 2010b and 2012a
2 次查看(过去 30 天)
显示 更早的评论
Dear Users
The title says it all really. I am using SOLVE to solve a system of 12 equations with 12 unknown variables. My unknowns are declared as;
z11=sym('z11','real')
z12=sym('z12','real')
z21=sym('z21','real')
z22=sym('z22','real')
sig1=sym('sig1','positive')
sig2=sym('sig2','positive')
sigu1=sym('sigu1','positive')
sigu2=sym('sigu2','positive')
sig1_h=sym('sig1_h','positive')
sig2_h=sym('sig2_h','positive')
sigu1_h=sym('sigu1_h','positive')
sigu2_h=sym('sigu2_h','positive')
I am using SOLVE as follows
S = solve('sigu1*(1+z11*z11) + sig1 = sigu1_h*(1+z11*z11) + sig1_h',...
'sigu1*(1+z12*z12) + sig1 = sigu1_h*(1+z12*z12) + sig1_h',...
'sigu1*(1+z12*z11) = sigu1_h*(1+z12*z11)',...
'sigu2*(1+z11*z11) + sig2 = sigu2_h*(1+z11*z11) + sig2_h',...
'sigu2*(1+z12*z12) + sig2 = sigu2_h*(1+z12*z12) + sig2_h',...
'sigu2*(1+z12*z11) = sigu2_h*(1+z12*z11)',...
'sigu1*(1+z21*z21) + sig1 = sigu1_h*(1+z21*z21) + sig1_h',...
'sigu1*(1+z22*z22) + sig1 = sigu1_h*(1+z22*z22) + sig1_h',...
'sigu1*(1+z22*z21) = sigu1_h*(1+z22*z21)',...
'sigu2*(1+z21*z21) + sig2 = sigu2_h*(1+z21*z21) + sig2_h',...
'sigu2*(1+z22*z22) + sig2 = sigu2_h*(1+z22*z22) + sig2_h',...
'sigu2*(1+z22*z21) = sigu2_h*(1+z22*z21)')
This system always has a solution when sig1=sig1_h, sig2=sig2_h, sigu1=sigu1_h, sigu2=sigu2_h, regardless of what z11, z12, z21 and z22 are set to (although I am not really interested in this particular solution).
In MATLAb version 2010b there are 17 solutions (including the one described above), but in Matlab 2012a I get the warning that no explicit solutions can be found. I noticed in the 2012a documentation that sometimes the "==" symbol is used instead of "=". However changing my code to use this makes no difference. I cannot see any other reasons why I need to change my code for 2012a.
Does anybody have any thoughts as to why 2012a is not giving me the same results, and/or how to get it to give me the correct results if I am using it incorrectly?
Any help would be greatly appreciated.
For information I am running both MATLAB versions concurrently on a 32-bit Windows Vista machine.
2 个评论
Salvador C. Cardona Navarrete
2014-11-22
编辑:Salvador C. Cardona Navarrete
2014-11-22
Hello Daniel:
I have detected some similar bug between Matlab 2010b and Matlab 2013b. Do you know if Mathworks solved the bug you detected?.
Salva
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Symbolic Math Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!