필터 지우기
필터 지우기

I need to put this block diagram in MATLAB (not in Simulink) and I do not know how to do it

조회 수: 3 (최근 30일)
This is the diagram
And this is what I've got so far in code:
s = tf('s');
s1 = tf(1, [1 4]);
s2 = tf(1, 1);
s3 = tf(1, [1 0 9]);
s4 = 10;
s5 = 12;
s6 = tf([1 6],1);

답변 (2개)

Paul
Paul 2023년 10월 9일
Hi Carlos,
Recheck the definiton of s2. Once you have that taken care of, I suggest you proceed with connect.
  댓글 수: 3
Carlos Puente
Carlos Puente 2023년 10월 9일
편집: Carlos Puente 2023년 10월 9일
I've redefined the blocks as shown in the image to use the connect function in Matlab more easily, but I don't know if what I'm doing is correct.
A.InputName = 'H';
A.OutputName = 'HA';
B.InputName = 'F';
B.OutputName = 'BF';
C.InputName = 'BF';
C.OutputName = 'Y';
D.InputName = 'Y';
D.OutputName = 'DY';
G.InputName = 'BF';
G.OutputName = 'GBF';
J.InputName = 'Y';
J.OutputName = 'JY';
S1 = sumblk('E = R - JY');
S2 = sumblk('H = E - GBF');
S3 = sumblk('F = HA - DY');
T = connect(A, B, C, D, G, J, S1, S2, S3, "R", "Y")
Paul
Paul 2023년 10월 9일
편집: Paul 2023년 10월 9일
That actually looks like it might be correct, assuing that A,B,C,D,G, and J have been defined properly. Can't tell for sure unless you post the complete code. T might be in the descriptor form because J(s) is improper (higher order numerator than denominator), but T can changed to tf or zpk form with tf(T) or zpk(T) respectively, and from there changed back to state space form if desired.

댓글을 달려면 로그인하십시오.


Sam Chak
Sam Chak 2023년 10월 9일
When utilizing the syntax s = tf('s') to establish a special variable 's', you gain the ability to directly formulate rational expressions for the creation of transfer function models. Employing a rational expression proves to be more intuitive, particularly when handling high-order transfer functions. Furthermore, it is advisable to generate dynamical model objects, with the 'tf' class being one of the viable options in this regard.
Proceed as @Paul guided you via the following link:
s = tf('s');
s1 = 1/(s + 4)
s1 = 1 ----- s + 4 Continuous-time transfer function.
s2 = 1/s
s2 = 1 - s Continuous-time transfer function.
s3 = 1/(s^2 + 9)
s3 = 1 ------- s^2 + 9 Continuous-time transfer function.
s4 = tf(10)
s4 = 10 Static gain.
s4a = 10 % test subject
s4a = 10
s5 = tf(12)
s5 = 12 Static gain.
s6 = s + 6
s6 = s + 6 Continuous-time transfer function.
whos
Name Size Bytes Class Attributes cmdout 1x33 66 char s 1x1 1281 tf s1 1x1 1281 tf s2 1x1 1281 tf s3 1x1 1297 tf s4 1x1 1265 tf s4a 1x1 8 double s5 1x1 1265 tf s6 1x1 1281 tf

카테고리

Help CenterFile Exchange에서 Naming Conventions에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by