How to make this integral

조회 수: 1 (최근 30일)
Peppe
Peppe 2017년 9월 21일
댓글: Walter Roberson 2017년 9월 22일
Hi Suppose we have following equation:
S(x,t) = p(x,t) + k * int_0^t h(\tau) d\tau.
What is the difference between this and S(x,t) = p(x,t) + k * int_0^t h(t) dt ?
How ould the simulink block differs? I appritiate any help. Thank you

답변 (1개)

Walter Roberson
Walter Roberson 2017년 9월 21일
The
S(x,t) = p(x,t) + k * int_0^t h(t) dt
version is at least confusing, as it is using t both as a parameter to S and as the name of the variable to integrate over in the int() part.
S(x,t) = p(x,t) + k * int_0^t h(\tau) d\tau
can be written as
S = @(x, t) p(x,t) + k * integral(@(tau) h(tau), 0, t)
and
S(x,t) = p(x,t) + k * int_0^t h(t) dt
can potentially be written as
S = @(x, t) p(x,t) + k * integral(@(t) h(t), 0, t)
which would evaluate to the same. However, consider that if someone wrote
int_0^x sin(x)
they would normally mean the indefinite integral int( sin(x) ) -- integration of sin(x) with upperbound x. That is not the same thing that is happening with
S = @(x, t) p(x,t) + k * integral(@(t) h(t), 0, t)
which is first substituting the current specific value of t into the upper bound and then happening to use a lexically-different t as the name of the anonymous variable.
  댓글 수: 2
Peppe
Peppe 2017년 9월 22일
편집: Peppe 2017년 9월 22일
Thankbyou for your respond How would the simulink block look like? Is same integrator used for both and same iniial condition?
Walter Roberson
Walter Roberson 2017년 9월 22일
As outlined above, there are two potential interpretations of int_0^t h(t) dt .
In one of them, the t that is the upper bound is to be interpreted as the t that is the parameter to the function, with the t of h(t) dt being interpreted as a different t. That interpretation has exactly the same implementation as the version using tau, because the careful programmer would choose a different variable of integration to eliminate confusion... oh, say, tau perhaps.
In the other interpretation, the t that is the upper bound is to be interpreted as the t of h(t) dt. In that situation, this is an indefinite integration that would result in a symbolic formula. Simulink cannot really calculate symbolic formulae through its blocks, and you would need a quite different implementation to work around the limitation that Simulink does not like to carry around anything other than numeric and logical values.

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

카테고리

Help CenterFile Exchange에서 Antennas, Microphones, and Sonar Transducers에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by