how to solve symbolic matrix equations

I have to solve simultaneous matrix equations [x*A==0, x*e==1], here entries of A are arbitrary constants. X is the row vecor of variables, e is the coloumn vector of ones. I tried as below,, but didnt get desired output like X=....
please help me.. I am only a beginner in matlab.
S=10;s=3;N1=2;
N2=4;u1=4*S;
A0=sym(zeros(u1));
for i=1:u1
A0(i,i)='lamda';
end
A0;
%A2
A2=sym(zeros(u1));
A2(S+2,1)='mu1';
A2(2*S+2,1)='mu2';
A2(3*S+2,S+2)='mu1';
A2(3*S+2,2*S+2)='mu2';
for i=S+3:2*S+1;
A2(i,i-1)='mu1';
end
for i=2*S+3:3*S+1;
A2(i,i-1)= 'mu2';
end
for i=3*S+3:4*S
A2(i,i-1)='mu1+mu2';
end
A2;
%A1
A1=sym(zeros(u1));
A1(1,1)='-(lamda+theta)';
for i=2:s+1;
A1(i,i)= '-(theta+lamda+beta1)';
end
for i=s+2:N2;
A1(i,i)='-(lamda+beta1)';
end
for i=N2+1:S+1;
A1(i,i)= '-(lamda+beta1+beta2)';
end
for i=2:S+1;
A1(i,S+i)='beta1';
end
for i=N2+1:S+1;
A1(i,2*S+i)='beta2';
end
for i=1:s+1;
A1(i,i+Q)='theta';
end
for i=S+2:S+1+s;
A1(i,i+Q)= 'theta';
end
for i=2*S+2:2*S+1+s;
A1(i,i+Q)= 'theta';
end
for i=3*S+2:3*S+s;
A1(i,i+Q)= 'theta';
end
for i=S+2:S+1+s;
A1(i,i)= '-(theta+lamda+mu1)';
end
for i=S+s+2:2*S+1;
A1(i,i)= '-(lamda+mu1)';
end
for i=2*S+2:2*S+1+s;
A1(i,i)= '-(theta+lamda+mu2)';
end
for i=2*S+s+2:3*S+1;
A1(i,i)= '-(lamda+mu2)';
end
for i=3*S+2:3*S+s;
A1(i,i)= '-(theta+lamda+mu1+mu2)';
end
for i=3*S+s+1:4*S;
A1(i,i)= '-(lamda+mu1+mu2)';
end
A1;
%finding pi and stability checking
A=sym(zeros(u1));
A=A0+A1+A2
x=sym('x',[1 u1])
e=ones(u1,1));
sol=[x*A==0, x*e==1]

Respuestas (0)

Preguntada:

el 16 de Oct. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by