# 
msgid ""
msgstr ""
"Project-Id-Version: Modelica by Example 0.2.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-04-14 10:14-0400\n"
"PO-Revision-Date: 2014-09-22 12:20+0100\n"
"Last-Translator: Dongping Xie <dongping.xie.tud@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: ../../source/behavior/discrete/bouncing.rst:5
msgid "Bouncing Ball"
msgstr "弹跳球"

#: ../../source/behavior/discrete/bouncing.rst:8
msgid "Modeling a Bouncing Ball"
msgstr "对弹跳球的建模"

#: ../../source/behavior/discrete/bouncing.rst:10
msgid ""
"In the :ref:`previous example <cooling-revisited>`, we saw how some events "
"are related to time.  These so-called \"time events\" are just one type of "
"event.  In this section, we'll examine the other type of event, the state "
"event.  A state event is an event that depends on the solution trajectory."
msgstr ""
"在\ :ref:`前面的例子 <cooling-revisited>`\ 里，我们看到了某些事件和时间的关系。\ "
"这些所谓“时间事件”（time "
"event）只是其中一种“事件”（event）。\ "
"我们将在本节中研究另一类事件，即状态事件（state event）。\ "
"状态事件是依赖于解的轨迹的一类事件。\ "

#: ../../source/behavior/discrete/bouncing.rst:16
msgid ""
"State events are much more complicated to handle.  Unlike time events, where"
" the time of the event is known *a priori*, a state event depends on the "
"solution trajectory.  So we cannot entirely avoid the \"searching\" for the "
"point at which the event occurs."
msgstr ""
"处理状态事件相对而言更为复杂。\ "
"不同于能够先验"
"地知道发生时间的时间事件，状态事件依赖于解的轨迹。\ "
"因此，我们无法完全避免去“搜索”发生事件的时点。\ "

#: ../../source/behavior/discrete/bouncing.rst:21
msgid ""
"To see a state event in action, let us consider the behavior of a bouncing "
"ball bouncing on a flat horizontal surface.  When the ball is above the "
"surface, it accelerates due to gravitational forces.  When the ball "
"eventually comes in contact with the surface, it bounces off the surface "
"according to the following relationship:"
msgstr ""
"为了看到状态事件的效果，我们考虑一个弹跳球在平坦的水平面上弹跳时的行为。\ "
"球在平面以上时会在重力作用下加速。\ "
"而球最终与平面接触时，它会遵从以下关系从表面反弹："

#: ../../source/behavior/discrete/bouncing.rst:31
msgid ""
"where :math:`v_\\text{final}` is the (vertical) velocity of the ball "
"immediately after contact with the surface, :math:`v_\\text{initial}` is the"
" velocity prior to contact and :math:`e` is the coefficient of restitution, "
"which is a measure of the fraction of momentum retained by the ball after "
"the collision."
msgstr ""
"其中\ :math:`v_\\text{final}`\ 为球在碰撞瞬间（在垂直方向）的速度\ :math:`v_\\text{initial}`\ "
"为球在碰撞前的速度。\ "
"而\ :math:`e`\ 则是恢复系数。\ "
"恢复系数是对球在碰撞后所保留动量占比大小的度量。\ "

#: ../../source/behavior/discrete/bouncing.rst:37
msgid "Bringing all this together in Modelica might look something like this:"
msgstr "如果我们把以上内容转化为Modelica，可能会是以下的样子："

#: ../../source/behavior/discrete/bouncing.rst:43
msgid ""
"In this example, we use the parameter ``h0`` to specify the initial height "
"of the ball off the surface and the parameter ``e`` to specify the "
"coefficient of restitution.  The variables ``h`` and ``v`` represent the "
"height and vertical velocity, respectively."
msgstr ""
"在这个例子中，我们采用参数\\ ``h0``\\ 指定球在平面上的初始高度，参数\\ ``e``\\ 指定恢复系数。\ "
"变量\\ ``h``\\ 和\\ "
"``v``\\ 分别表示高度以及垂直速度。\ "

#: ../../source/behavior/discrete/bouncing.rst:48
msgid ""
"What makes this example interesting are the equations.  Specifically, the "
"existence of a ``when`` statement:"
msgstr "本例有趣的地方在于模型中的公式。\ "
"特别是其中的\\ ``when``\\ 语句："

