Clear Filters
Clear Filters

How can I define a block ( Transfer Fcn) in simulink?

6 views (last 30 days)
hi ,
M=kg and , A=Area , Both are constant numbers ,
How can I define a block ( Transfer Fcn) in simulink?
Numerator [ ] ?
Denominator [ ] ?
Error :
  • The given transfer function is an improper transfer function. The order of the transfer function numerator must be less than or equal to the order of the denominator.
thank you for your support

Accepted Answer

Sam Chak
Sam Chak on 6 Apr 2024
Edited: Sam Chak on 7 Apr 2024
Hi @M1A
Linear time-invariant models with more zeros than poles are not supported in Simulink. However, you can create such a model in MATLAB using the code provided below.
Solution in MATLAB:
% parameters
M = 1;
A = 1;
% method 1
Gzp = tf([M/A 0 0], 1)
Gzp = s^2 Continuous-time transfer function.
% method 2
s = tf('s');
Gzp = (M/A)*s^2
Gzp = s^2 Continuous-time transfer function.
Solution in Simulink:
If you still wish to model it in Simulink, you can approximate it by cascading it with a 2nd-order lowpass filter.
N = 10^2; % desired Bandwitdh
Gf = (1/((1/N)*s + 1))^2 % 2nd-order lowpass filter
Gf = 1 ----------------------- 0.0001 s^2 + 0.02 s + 1 Continuous-time transfer function.
Gzp = (s^2)*Gf
Gzp = s^2 ----------------------- 0.0001 s^2 + 0.02 s + 1 Continuous-time transfer function.
margin(Gf), grid on
Example in Simulink:
Since is a static gain, it is easy to connect a Gain block to the Transfer Fcn block.
  3 Comments
Paul
Paul on 7 Apr 2024
Edited: Paul on 13 Apr 2024
Another option may be avaiable.
IF the structure of the block diagram has other transfer functions (or any LTI system, really) directly in series with M*s^2/A, and the product of those transfer functions have a relative order of at least 2, then you can distribute the s^2 into those other transfer functions and retain the same overall input/output relatiionship, which avoids the need for high frequency poles, which can affect step size.
Fore example, suppose the block diagram has a first order transfer function on either side of M*s^2/A
(1/(a*s + 1)) * (M*s^2/A) * (1/(b*s + 1))
The I/O equivalent is
(s/(a*s + 1)) * (M/A) * (s/(b*s + 1))
The downside of this approach is that we lose the physical meaning of the internal signals.
Sam Chak
Sam Chak on 7 Apr 2024
Hi @M1A
While it is technically feasible to include M/A in the coefficients of the transfer function, connecting the Gain block, as demonstrated in my revised answer above, might be a more straightforward approach.
Are you attempting to estimate the acceleration of the physical state? Perhaps you could consider experimenting with @Paul's suggestion. Please let me know if the workaround is suitable for your application.

Sign in to comment.

More Answers (2)

Mur@t
Mur@t on 7 Apr 2024
Edited: Mur@t on 7 Apr 2024
No acc, its electrohydrolic system , It is a disruptive input (disturbance input) to a control system.
I used gain block as you showed. Also I will research 2nd low pass filter for Simulink.
Thank you for your share and information. The image is a partial region.
thank you @Sam Chak , thank you @Paul

Mur@t
Mur@t on 13 Apr 2024
@Sam Chak Can you check the answer again, just for filtering? I see that second-Order Filter block implements the following transfer functions , could it have been written low instead of high? Is there a different situation? I interpreted it differently? thanks
In the simscape library it looks like this.
Simscape / Electrical / Specialized Power Systems / Control / Filters
  1 Comment
Sam Chak
Sam Chak on 13 Apr 2024
The documentation is accurate. The concept of filters is discussed in the context of signal processing and linear circuit systems, which are typically essential topics in Electrical & Electronics Engineering. If you search for information, you will discover that time derivative operators can be considered high-pass filters. Mathematically, this involves arranging the ideal form and the second-order lowpass filter in a cascading configuration.
s = tf('s');
wn = 10^2; % desired Bandwitdh
Gf = (1/((1/wn)*s + 1))^2 % 2nd-order lowpass filter
Gf = 1 ----------------------- 0.0001 s^2 + 0.02 s + 1 Continuous-time transfer function.
Gf = minreal(Gf) % lowpass filter in standard form
Gf = 10000 ------------------ s^2 + 200 s + 1e04 Continuous-time transfer function.
M = 5;
A = 0.00015;
Gzp = (M/A*s^2)*Gf
Gzp = 3.333e08 s^2 ------------------ s^2 + 200 s + 1e04 Continuous-time transfer function.
Gzp = minreal(Gzp) % This is a highpass filter with K = M/A*wn^2
Gzp = 3.333e08 s^2 ------------------ s^2 + 200 s + 1e04 Continuous-time transfer function.
K = M/A*wn^2
K = 3.3333e+08

Sign in to comment.

Products


Release

R2023b

Community Treasure Hunt

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

Start Hunting!