"Cannot simulate time response when internal delay model is non-casual"

37 views (last 30 days)
Hello, I am trying to get the step reponse of a 3x3 MIMO system, but I get this: "Cannot simulate time response when internal delay model is non-casual". How do I fix this? I am just trying to simulate this MIMO system, like I am able to do in SIMULINK, but for some reason the same thing does not work in MATLAB. Does anyone know the solution for this?
The code I run is the following:
syms s
tau = .5;
% System (Ogunnaike and Ray distillation column):
G11 = (.66/(6.7*s + 1))*exp(-2.6*s);
G12 = (-.61/(8.64*s + 1))*exp(-3.6*s);
G13 = (-.0049/(9.06*s + 1))*exp(-s);
G21 = (1.11/(3.25*s + 1))*exp(-6.5*s);
G22 = (-2.36/(5*s + 1))*exp(-3*s);
G23 = (-.01/(7.09*s + 1))*exp(-1.2*s);
G31 = (-34.68/(8.15*s + 1))*exp(-9.2*s);
G32 = (46.2/(10.9*s + 1))*exp(-9.4*s);
G33 = (.87*(11.61*s^2 + 1)/(73.132*s^2 + 22.69*s + 1))*exp(-s);
% PID with standard values just for testing:
PID = 1:9;
PID = [PID(1) + PID(2)/s + PID(3)*s; PID(4) + PID(5)/s + PID(6)*s;PID(7) + PID(8)/s + PID(9)*s];
O11 = G11*PID(1);
O12 = G12*PID(2);
O21 = G21*PID(1);
O22 = G22*PID(2);
O13 = G13*PID(3);
O23 = G23*PID(3);
O31 = G31*PID(1);
O32 = G32*PID(2);
O33 = G33*PID(3);
TF11 = sym2tf(O11);
TF12 = sym2tf(O12);
TF21 = sym2tf(O21);
TF22 = sym2tf(O22);
TF13 = sym2tf(O13);
TF23 = sym2tf(O23);
TF31 = sym2tf(O31);
TF32 = sym2tf(O32);
TF33 = sym2tf(O33);
saida1 = TF11 + TF12;
saida2 = TF21 + TF22;
saida1 = saida1 + TF13;
saida2 = saida2 + TF23;
saida3 = TF31 + TF32 + TF33;
feed1 = feedback(saida1,1);
feed2 = feedback(saida2,1);
feed3 = feedback(saida3,1);
a = step(feed1,0:tau:100);
b = step(feed2,0:tau:100);
% The line below gives me the previously mentioned error:
c = step(feed3,0:tau:100);
The error specifically, is the following:
Any help is welcomed.
  4 Comments
YLieven
YLieven on 23 Feb 2022
Yes this is the exact function I used to convert a symbolic transfer function to a numerical transfer function

Sign in to comment.

Accepted Answer

YLieven
YLieven on 23 Feb 2022
The problem was that G33 was wrong, my mistake.
G33 = (.87*(11.61*s^2 + 1)/(73.132*s^2 + 22.69*s + 1))*exp(-s);
should be
G33 = (.87*(11.61*s + 1)/(73.132*s^2 + 22.69*s + 1))*exp(-s);
Thank you Paul for your help, you provided insight that I did not know about.

More Answers (1)

Paul
Paul on 22 Feb 2022
Edited: Paul on 22 Feb 2022
It appears that the root of the problem is this line:
G33 = (.87*(11.61*s^2 + 1)/(73.132*s^2 + 22.69*s + 1))*exp(-s);
G33 has an s^2 in the numerator and the denominator, so G33 is proper, whereas all of the other G** transfer functions have denominators with higher order than the numerators, i.e. strictly proper.
TF33, which is the product of G33 and PID(3) is improper (numerator higher order than denominator), which then carries all the way to feed3. step() can't simulate the repsonse of an improper model (which Matlab also calls non-causal, but I'm not sure that's correct terminology for continuous time systems).
  3 Comments
Paul
Paul on 23 Feb 2022
Edited: Paul on 23 Feb 2022
I'm kind of curious how this is done in Simulink, which ordinarily doesn't implement pure differentiation as would be needed for a PID controller.
On the Matlab side, one approach may be to use a high pass filter for the derivative control in the third PID controller instead of a pure derivative, as Simulink does in its PID Controller block.
w = 100; % for example
PID = [PID(1) + PID(2)/s + PID(3)*s; PID(4) + PID(5)/s + PID(6)*s;PID(7) + PID(8)/s + PID(9)*s*w/(s + w)];
Modify w as needed. Consider doing the exact same thing for the first and second PID controllers if there's some need for consistency between the channels.
YLieven
YLieven on 23 Feb 2022
That is actually very interesting! Thank you for your help @Paul, I will come back to your answer should I find any similar problems in the future.

Sign in to comment.

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!