how can i solve this error in simulink?
조회 수: 2 (최근 30일)
이전 댓글 표시
hello.
i can't solve this error.
i attached simulink file.
( dynsys block function is system's dynamic in state space, ric_schur solve Riccati equation and fcn block function is input)
댓글 수: 0
채택된 답변
Ameer Hamza
2020년 4월 30일
In the block 'fcn', correct these lines
R=[1 0 0 0;
0 1 0 0;
0 0 1 0;
0 0 0 1];
%^ this space is missing in your file
u =-inv(R)*B*P*x1;
%^ do not take transpose of P, it is already column vector
Also in this function
function [ddy,ddq] = dynsys(y,ydot,q,qdot,u)
% 4 states (x):
%% parameters
Phils=-0.1104;M=1.1637;K=2.9327;alpha=0.183;
Gamma=0.4537;D=0.6;ws=9.896;F=0.42;G=0.028;
clo=0.28;Lambda=0.0676;
%% Obtain x, u and y
% x
y=x(1);
ydot=x(2);
q=x(3);
qdot=x(4);
%% y
ddy=(1/M)*(-(2*alpha)/(D*ws)*Gamma*x(2)-K*x(1)+Gamma*x(3)+Phils*u);
ddq=ws*G*clo^2*x(4)-ws^2*x(3)-Lambda*x(3)^2*x(4)+((ws*F)/(D))*x(2);
Input variable is 'y', but you are using x(1), x(2) in your code. Correct variable names according to your equations.
If you resolve this issue, hopefully all the errors will get resolved.
추가 답변 (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!