#: ../../source/behavior/discrete/bouncing.rst:58
msgid ""
"A ``when`` statement is composed of two parts.  The first part is a "
"conditional expression that indicates the moment the event takes place.  In "
"this case, the event will take place \"when\" the height, ``h``, first drops"
" below ``0``.  The second part of the ``when`` statement is what happens "
"when the event occurs.  In this case, the value of ``v`` is re-initialized "
"via the ``reinit`` operator.  The ``reinit`` operator allows us to specify a"
" new initial condition for a state.  Conceptually, you can think of "
"``reinit`` as being like an ``initial equation`` inserted in the middle of a"
" simulation.  But it only changes one variable and it always sets it "
"explicitly (*i.e.,* it isn't as flexible as an ``initial equation``).  In "
"this case, the ``reinit`` statement will reinitialize the value of ``v`` to "
"be in the opposite direction of the value of ``v`` before the collision, "
"represented by ``pre(v)``, and scaled by the factor ``e``."
msgstr ""
"\ ``when``\\ （当）语句由两部分组成。\ "
"第一部分是条件表达式，表示事件发生的时刻。\ "
"在本例中，事件发生在“当”高度\\ ``h``\\ "
"第一次降低到\\ ``0``\\ 以下时。\ "
"\\ ``when``\\ 表达式的第二部分描述了在事件出现时所发生的事情。\ "
"在本例中，\\ ``v``\\ "
"的值被\ ``reinit``\\ （重新初始化）操作符重新初始化了。\ "
"我们可以用\\ ``reinit``\\ "
"操作符为状态设定新的初始化条件。\ "
"从概念上讲，你可以认为\\ ``reinit``\ 当成是在仿真过程中插入的\\ ``initial "
"equation``\\ 。\ "
"但是，\ ``reinit``\ 只会改变一个变量的值，"
"而且这种改变总是显式的（\\ *也就是说*\\ 它没有\ ``initial "
"equation``\\ 那么灵活）。\ "
"在本例中，\\ ``reinit``\\ 语句会将\\ ``v``\\ 的值重新初始化，使之与在碰撞前的\ "
"``v``\\ （也就是\\ ``pre(v)``\\ ）方向相反，大小变为原来的\\ ``e``\\ 倍。\ "

#: ../../source/behavior/discrete/bouncing.rst:73
msgid ""
"Assuming that ``h0`` has a positive value, the relentless pull of gravity "
"ensures that the ball will eventually hit the surface. Running the "
"simulation for the case where ``h0`` is 1.0, we see the following behavior "
"from this model:"
msgstr "假设\ ``h0``\ 为正值，重力不懈的拉扯确保球最终将贴近平面。\ "
"在\ ``h0``\ 为1.0的情况下运行仿真，我们可以看到模型有以下行为："

#: ../../source/behavior/discrete/bouncing.rst:81
msgid ""
"In this plot, we see that at around 0.48 seconds, the first impact with the "
"surface occurs.  This occurs because the condition ``h<0`` first becomes "
"true at that moment.  Note that what makes this a state event (unlike our "
"example in :ref:`previous cooling examples <cooling-revisited>`) is the fact"
" that this conditional expression references variables other than ``time``."
msgstr ""
"在此图中，我们看到在0.48秒左右，球第一次和表面发生了碰撞。\ "
"这是因为条件\\ ``h<0``\\ "
"在该时刻首次为真。\ "
"需要注意的是，是什么使之成为状态事件（这个条件表达式引用了其他变量而不是变量\\ ``time``，而非我们在\\ "
":ref:`\ 前面冷却例子\ <cooling-revisited>`\\ 内见到的样例。\ "
")"

