simulink transfer function with time constant changing during simulation

I'm trying to create in Simulink a transfer function, say 1/(T1*s+1), with T1 changing during simulation depending on various conditions. Since I cannot change manually the value for T1 the use of Transfer Fcn block is not possible. My question is how can I implement this transfer function?

 採用された回答

Fangjun Jiang
Fangjun Jiang 2011 年 12 月 17 日
Assume your input is x and output is y:
y=x/(T1*s+1)
y*T1*s+y=x
y*T1*s=x-y
y=(x-y)*(1/s)*(1/T1)
1/s is an integrator, use a negative feedback to get (x-y), 1/T1 is the gain, or can be a multiplication block. You can construct your transfer function now.

7 件のコメント

Marian
Marian 2011 年 12 月 18 日
Thank you for your answer, but unfortunately, although is correct, it's not applicable for my situation. The value for T1 is a result of an interpolation within a s-function and it changes during simulation depending on some conditions, so I cannot pass it (manually) to a Transfer Fcn block or to a Gain block. I have to find a way to implement a transfer function within a s-function or to pass the value of T1 (automatically) to a Simulink block and use that block to implement the transfer function. Unfortunately I haven't found this block, I don't know if it exists.
Fangjun Jiang
Fangjun Jiang 2011 年 12 月 18 日
Use the "Divide" block from the "Math Operations" library. Connect the first input to the output of the "Integrator" block, which effectively is (x-y)*(1/s), connect the second input to your S-function output, which is effectively T1, you then get (x-y)*(1/s)/T1
Marian
Marian 2011 年 12 月 18 日
That seems the way to go. Thank you very much.
Jeremy Simpson
Jeremy Simpson 2017 年 5 月 25 日
編集済み: Jeremy Simpson 2017 年 5 月 25 日
For others who come across this, you can also include an initial condition (see block diagram).
Tong666
Tong666 2018 年 7 月 24 日
first,this answers is vrey valuable.But i have a question further.How about change two parameters(T1 T2) in the same time.
Marian
Marian 2018 年 7 月 24 日
Is it a transfer function, such as k/((T1*s+1)(T2*s+1)) or is it another situation?
Molly Brun
Molly Brun 2020 年 3 月 25 日
How would you acheive this with the function looking more like this: K/(T1s^2+T2s+1) ? I am trying to keep it all in the transfer function block and change the denominator coefficient to include these variables.

サインインしてコメントする。

その他の回答 (1 件)

Marian
Marian 2020 年 3 月 26 日

1 投票

The transfer function K/(T1s^2+T2s+1) is associated with the differential equation T1*y'' + T2*y' + y = K*u.
It can be written: y'' = (K*u - T2*y' - y)/T1
So the transfer function can be implemented like in the figure
This is a subsystem like
The transfer function is implemented as a subsystem with its parameters (K, T1, T2) available for change from external blocks.
You can compare the answer of this subsytem with the answer of a transfer function block. In this example, the transfer function is 2/(12s^2+7s+1). You will see that are the same.
I hope this is what you looking for.

カテゴリ

質問済み:

2011 年 12 月 17 日

回答済み:

2020 年 3 月 26 日

Community Treasure Hunt

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

Start Hunting!

Translated by