How to solve singular matrix?
function dx = plant(t,x,u)
dx = zeros(6,1);
x1 = [x(1);x(2);x(3)];
x2 = [x(4);x(5);x(6)];
beta3=0.33;
beta4=2;
D=0.1;
M=1;
a1=0.1;%k1
a2=0.1;%k2
a3=0.01;%k3
a4=0.1;%k4
b=2.3;
f2= [(-(D*a1+a3)*x1(1)/M)-(D*a2*b^3*x2(3)/M);1;2];
G=[(1+a4*b^3)/M 0 0;0 1 0;0 0 1];
p1=[beta3*sin(x1(1));1;2];
p2=[beta4*(x2(1)^2);0;3];
dx1 = x2 + p1;
dx2 = f2 + G*u + p2;
dx = [dx1; dx2];function dx = plant(t,x,u)
dx = zeros(6,1);
x1 = [x(1);x(2);x(3)];
x2 = [x(4);x(5);x(6)];
beta3=0.33;
beta4=2;
D=0.1;
M=1;
a1=0.1;%k1
a2=0.1;%k2
a3=0.01;%k3
a4=0.1;%k4
b=2.3;
f2= [(-(D*a1+a3)*x1(1)/M)-(D*a2*b^3*x2(3)/M);1;2];
G=[(1+a4*b^3)/M 0 0;0 1 0;0 0 1];
p1=[beta3*sin(x1(1));1;2];
p2=[beta4*(x2(1)^2);0;3];
dx1 = x2 + p1;
dx2 = f2 + G*u + p2;
dx = [dx1; dx2]; function dx = plant(t,x,u)
dx = zeros(6,1);
x1 = [x(1);x(2);x(3)];
x2 = [x(4);x(5);x(6)];
beta3=0.33;
beta4=2;
D=0.1;
M=1;
a1=0.1;%k1
a2=0.1;%k2
a3=0.01;%k3
a4=0.1;%k4
b=2.3;
f2= [(-(D*a1+a3)*x1(1)/M)-(D*a2*b^3*x2(3)/M);1;2];
G=[(1+a4*b^3)/M 0 0;0 1 0;0 0 1];
p1=[beta3*sin(x1(1));1;2];
p2=[beta4*(x2(1)^2);0;3];
dx1 = x2 + p1;
dx2 = f2 + G*u + p2;
dx = [dx1; dx2]; singular matrix MATLAB Answers — New Questions