How to make this integral

3 次查看(过去 30 天)
Peppe
Peppe 2017-9-21
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 中查找有关 Simulink 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by