#: ../../source/behavior/discrete/bouncing.rst:88
msgid ""
"As such, the simulation proceeds assuming the ball is in free fall until it "
"identifies a solution trajectory where the value of the conditional ``h<0`` "
"changes during a time step.  When such a step occurs, the solver must "
"determine the precise time when the value of the conditional expression "
"becomes true.  Once that time has been identified, it computes the state of "
"the system at that time, processes the statements within the ``when`` "
"statement (*e.g.* any ``reinit`` statements) that affect the state of the "
"system and then **restarts** the integration starting from these computed "
"states.  In the case of the bouncing ball, the ``reinit`` statement is used "
"to compute a new post-collision value for ``v`` that sends the ball "
"(initially) upward again."
msgstr ""
"因此，仿真进行时假定球是在自由下落。\ "
"一直到它发现在解的轨迹中某个特定的时间步长内，条件表达式\\ ``h<0``\\ "
"的值发生变化。\ "
"倘若出现了这样的时间步长，求解器必须确定条件式的值变真的确定时刻。\ "
"一旦该时刻被确定，求解器通过处理在该时间内影响了系统状态的\ "
"``when``\\ 语句（如任何\\ ``reinit``\\ 语句）以计算该系统的状态。\ "
"然后求解器以计算出的状态为初值\\ "
"**重启**\\ 积分计算。\ "
"本例弹跳球内\\ ``reinit``\\ 语句的作用是，计算一个碰撞后让球重新（开始）上升的新值\\ ``v``\\ 。\ "

#: ../../source/behavior/discrete/bouncing.rst:101
msgid ""
"But it is important to keep in mind that, in general, the solutions for most"
" Modelica models are derived using numerical methods.  As we shall see "
"shortly, this has some profound implications when we consider discrete "
"behavior.  This is because at the heart of all events (time or state events)"
" are conditional expressions, like ``h<0`` from our current example."
msgstr ""
"但要记住的是，一般情况下大多数的Modelica模型的解是由数值方法得出的。\ "
"正如我们将很快看到，这会对我们考虑的离散行为产生深远的影响。\ "
"这是因为，在所有的事件（时间或状态事件）的核心都是条件表达式，例如本例中的\\"
" ``h<0``\\ 。\ "

#: ../../source/behavior/discrete/bouncing.rst:108
msgid ""
"The implications become clear if we simulate our bouncing ball a bit longer."
"  In that case, most Modelica tools will provide a solution like this:"
msgstr "倘若我们模拟弹跳球的时间稍长，这种含义就会变得很清楚。\ "
"在这种情况下，大多数Modelica语言的工具将提供这样的一个解："

#: ../../source/behavior/discrete/bouncing.rst:115
msgid ""
"It should be immediately obvious when looking at this trajectory that "
"something has gone wrong.  But what?"
msgstr "显然，我们在看到轨迹后马上知道有些问题了。\ "
"但到底是什么有问题呢？"

#: ../../source/behavior/discrete/bouncing.rst:119
msgid "Numerical Precision"
msgstr "数值精度"

#: ../../source/behavior/discrete/bouncing.rst:121
msgid ""
"The answer, as we hinted at before, lies in the numerical handling of the "
"when condition ``h<0``.  More specifically, what do we do if we start a "
"state extremely close to an event?  Because of numerical imprecision, we do "
"not know whether we are starting our step right after an event has just "
"occurred or whether we are starting a step where an event is just about to "
"occur."
msgstr ""
"正如我们前面的暗示，答案就在于对条件表达式\\ ``h<0``\\ "
"的数值处理上。\ "
"由于数值精度的问题，我们无法得知我们在开始计算本步时是到底在一个刚刚发生的事件之后，还是在事件即将发生之时。\ "

#: ../../source/behavior/discrete/bouncing.rst:128
msgid ""
"To address this problem, we must introduce a certain amount of hysteresis "
"(dead-banding).  What this means in this case is that once the condition "
"``h<0`` has become true, we have to get \"far enough\" away from the "
"condition before we allow the event to happen again.  In other words, the "
"event happens whenever ``h`` is less than zero.  But before we can trigger "
"the event again we require that ``h`` must first become greater than some "
":math:`\\epsilon`.  In other words, it is not simply enough that `h` becomes"
" greater than zero, `h` must become greater than :math:`\\epsilon` (where "
":math:`\\epsilon` is determined by the solver by examining various scaling "
"factors)."
msgstr ""
"为了解决这个问题，我们必须引入一定量的迟滞（死区）。\ "
"这意味着在这种情况下，一旦条件\\ ``h<0``\\ 为真，我们必须离状态“足够远”"
"才能让事件再次发生。\ "
"换句话说，当\\ ``h``\\ 小于零时会发生事件。\ "
"但在我们再次触发事件前，我们要求\\ ``h``\\ 必须大于某个\\ "
":math:`\\epsilon`\\ 。\ "
"换句话说，\\ `h`\\ 并不是仅仅简单地大于零，\\ `h`\\ 必须大于\ "
":math:`\\epsilon`\ （其中\\ :math:`\\epsilon`\\ 是由求解器通过检查一系列缩放因子得到的）。\ "

