Symbolic Toolbox - Error in Linearisation
3 次查看(过去 30 天)
显示 更早的评论
Dear Matlab community
Ive encountered a strange error. I had used a pregiven set of matrices A_mod_red and B_mod_red of a state space system containing some non-linearity. I had defined my variable and parameters the following:
num = 3; % Stellgrößen
nxm = 4; % Zustände
nym = 2; % Regelgrößen
nzm = 1; % Störungen
u = sym('u',[num,1]);
x = sym('x',[nxm,1]);
y = sym('y',[nym,1]);
z = sym('z',[nzm,1]);
ff = sym('f',[nxm,1]);
syms g_RS r_1 J_1 J_2 J_3 J_4 J_p m_p d_3 c1 c2
After that, I reformulated the given matrices A_mod_red and B_mod_red to:
ff(1) = A_mod_red(1,1)*x(1)+A_mod_red(1,2)*x(2)+A_mod_red(1,3)*x(3)+A_mod_red(1,4)*x(4)+B_mod_red(1,1)*u(1)+B_mod_red(1,2)*u(2)+B_mod_red(1,3)*u(3)+B_mod_red(1,4)*z(1);
ff(2) = A_mod_red(2,1)*x(1)+A_mod_red(2,2)*x(2)+A_mod_red(2,3)*x(3)+A_mod_red(2,4)*x(4)+B_mod_red(2,1)*u(1)+B_mod_red(2,2)*u(2)+B_mod_red(2,3)*u(3)+B_mod_red(2,4)*z(1);
ff(3) = A_mod_red(3,1)*x(1)+A_mod_red(3,2)*x(2)+A_mod_red(3,3)*x(3)+A_mod_red(3,4)*x(4)+B_mod_red(3,1)*u(1)+B_mod_red(3,2)*u(2)+B_mod_red(3,3)*u(3)+B_mod_red(3,4)*z(1);
ff(4) = A_mod_red(4,1)*x(1)+A_mod_red(4,2)*x(2)+A_mod_red(4,3)*x(3)+A_mod_red(4,4)*x(4)+B_mod_red(4,1)*u(1)+B_mod_red(4,2)*u(2)+B_mod_red(4,3)*u(3)+B_mod_red(4,4)*z(1);
In the next step, I determined the jacobians:
A = jacobian(ff,x);
B = jacobian(ff,u);
C = C_om;
E = jacobian(ff,z);
Then, I substituted the symbolic values by pregiven parameters from a structure array to get the linearized matrices in two operation points.
A01 = subs(A,[g_RS r_1 J_1 J_2 J_3 J_4 J_p m_p d_3 c1 c2 x(4)],...
[parameter.g_RS parameter.r_1 parameter.J_1 parameter.J_2 parameter.J_3 parameter.J_4 parameter.J_p parameter.m_p parameter.d_3 parameter.c1 parameter.c2 omega4_range(1)]);
A02 = subs(A,[g_RS r_1 J_1 J_2 J_3 J_4 J_p m_p d_3 c1 c2 x(4)],...
[parameter.g_RS parameter.r_1 parameter.J_1 parameter.J_2 parameter.J_3 parameter.J_4 parameter.J_p parameter.m_p parameter.d_3 parameter.c1 parameter.c2 omega4_range(2)]);
For the strange thing is that for the second linearization, there is a x(1) in the second and third row of the fourth column. By setting this x(1) to 0, I receive the same entries as in A01.
What is the problem here?
3 个评论
Torsten
2023-2-22
I think it's not possible to solve your problem without reproducing here what you describe.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Linear Algebra 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!