Do source blocks in Simulink have an implicit unit step function built into them?

7 views (last 30 days)
I'm trying to understand some confusing behavior in Simulink and I'm not sure if the problem is my understanding of how Simulink works or if its about my understanding of linear systems more fundamentally.
I'm trying to set up a basic simulation that shows linearity by comparing results from two systems. The first system has numerator dynamics (a single s in the numerator) applied to a cosine input, and the second has no numerator dynamics (unity in the numerator) but the input to the system has already been differentiated analytically. I expect that both systems should output identical results.
However, what I am finding is that the system with numerator dynamics also includes a unit impulse response. The minimal example in the screen grab below shows my source of confusion. The only explanation I can come up with is that there is a hidden step function in the cosine source block, so that when differentiated we see something like:
.

Accepted Answer

Paul
Paul on 15 Feb 2024
For the top path:
Y(s) = s/(s+1)*X(s) = 1/(s+1) * (s*X(s))
The differentation rule for the one-sided Laplace transform is:
L(dx(t)/dt) = s*X(s) - x(0) (or x(0-) if we want to be precise).
So: s*X(s) = L(dx(t)/dt) + x(0).
x(t) = cos(t) and dx(t)/dt = -sin(t).
The output of the top path is then:
Y(s) = 1/(s+1) * ( L(dx(t)/dt) + x(0) )
Y(s) = 1/(s+1) * ( L(-sin(t)) + x(0) )
Y(s) = 1/(s+1)*L(-sin(t)) + x(0)/(s + 1)
Y(s) = Bottompath(s) + x(0)/(s + 1)
x(0) = 1 (x(t) = cos(t)
y(t) = Bottompath(t) + exp(-t);
  2 Comments
Charles Refvem
Charles Refvem on 15 Feb 2024
Thank you for your response. This helps a lot in conjunction with the answer from @Fangjun Jiang.
As a quick followup, would this not be equivalent to treating the input as after all? You wrote:
Y(s) = 1/(s+1) * ( L(-sin(t)) + x(0) )
The bold part, if I understand things properly, is equivalent to the since selects the initial value of and the Laplace transform of is a constant.
Paul
Paul on 16 Feb 2024
No, the bold part is
( L(-sin(t)) + x(0) )
or (removing the outer parentheses)
L(-sin(t)) + x(0)
The Laplace operator does not operate on x(0).
I think I see your thought process, which is to assume that the input signals are formally multiplied by a unit step function. In this view (which I don't disagree with) the same result obtains.
Again, focusing on the top:
x(t) = cos(t)*u(t)
dx(t)/dt = delta(t)*cos(t) - sin(t)*u(t)
Using the equivalence principal:
dx(t)/dt = delta(t) - sin(t)*u(t)
Going to the frequency domain, using the deifnition of the unilateral Laplace transform with lower bound at 0-
L(dx(t)/dt) = s*X(s) - x(0-).
Because x(t) includes the unit step, we have
x(0-) = 0 -> L(dx(t)/dt) = s*X(s) (for this problem)
Returning to the original equation implemented in Simulink:
Y(s) = 1/(s+1) * s*X(s) = 1/(s+1) * L(dx(t)/dt)
L(dx(t)/dt) = L(delta(t) - sin(t)*u(t)) = 1 + L(-sin(t)*u(t))
which is the bold equation we started (with x(0) = 1 as was the case when x(t) = cos(t) )
so
Y(s) = 1/(s+1) * L(-sin(t)*u(t)) + 1/(s+1)
y(t) = bottompath(t) + exp(-t)*u(t)
which is the same as the previous result, with the subtle assumption that we define u(t) s.t., u(0) = 1.

Sign in to comment.

More Answers (1)

Fangjun Jiang
Fangjun Jiang on 15 Feb 2024
The answer is no.
Maybe this will help
s/(s+1)=(s+1-1)/(s+1)=1-1/(s+1)
  3 Comments
Charles Refvem
Charles Refvem on 15 Feb 2024
OK. Definitely getting closer to understanding now. If I use the "Transfer Fcn (with initial outputs)" block and an initial output of 1, I can get everything to line up properly.
However, now I'm questioning my understanding of transfer functions. I was taught that the transfer function block always produces the zero-state response. That is, the initial output of a transfer function ought to be zero by definition, or so I was taught.
If the simulation only runs for how could the initial output have information from ?
Thanks again for your help.

Sign in to comment.

Products


Release

R2023b

Community Treasure Hunt

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

Start Hunting!