#: ../../source/behavior/discrete/bouncing.rst:139
msgid ""
"The problem in the previous simulations is that each time the ball bounces, "
"the peak value of `h` goes down a little bit.  By peak value, we mean the "
"value of `h` when the ball first begins to fall again. Eventually, the peak "
"value of `h` isn't enough to exceed the critical value of :math:`\\epsilon`."
"  This, in turn, means that the ``when`` statement never fires and the "
"``reinit`` statement will never again reset ``v``.  As a result, the ball "
"continues, indefinitely, in free fall."
msgstr ""
"之前仿真里的问题是，每次球反弹时，\\ `h`\\ 的峰值都会有些下降。\ "
"这里峰值是指，球即将开始再次下降时\\ `h`\\ 的值。\ "
"最终，\\ `h`\\ "
"峰值不足以超过该临界值\\ :math:`\\epsilon`\\ 。\ "
"反过来，这意味着\\ ``when``\\ 语句从未触发以及\\ ``"
"reinit``\\ 语句不会再重置\\ ``v``\\ 。\ "
"结果是球在继续不停地自由下落"

#: ../../source/behavior/discrete/bouncing.rst:147
msgid ""
"So this raises the obvious question of how to achieve the behavior we truly "
"intended (which is that the ball never drops below the surface).  For that, "
"we have to make a few minor changes to our model as follows:"
msgstr "所以一个显然的问题就是，如何实现我们真正的目标行为（球永远不会降到地面以下）。\ "
"因此，我们必须对模型进行如下的一些小改动，："

#: ../../source/behavior/discrete/bouncing.rst:157
msgid ""
"It should be noted that there are many ways to solve this problem. The "
"solution presented here is only one of them.  In this approach, we have "
"effectively created two surfaces.  One at a height of ``0`` and the other at"
" a height of ``-eps`` (just below ``0``).  When the ball is bouncing "
"\"normally\" it will only trigger the first condition in our ``when`` "
"statement.  If, however, the ball does not rebound high enough after contact"
" and \"falls through\" the first surface, we detect that (and the fact that "
"it has fallen through) and set the ``done`` flag. The effect of the ``done``"
" flag is to effectively turn off gravity."
msgstr ""
"应该指出的是，许多方法都可以用以解决这个问题。\ "
"这里提出的解决方案仅是其中之一。\ "
"在这种方法中，我们实际上创建了两个表面。\ "
"其中一个在\\ ``0``\\ "
"的高度上，另一个在一个高度\\ ``-eps``\\ （略低于\\ ``0``\\ ）。\ "
"球“正常地”弹起时只会触发\\ ``when``\\ "
"语句的首个条件。\ "
"然而，如果球在触地后不能足够高地回弹，从而“穿过”中的第一表面。\ "
"我们检测到这点（以及球已经穿过的事实），并设置\\ ``done``\\ "
"标志符。\ "
"\ ``done``\\ 标志符的效果实际上就是关闭重力。\ "

#: ../../source/behavior/discrete/bouncing.rst:173
msgid ""
"In particular, note that it doesn't have just one conditional expression, "
"**but two**.  More specifically, it actually has a vector of conditional "
"expressions.  We'll introduce :ref:`vectors-and-arrays` later in the book, "
"but for now it is just important to point out that in this chapter we have "
"shown that a `when` can include either a scalar conditional expression or a "
"vector of conditional expressions."
msgstr ""
"特别是要注意，这个语句不只有一个条件表达式，\\ **而是两个**\\ 。\ "
"更准确地说，它实际上有向量形式的条件表达式。\ "
"在本书的后面我们会介绍\\ :ref"
":`vectors-and-arrays`\\ ，但在本章我们必须指出\\ `when`\\ 既可以包含一个标量条件表达式，也可以包含矢量条件表达式。\ "

#: ../../source/behavior/discrete/bouncing.rst:180
msgid ""
"If a ``when`` statement includes a vector of conditionals, then the "
"statements of the when statement will be triggered when **any** conditional "
"expression in the vector **becomes true**.  Note the grammar of this "
"explanation carefully.  It is very common for people to read Modelica code "
"like this:"
msgstr ""
"如果一个\\ ``when``\\ 语句包含矢量条件表达式，那么当\\ **任意一个**\\ 条件表达式\\ **为真**\\ 时便会触发\\ "
"``when``\\ 语句内的语句。\ "
"请仔细注意这断解释的语法。\ "
"人们很有可能把如下形式Modelica代码："

