Problem in Implementing exponential transfer function

3 views (last 30 days)
I am facing a problem while implementing exponential transfer function.
I have td1= 0.01+0.01sin(40.pi.t) where t is simulation time
I need to implement exp^(-td1*s) in simulink but I am unable to do so. I understand we can implement exponential transfer function by mscript but I wanted to implement it by simulink. I have seen some answers stating that we have to use transport delay to implement the time delay. Is that the only way or is there a different way to implement in simulink.Thank you.

Accepted Answer

Naman Bhaia
Naman Bhaia on 19 Mar 2019
Hello Rahul,
From what I can understand, you can do the following as an alternative to using MATLAB script
1. There can be two ways Define the transport delay function (td1)
1.1. Using your regular Simulink blocks. Define the “frequency” of the sine wave input source as 40*pi. Run this model before the other and save the output to the workspace as td1. You can mask this as a subsystem and make it priority 1 while compiling. This way it will store the value of td1 to the workspace before it executes the transfer function.
img1.PNG
1.2. Define the td1 value in the “Initialization Function” subsection of the “Model Properties” dialog box.
img2.PNG
2. After completing step 1, convert the exponential transfer function to a logical format using the Transfer Function from the Simulink/Continuous library.
2.1. In the transfer function you can convert your exponential function exp^(-td1*s) to exp^(-td1*s/2)/ exp^(td1*s/2).
2.2. This can then be simplified down to (1+(td1*s)/2)/( 1-(td1*s)/2)
3. Give the input to this transfer function as a constant (1) and the output is what you desired.
img3.PNG
  2 Comments
Rahul
Rahul on 19 Mar 2019
Hello Naman,
Thank you very much for your help. I just have one question from your answer, in step 1 how make the masked subsystem a priority to compile first as explained by you.
Rahul
Rahul on 20 Mar 2019
Hello Naman,
I figured out how to assign prority for subsystems and accordingly execute them. What I found out was there is something called block properties with an option called priority and assign 1 to it. Thank you very much

Sign in to comment.

More Answers (0)

Categories

Find more on Simulink in Help Center and File Exchange

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!