Here is my problem. I have a quite complicated linear system with two syms variables in the matrix. It is of the form AX=0. So if det(A)is not equal to zero, the answer is X=0. So I first calculate the values of my syms variables that lead to det(A)=0. since det(A) is a high order polynomial (degree 12), I couldn't find anyway to to that except by doign the following: (I store them because I have also plotted one variable versus the other)
D=det(A);fct=matlabFunction(D);h=[];for idx=10:5:200 g=fct(idx,nu); ps=roots(sym2poly(g)); h=[h ps];endNow I want to solve my systems for those values so that I don't get the trivial X=0 solution.So I tried this:Bk=zeros(6,1); Ak=subs(A, {Ustar, nu}, {10, h(1,1)}); temp=linsolve(Ak,Bk);
where Ustar and nu are the name of my two syms variables in matrix A. Since h(1,1) should correspond to the idx value 10, I should have det(A)=0 and thus a different solution (relative solution on the components of X) from X=0. I think the problem comes from the fact that my roots are only approximated and thus further down the calculation det(A) is not equal to 0.
- Did I miss an obvious mistake in my code ?
- Is there anyway around that ? forcing matlab to consider det(A)=0
- Or is there a completely different method I am not aware of ?
Best Answer