#: ../../source/behavior/discrete/bouncing.rst:192
msgid ""
"as \"when a is greater than zero **or** b is greater than zero\".  But it is"
" **very important** not to make the very common mistake of misinterpreting "
"this to mean that the following two ``when`` statements are equivalent:"
msgstr ""
"理解为“当a大于零\\ **或**\\ b大于零”。\ "
"\\ **非常重要**\\ 的是要避免一个十分常见的错误，即误认为以下两个\\ ``when``\\"
" 语句是等价的："

#: ../../source/behavior/discrete/bouncing.rst:207
msgid ""
"**These are not equivalent**.  To understand the difference, let's change "
"the conditional expressions as follows:"
msgstr "\ **这两者并不等价的**\\ 。\ "
"为了理解上述差异，我们把条件表达式改为如下形式："

#: ../../source/behavior/discrete/bouncing.rst:220
msgid ""
"Remember our original statement that the vector notation for ``when`` "
"statements means that the statements in the when statement are triggered "
"when **any** condition becomes true.  Assuming we run a simulation that "
"starts at ``time=0`` and runs until ``time=3``, then the ``when`` statement:"
msgstr ""
"还记得我们之前对\\ ``when``\\ 语句中矢量表达式的陈述：当\\ **任意一个**\\ 条件表达式为真时便会触发\\ ``when``\\ "
"语句内的语句。\ "
"假设我们从\ ``time= 0``\\ 开始运行仿真，直到\\ ``time=3``\\ ，那么\\ ``when``\\ 语句："

#: ../../source/behavior/discrete/bouncing.rst:232
msgid ""
"will be triggered **twice**.  Once when ``time>1`` becomes true and the "
"other when ``time>2`` becomes true.  In contrast, in this case:"
msgstr "会被\\ **两次**\\ 触发。\ "
"第一次在当\\ ``time>1``\\ 为真时。\ "
"另一次在\\ ``time>2``\\ 为真时。\ "
"与此相反，在这种情况下："

#: ../../source/behavior/discrete/bouncing.rst:241
msgid ""
"there is only a **single** conditional expression and it becomes true **only"
" once** (when ``time>1`` becomes true...and stays true).  The ``or`` "
"operator essentially masks the second conditional, ``time>2``, such that it "
"may as well not even be present in this particular case. In other words, "
"this conditional only **becomes true** once.  As a result, the statements "
"inside the ``when`` statement are only triggered once."
msgstr ""
"仅存在\\ **一个**\\ 条件表达式，且这个表达式\\ **仅仅一次**\\ 变为真（当\\ ``time>1``\\ 为真﹍﹍并保持为真）"
"。\ "
"``or``\\ 操作符实际上屏蔽了第二项条件\\ ``time>2``\\ "
"，使得第二项条件在此情况下甚至可以不存在。\ "
"换句话说，该条件仅一次\\ "
"**变为真**\\ 。\ "
"其结果是，在\ ``when``\\ 语句中的语句仅被触发一次。\ "

#: ../../source/behavior/discrete/bouncing.rst:249
msgid ""
"The key thing to remember is that for ``when`` statements, a vector of "
"conditionals means **any, not or**.  Furthermore, the statements are only "
"active at the instant when the conditional **becomes true**.  The "
"implications of this last statement will be discussed in greater details "
"later in this chapter when we talk about the important differences between "
":ref:`if-vs-when`."
msgstr ""
"关键是要记住的是，对于\\ ``when``\\ 语句，向量条件表示\\ **任何，而非逻辑或**\\ 。\ "
"此外，该语句仅在条件\\ **变为真**\\"
" 的瞬间被激活。\ "
"我们会在本章的后面部分讨论\\ :ref:`if-vs-when`\\ 之间的重要区别时，进一步探讨最后这句话的含义。\ "

#: ../../source/behavior/discrete/bouncing.rst:167
msgid "Note the syntax of the ``when`` statement in this case:"
msgstr "注意这里\ ``when``\ 语句的语法："
