how can i solve this error in simulink?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
zahra zamani
il 30 Apr 2020
Commentato: Ameer Hamza
il 1 Mag 2020
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 Commenti
Risposta accettata
Ameer Hamza
il 30 Apr 2020
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.
2 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Linear Algebra in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!