Obtain input knowing output and transfer function

조회 수: 7 (최근 30일)
Carlo Campigotto
Carlo Campigotto 2019년 5월 23일
편집: PAULA CADENA 2021년 7월 28일
I have some data (array of values) from a thermocouple (output) and the transfer function. I want to obtain the input so I was thinking of using Simulink. Can you help me?
  댓글 수: 1
David Wilson
David Wilson 2019년 5월 24일
You could always reciprocate the transfer function, and then pass the output through that. This will generate (an approimation of) the input signal.
Of course your original TF will probably not be invertible, (i.e. it's inverse will not be proper), so you may need to add some small (fast-order) terms in the denominator to extract an approximation. I'm assuming you are in the continuous domain.

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

채택된 답변

David Wilson
David Wilson 2019년 6월 7일
Since you have a simple transfer function, here's what I would do.
(1) First generate some data that we will subsequently try to "invert" back to the time domain. Make sure the input is not sharp like a step.
%% Calculate input from thermo ID
G = tf(1,[14,1]);
Ts = 0.1; % appropriate sample time
t = [0:Ts:50]'; % time vector
U = sin(t) + 0.6*sin(t*0.35-4); % trial (smoothish) input
plot(t,U)
Now do the simulation. This is a reconstruction of the data you have started with.
y = lsim(G,U,t);
plot(t,[U y])
Now we are ready to reconstruct the input u(t), so we need to invert your process transfer function. HOWEVER I've added some fast dynamics to make the inverse system causal. We need to do this, but it will now be approximate. The fast dyanmics should be faster than the original dynamics (tau=14) in your case.
%% Now back-calculate u(t)
fast = 0.1;
Ginv = (1/G)*tf(1,[fast^2 2*fast 1])
ur = lsim(Ginv,y,t)
plot(t,[U, ur]) % compare
  댓글 수: 1
PAULA CADENA
PAULA CADENA 2021년 7월 28일
편집: PAULA CADENA 2021년 7월 28일
Im trying to do the same, but my transfer function is 5.76e22*S^4/(S^11+310*S^10+.....+1.41e15).
How can I get the fast dynamics to make the inverse system casual?.
thanks.

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

추가 답변 (2개)

Carlo Campigotto
Carlo Campigotto 2019년 5월 24일
What do you mean by "continuous domain"? I have an array of values (first value = measurement at time 0, second value = measurement after 1 second and so on).
  댓글 수: 1
David Wilson
David Wilson 2019년 5월 24일
Is the transfer function G(s) (i.e. continuous), or G(z), i.e. discrete?
I'm assuming you have a continuous G(s) transfer function, and then you will need to sample and hold your (discrete) values to pass into G(s).
If your transfer function is already discrete, then there are various optimisations you can do to make it more robust. But that depends on the exact data and transfer function form.

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


Carlo Campigotto
Carlo Campigotto 2019년 6월 7일
Sorry for the late answer. My transfer function is 1/(14*s+1), where s=i*omega. I was thinking to something like this just to see what the input should look like:
Screenshot (1).png
but I get this error:
Screenshot (2).png.
How can I solve it? Thank you

카테고리

Help CenterFile Exchange에서 Dynamic System Models에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by