any input function to transfer functionm

조회 수: 6 (최근 30일)
John Krzykacz
John Krzykacz 2019년 3월 12일
댓글: Aquatris 2019년 3월 13일
In Matlab ezxamples the input to transfer functions are definite i.e. defined mathematically.
I need to enter to a transfer function my own a function/array created in my Matlab code. It is a random array, without any analytical /mathematical expression.
Can I use this array as an input to a transfer function? (I suspect Matlab should calculete its Laplace transform "on line").
Thanks- bj

답변 (1개)

Aquatris
Aquatris 2019년 3월 13일
I think the function you are looking for is lsim().
The usage is pretty simple.
t = 0:1e-3:10; % time vector
u = rand(length(t),1);% random inputs
sys = tf(100,[1 2*0.1*10 100]); % transfer function
[y,t] = lsim(sys,u,t);
  댓글 수: 2
John Krzykacz
John Krzykacz 2019년 3월 13일
Thanks for your answer.
My function is an array generated in a loop. Its values are "random" in a sense, that the values depend on many factors. The function does not have any formula.It is an array of real numbers. The array is created in a loop with time t=t+dt, but the range of time varies.
I think the problem is in calculating the Laplace transform of the functiom, as it is an input to a transfer block.
Thanks- jk
Aquatris
Aquatris 2019년 3월 13일
I can't help much more with the limited information. However, I can suggest converting the transfer function in to state space form and writing your own solver using Euler integration or Runge-Kutta. This way you can calculate the input however you want.

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

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by