Implementing Transfer Function In Simulink.

79 views (last 30 days)
Hi, I have a transfer function and have been struggling to implement it properly into simulink. ,,N, and D all change with respect to time and I want to be able to get . Furthermore, N and D depend on which I pass into a Matlab Block that calculates N and D respectively.
I tried using the Varying Transfer Fcn block, but I'd like to implement it using signals and blocks.
Thanks in advance, I'd really appreciate the help!

Answers (2)

Subhajyoti
Subhajyoti on 26 Aug 2024
Edited: Subhajyoti on 26 Aug 2024
To implement a time-varying transfer function in Simulink using signals and blocks, you can follow these steps:
Create a MATLAB Function Block:
  • Insert a ‘MATLAB Function’ block from the Simulink Library.
  • Double click the block and write a function to calculate the time-varying numerator and denominator coefficients.
You can refer to the following link to know more about implementing ‘MATLAB Function’ block in Simulink:
Build the Transfer Function:
Option 1: Use another MATLAB Function Block
  • Insert another ‘MATLAB Function’ block from the Simulink Library.
  • Utilize the ‘tf’ function to get the vector of numerator coefficients (B2) and the vector of denominator coefficients (A2) for the equivalent transfer function.
You can refer to the following link for more information on ‘tf’ function:
Option 2: Use Basic Blocks
  • Insert ‘Gain’, ‘Sum’, ‘Integrator’, and ‘Product’ blocks to build your transfer function manually.
  • Connect the output of the MATLAB Function block to the ‘Gain’ and ‘Product’ blocks to dynamically change the coefficients.
Simulate:
  • Connect these blocks appropriately to simulate the system
Debugging:
  • Use ‘Scope’ or ‘Display’ blocks to visualize the output and debug if necessary.
This setup allows you to dynamically adjust the transfer function coefficients based on the input signal or other parameters, effectively simulating a time-varying transfer function in Simulink.
You may go through the following MathWorks documentation link to learn more about ‘Transfer Function’ in MATLAB: https://www.mathworks.com/help/control/ug/transfer-functions.html
Also, the following are some helpful resources you can refer to for implementing ‘Transfer Function’ in MATLAB:
I hope this helps.

SHEHROZ
SHEHROZ on 21 Jul 2025
Transfer function is 0.003135/s(s+0.0129)
Considering that the tank has a capacity of 1 m3 and that it is initially empty, determine, with the aid of MATLAB, a control law for u that acts in such a way as to guarantee that (a) 98% of the maximum capacity of the tank is reached in a time not longer than 25s and never exceed the maximum capacity of the tank itself; (b) a measurement noise of the type ν = sin(ωt) for ω >= 12 rad/s does not produce an effect on the output greater than 1%; (c) the effects of a periodic disturbance po,d = Dsin(ωt) with ω <= 10−2rad/s and D = 0.001m3/s does not produce volume variations greater than 1% of the steady-state value The satisfaction of all the requirements shall be shown on Bode plots and the step response shall be also presented
  3 Comments
SHEHROZ
SHEHROZ on 22 Jul 2025
Edited: SHEHROZ on 22 Jul 2025
Yes , you are right , Do you know it's solution ?
Walter Roberson
Walter Roberson on 22 Jul 2025
I would expect that you would use a transfer function block with parameters
[0.0031335]
[1 0.0129 0]

Sign in to comment.

Categories

Find more on Simulink in Help Center and File Exchange

Products


Release

R2023b

Community Treasure Hunt

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

Start Hunting!