#
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: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\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/components/components/component_models.rst:4
msgid "Component Models"
msgstr "组件模型"

#: ../../source/components/components/component_models.rst:6
msgid ""
"In this section, we'll summarize how component models are different from the"
" previous models we've created.  This discussion will be broken into two "
"parts.  The first part will focus on acausal modeling and how it provides a "
"framework for schematic-based, component-oriented modeling where "
"conservation equations are automatically generated and enforced.  The second"
" part will provide an overview of how the topics in this chapter impact, "
"mostly syntactically, the definition of component models."
msgstr ""
"本节我们将总结组件模型与此前创建的模型有何不同。\ "
"这里讨论将分为两部分。\ "
"第一部分将着眼于非因果建模。\ "
"要如何才能为基于概要、面向组件的建模提供一个框架。\ "
"这样，模型才能自动生成以及遵从守恒方程。\ "
"第二部分将概述本章的主题会如何（主要是语法上）影响组件模型的定义。\ "

#: ../../source/components/components/component_models.rst:15
msgid ""
"However, before we dive into that discussion, it is worth taking some time "
"to talk about terminology.  In this chapter, we've created two different "
"types of models.  The first type represent individual effects (*e.g.,* "
"resistors, capacitors, springs, dampers).  The other type represent more "
"complex assemblies (*e.g.,* circuits, mechanisms)."
msgstr ""
"不过，我们在深入讨论前，值得花些时间讨论术语。\ "
"本章我们已经创建了两种不同类型的模型。\ "
"第一种表示单独的效果（例如电阻、电容、弹簧、阻尼器）。\ "
"另一种代表更复杂的组件（如电路、机制）。\ "

#: ../../source/components/components/component_models.rst:21
msgid ""
"Before we discuss some of the differences between these different types of "
"models, let's introduce some terminology so we can refer to them precisely."
"  A *component model* is a model that is used to encapsulate equations into "
"a reusable form.  By creating such a model, an instance of the component can"
" be used in place of the equations it contains.  A *subsystem model* is a "
"model that is composed of components or other subsystems.  In other words, "
"it doesn't (generally) include equations.  Instead, it represents an "
"assembly of other components.  Typically, these subsystem models are created"
" by dragging, dropping and connecting component and other subsystem models "
"schematically.  While component models are \"flat\" (they don't contain "
"other components or subsystems, only equations), subsystem models are "
"hierarchical."
msgstr ""
"而在讨论这些不同类模型间的差异前，下面我们来介绍一些术语以便能进行准确表述。\ "
"\\ *组件模型*\\ "
"是以可重用形式封装方程的模型。\ "
"通过建立这样的模型，组件的实例就代替其所封装方程用在同样的位置。\ "
"\\ *子系统模型*\\ "
"是由组件或其他子系统组成的模型。\ "
"换句话说，子系统模型（一般）不包括方程。\ "
"相反，它表示的是其它部件的总成。\ "
"通常情况下，这些子系统模型通过在示意图内拖拽、连接部件模型以及子系统模型而创建的。\ "
"组件模型是“无层级的”（不包含其他组件或子系统，只有方程）。\ "
"相对地，子系统模型则是分层的。\ "

#: ../../source/components/components/component_models.rst:35
msgid ""
"We'll often refer to a subsystem model as a *system model*.  A system model "
"is a model that we expect to simulate.  In simulating it, the Modelica "
"compiler will traverse the hierarchy of the model and note all the variables"
" and equations present throughout the hierarchy. These are the variables and"
" equations that will be used in the simulation.  Of course, in order for "
"there to be a unique solution, the system model (like any non-``partial`` "
"model), must be :ref:`balanced <balanced-components>`."
msgstr ""
"我们会经常会将子系统模型称作为\\ *系统模型*\\ "
"。\ "
"系统模型是预期用于进行仿真的模型。\ "
"在仿真时，Modelica语言编译器会遍历模型的层次结构。\ "
"然后，编译器会记下层次结构内的所有变量和方程式。\ "
"这些都是将在仿真中使用的变量和方程式。\ "
"当然，为了使其存在于唯一解，该系统模型（如同任何非\\"
" ``partial``\\ 模型一样）必须是\\ :ref:`\\ 平衡的\\ <balanced-components>`\\ 。\ "

#: ../../source/components/components/component_models.rst:44
msgid ""
"Note that a subsystem model *can* include equations.  There is no rule "
"against it in Modelica.  But most of the time models tend to be composed "
"either of equations or other components/subsystems.  It is actually a good "
"idea to avoid putting equations in models containing subcomponents or "
"subsystems because doing so means that some information about the model will"
" be \"invisible\" when looking at a diagram of the subsystem.  One possible "
"exception to this could be the use of ``initial equation`` sections in "
"subsystems."
msgstr ""
"请注意，子系统模型\\ *可以*\\ "
"包括方程式。\ "
"Modelica并没有规则禁止这样做。\ "
"但是，大部分时候，模型倾向于或由方程，或由其他部件/子系统组成。\ "
"避免在包含子组件或子系统的模型里放入方程其实是个好主意。\ "
"因为这样做意味着在看子系统的示意图时，有关模型的某些信息将“看不见”。\ "
"规则的其中一个例外是子系统中的\\"
" ``initial equation``\\ 区域。\ "

#: ../../source/components/components/component_models.rst:53
msgid ""
"With that discussion of terminology out of the way, let's dive into "
"discussions about component models."
msgstr "现在我们完成了对术语的讨论。\ "
"那么，我们开始深入讨论组件模型。\ "

#: ../../source/components/components/component_models.rst:59
msgid "Acausal Modeling"
msgstr "非因果建模"

#: ../../source/components/components/component_models.rst:61
msgid ""
"We'll start with a discussion about acausal modeling.  We touched on this "
"topic very briefly in the chapter on :ref:`connectors`.  Here we will "
"provide a more comprehensive discussion about acausal modeling."
msgstr "首先，我们会讨论非因果建模。\ "
"我们在\\ :ref:`connectors`\\ 一章简单谈到了这个话题。\ "
"在这里，我们将更全面地讨论非因果建模。\ "

#: ../../source/components/components/component_models.rst:66
msgid "Composability"
msgstr "可组合性"

#: ../../source/components/components/component_models.rst:68
msgid ""
"There are two very big advantages to acausal modeling.  The first is "
"composability.  In this context, composability means the ability to drag, "
"drop and connect component instances in nearly any configuration we wish "
"without having to concern ourselves with \"compatibility\". This is because "
"acausal connectors are designed around the idea of physical compatibility, "
"not causal compatibility.  This is possible because acausal connector "
"definitions focus on physical information exchanged, not the direction that "
"information flows. The result is that we can create component models around "
"the idea of physical interactions without requiring any *a priori* knowledge"
" about the nature (*i.e.,* directionality) of the information exchange."
msgstr ""
"非因果建模有两个非常大的优势。\ "
"第一个是可组合性。\ "
"在这里，可组合性是指我们能够将组件实例拖放并连接成几乎任何想要的配置。\ "
"同时，在此过程中我们也无需担心“兼容性”。\ "
"原因在于，非因果连接器的设计基础是物理兼容性，而非因果兼容性。\ "
"这是可能的。\ "
"因为非因果连接器的定义着眼于物理信息的交换，而非信息流的方向。\ "
"其结果是，我们可以创建一个基于物理相互作用的组件模型，而无需任何关于信息交流性质（即方向性）的先验知识。\ "

#: ../../source/components/components/component_models.rst:80
msgid ""
"But there are other implications to this composability.  Not only can we "
"easily create systems by dragging, dropping and connecting components, but "
"we can also easily reconfigure them.  Replacing a voltage source in an "
"electrical circuit with a current source can have a profound impact on the "
"mathematical representation of that system (*e.g.,* if the system is "
"represented as a block diagram).  But such a change has no significant "
"impact when using an acausal approach. Although the underlying mathematical "
"representation still changes, sometimes profoundly, there is no impact on "
"the user, because that representation is generated automatically as part of "
"the compilation process."
msgstr ""
"但可组合性也有其他的影响。\ "
"我们不仅可以轻松通过通过拖放、连接组件去创建系统，但同时也可以很容易进行重新配置。\ "
"将电路中的电流源替换为电压源会对系统的数学产生深远的影响（例如在系统表示框图时）。\ "
"但在使用非因果方法建模时，这样的变化不会带来显著的影响。\ "
"虽然底层的数学表达仍会改变，乃至会大量改变。\ "
"但是，这对用户却无任何影响。\ "
"因为数学表达是自动的编译过程中自动产生的。\ "

#: ../../source/components/components/component_models.rst:94
msgid ""
"Finally, another aspect of composability is in the support for multi-domain "
"systems.  In fact, Modelica not only supports different engineering domains "
"(electrical, thermal, hydraulic), it supports multiple modeling formalisms."
"  Model developers have created libraries for block diagrams, state charts, "
"petri nets, *etc.* Instead of requiring special tools or editors in each "
"case, all of these different domains and formalisms can be freely combined "
"in Modelica as appropriate."
msgstr ""
"最后，可组合的另一个特性在对于多领域系统的支持。\ "
"事实上，Modelica语言不仅支持不同工程领域（电、热、液压），它也支持多种建模的形式。\ "
"模型开发者创建了框图、状态机、Petri网等不同的模型苦库相对于在不同情况下使用特殊工具或编辑器，所有这些不同的领域和表述均可在Modelica里自由组合。\ "

#: ../../source/components/components/component_models.rst:106
msgid "Accounting"
msgstr "核算"

#: ../../source/components/components/component_models.rst:111
msgid "Connectors"
msgstr "连接器"

#: ../../source/components/components/component_models.rst:113
msgid ""
"The other advantage of acausal modeling is the amount of automatic "
"\"accounting\" performed with this approach.  To understand exactly what "
"accounting is performed, let's consider the following rotational "
"``connector`` definitions from the Modelica Standard Library:"
msgstr ""
"非因果建模的另一个优点在于它会自动进行大量的核算。\ "
"要明白这里进行了什么核算，让我们考虑以下Modelica标准库的旋转\\ "
"``connector``\\ 定义："

#: ../../source/components/components/component_models.rst:132
msgid ""
"As we've discussed previously, an acausal connector includes two different "
"types of variables, across variables and through variables. The through "
"variable is indicated by the presence of the ``flow`` qualifier.  In the "
"case of the ``Rotational`` connector, the across variable is ``phi``, the "
"angular position, and the through variable is ``tau``, the torque."
msgstr ""
"正如我们前面所讨论的，一个非因果连接器包括两种不同类型的变量：横跨变量及穿越变量。\ "
"穿越变量前带有\\ ``flow``\\ 限定词。\ "
"对于\\ "
"``Rotational``\\ 连接器而言，横跨变量是角位置\\ ``phi``\\ ，而穿越变量则是扭矩\\ ``tau``\\ 。\ "

#: ../../source/components/components/component_models.rst:140
msgid "Sign Conventions"
msgstr "正负号规则"

#: ../../source/components/components/component_models.rst:142
msgid ""
"Also recall from our previous discussion that Modelica models should observe"
" the following convention: a positive value for the ``flow`` variable on a "
"connector represents the flow of that quantity **into** the component that "
"the connector is connected to.  This is an important sign convention not "
"only because it make sure all the accounting is correct, but it also helps "
"with composability as well by allowing (inherently symmetric) components "
"like springs, dampers, *etc.* to be flipped over and still function "
"identically."
msgstr ""
"另外，回想前面讨论Modelica模型应遵守以下约定：连接器里穿越变量的正值表示物理量在流\\ **入**\\ "
"与连接器相连的组件。\ "
"这是一个重要的正负号惯例。\ "
"不仅因为惯例确保了所有核算的正确性。\ "
"而且该惯例会增加可组合性。\ "
"因为这可以令（本质上对称的）组件，如弹簧、减震器等，在进行翻转后仍然有相同的功能。\ "

#: ../../source/components/components/component_models.rst:156
msgid "Connection Sets"
msgstr "连接集合"

#: ../../source/components/components/component_models.rst:158
msgid ""
"Before we can get into the details of the accounting performed by the "
"compiler, we need to introduce the concept of a *connection set*.  To "
"demonstrate what a connection set is, consider the following schematic:"
msgstr "在我们介绍编译器所执行核算的细节前，我们需要引入一个\\ *连接集*\\ 的概念。\ "
"而为了介绍什么是连接集，请考虑以下的示意图："

#: ../../source/components/components/component_models.rst:168
msgid "Note that there are 8 connections in this model:"
msgstr "请注意，该模型有8条连接："

#: ../../source/components/components/component_models.rst:182
msgid ""
"If two connect statements have one connector in common, **they belong to the"
" same connection set**.  If a connector is not connected to any other "
"connectors, then it belongs to a connection set that includes only itself.  "
"Using this rule, we can organize the connectors into connection sets as "
"follows:"
msgstr ""
"如果两条连接语句内有一个共同的连接器，\\ **它们就属于相同的连接集**\\ "
"。\ "
"如果一个连接器未连接到任何其他连接器，那么它就属于一个仅包含其本身的连接集。\ "
"使用这个规则，我们可以组织连接器插入连接集如下："

#: ../../source/components/components/component_models.rst:188
msgid "Connection Set #1"
msgstr "连接集#1"

#: ../../source/components/components/component_models.rst:190
msgid "``ground.flange_a``"
msgstr ""

#: ../../source/components/components/component_models.rst:191
msgid "``damper2.flange_b``"
msgstr ""

#: ../../source/components/components/component_models.rst:192
msgid "``spring2.flange_b``"
msgstr ""

#: ../../source/components/components/component_models.rst:194
msgid "Connection Set #2"
msgstr "连接集#2"

#: ../../source/components/components/component_models.rst:196
msgid "``damper2.flange_a``"
msgstr ""

#: ../../source/components/components/component_models.rst:197
msgid "``spring2.flange_a``"
msgstr ""

#: ../../source/components/components/component_models.rst:198
msgid "``inertia2.flange_b``"
msgstr ""

#: ../../source/components/components/component_models.rst:200
msgid "Connection Set #3"
msgstr "连接集#3"

#: ../../source/components/components/component_models.rst:202
msgid "``inertia2.flange_a``"
msgstr ""

#: ../../source/components/components/component_models.rst:203
msgid "``damper1.flange_b``"
msgstr ""

#: ../../source/components/components/component_models.rst:204
msgid "``spring1.flange_b``"
msgstr ""

#: ../../source/components/components/component_models.rst:206
msgid "Connection Set #4"
msgstr "连接集#4"

#: ../../source/components/components/component_models.rst:208
msgid "``inertia1.flange_b``"
msgstr ""

#: ../../source/components/components/component_models.rst:209
msgid "``damper1.flange_a``"
msgstr ""

#: ../../source/components/components/component_models.rst:210
msgid "``spring1.flange_a``"
msgstr ""

#: ../../source/components/components/component_models.rst:212
msgid "Connection Set #5"
msgstr "连接集#5"

#: ../../source/components/components/component_models.rst:214
msgid "``inertia1.flange_a``"
msgstr ""

#: ../../source/components/components/component_models.rst:216
msgid ""
"Note that these connection sets appear from right to left in the diagram.  "
"It may be useful to take the time to match the connectors in the diagram "
"with those listed in the connection sets to understand what a connection set"
" intuitively is.  Note that the ``flange_a`` connectors are filled circles "
"whereas the ``flange_b`` ones are only outlined."
msgstr ""
"请注意，这些连接集在图中由右至左出现。\ "
"为了直观理解连接集，大家或者可以花时间将连接集内部件与模型简图一一对应。\ "
"需要注意，\\ "
"``flange_a``\\ 连接器是实心圆，而\\ ``flange_b``\\ 则为空心圆。\ "

#: ../../source/components/components/component_models.rst:224
msgid "Generated Equations"
msgstr "生成方程"

#: ../../source/components/components/component_models.rst:226
msgid ""
"This is where the \"accounting\" starts.  For each connection **set**, "
"special equations are automatically generated.  The first set of automatic "
"equations are related to the across variables.  We need to impose the "
"constraint, mathematically speaking, that all across variables must have the"
" same value.  Furthermore, we also introduce an equation that states that "
"the sum of all through variables in the connection set must sum to zero."
msgstr ""
"这就是“核算”的开始。\ "
"每个连接\\ **集**\\ "
"都会自动生成特殊的公式。\ "
"第一组自动方程都涉及到横跨变量。\ "
"我们需要施加约束。\ "
"从数学上讲，所有的横跨变量必须具有相同的值。\ "
"此外，我们还会引入了一个公式。\ "
"该公式会指出，连接集内所有穿越变量的总和必须为零。\ "

#: ../../source/components/components/component_models.rst:234
msgid ""
"In the case of the connection sets above, the following equations will be "
"automatically generated:"
msgstr "对应上述连接集，有下列的自动生成公式："

#: ../../source/components/components/component_models.rst:272
msgid ""
"Note that for an empty connection set (*i.e.,* Connection Set #5), there is "
"only one across variable in the set, so no equality equations are generated."
"  The conservation equation is still generated but it contains only one "
"term.  So it amounts to a statement that nothing can flow out of an "
"unconnected connector.  This makes intuitive physical sense as well."
msgstr ""
"请注意，对于一个空连接集（即连接集＃5），由于集合中只有一个横跨变量，所以不产生描述相等关系的方程。\ "
"守恒方程仍会产生。\ "
"但方程仅包含一项。\ "
"因此，方程相当于声明了一点。\ "
"亦即，一个未连接的连接器内不会有任何量流出来。\ "
"这也符合我们的物理直觉。\ "

#: ../../source/components/components/component_models.rst:279
msgid ""
"What does all this mean physically?  In the case of an electrical "
"connection, this implies that each connection can be treated as a \"perfect "
"short\" between the connectors.  In the case of a mechanical system, "
"connections are treated as perfectly rigid shafts with zero inertia.  The "
"bottom line is that a connection means that the across variables on each "
"connector will be equal and that any conserved quantity that leaves one "
"component must enter another one.  Nothing can get lost or stored between "
"components."
msgstr ""
"这一切有何物理意义？对于电路连接，这意味着每个连接都可以被视为连接器之间的“完美短路”。\ "
"对于机械系统，连接则可被视为零惯性的完全刚性轴。\ "
"总而言之，连接意味着每个连接器上的横跨变量均相等。\ "
"而且，离开任何一个组件的守恒量必须进入另一个组件。\ "
"没有任何守恒量会在组件间消失或者被储存。\ "

#: ../../source/components/components/component_models.rst:289
msgid "Conservation"
msgstr "守恒"

#: ../../source/components/components/component_models.rst:291
msgid ""
"There are two important consequences to these equations.  The first is that "
"the ``flow`` variable is automatically conserved.  Typical ``flow`` "
"variables are current, torque, mass flow rate, etc.  Since these are all the"
" time derivative of a conserved quantity (*i.e.,* charge, angular momentum "
"and mass, respectively), such equations are automatically conserving these "
"quantities."
msgstr ""
"这些方程造成两个重要的结果。\ "
"首先，\\ ``flow``\\ 变量自然而然守恒。\ "
"典型的\\ ``flow``\\ "
"变量是电流、扭矩、质量流率等等。\ "
"因为这些量全部都是守恒量（即各为电荷、角动量和质量）的时间导数，上述公式令自动这些量自动守恒了。\ "

#: ../../source/components/components/component_models.rst:298
msgid ""
"But something else is being implicitly conserved as well. Specifically, **we"
" can ensure that energy is conserved** as well.  For all of these domains, "
"the power flow through a connector can be represented by the product of the "
"through variable and either the across variable or a derivative of the "
"across variable.  As a result, for each domain we can easily derive a power "
"conservation equation from the equations automatically generated for the "
"connection set. From our example above, we know that in the first connection"
" set we have the following equations:"
msgstr ""
"但是，还有其他的量隐式地保持了守恒。\ "
"具体来说，\\ **我们**\\ 还\\ **可以保证能量守恒**\\ "
"。\ "
"对于所有这些领域，通过连接器的功率流都可以表示为穿越变量与横跨变量或其导数之积。\ "
"其结果是，对于每个领域，利用由连接集自动生成的方程，我们可以很容易地推导出功率守恒方程。\ "
"从上面的例子中我们知道，对第一个连接集我们有以下公式："

#: ../../source/components/components/component_models.rst:314
msgid ""
"If we multiply the last equation by ``der(ground.flange_a.phi)``, the "
"angular velocity of the ``ground.flange_a`` connector, we get:"
msgstr ""
"如果我们将最后一条方程与\\ ``ground.flange_a``\\ 连接器的角速度\\ "
"``der(ground.flange_a.phi)``\\ 相乘，我们得到："

#: ../../source/components/components/component_models.rst:323
msgid ""
"However, we also know that all the across variables in the connection set "
"are equal.  As a result, their derivatives must also be equal. This means "
"that we can substitute any one of them for another.  Making two such "
"substitutions yields:"
msgstr ""
"不过，我们也知道，连接集内的所有跨越变量是相等的。\ "
"所以，其导数也必定相等。\ "
"这意味着我们可以用其中一个替换其他的任何一个。\ "
"做两次这样的替换，我们得到："

#: ../../source/components/components/component_models.rst:334
msgid ""
"The first term in the equation above is the power flowing into the "
"``ground`` component through ``flange_a``.  The second term is the power "
"flowing into the ``damper2`` component through ``flange_b``. The last term "
"is the power flowing into the ``spring2`` component through ``flange_b``.  "
"Since these represent the power flowing through all connectors in the "
"connection set, this implies that power is conserved by that connection set "
"(*i.e.,* all power that flows out of one component must flow into another, "
"nothing is lost or stored)."
msgstr ""
"上式中的第一项就是通过\\ ``flange_a``\\ 流入\\ ``ground``\\ 组件的功率。\ "
"第二项是通过\\ ``flange_b``\\"
" 流入\\ ``damper2``\\ 组件的功率。\ "
"最后一项是通过\\ ``flange_b``\\ 流入\\ ``spring2``\\ "
"组件的功率。\ "
"由于这些代表了连接集内所有连接器中流动的功率， 这意味着功率在连接集内守恒（即流出一个组件的所有功率必须流入另一个，没有丢失或被存储）。\ "

#: ../../source/components/components/component_models.rst:346
msgid "Balanced Components"
msgstr "平衡的组件"

#: ../../source/components/components/component_models.rst:352
msgid ""
"If we look carefully at the previous discussion on equations generated "
"involving acausal variables in connection sets, we'll see something very "
"interesting.  But to see it, we first need to review a few things we've "
"learned about connectors and connector sets:"
msgstr ""
"如果仔细观察前面的讨论，我们会在连接集内所生成的涉及非因果变量的方程式里发现一些有趣的点。\ "
"但要看到这些点，我们首先需要重温我们此前对连接器和连接集的几个认识："

#: ../../source/components/components/component_models.rst:357
msgid "A connection can only belong to one connection set."
msgstr "一条连接只能从属于一个连接集。\ "

#: ../../source/components/components/component_models.rst:358
msgid ""
"As we learned in our previous discussion on :ref:`acausal-vars`, for every "
"through variable in a connector (*i.e.,* a variable declared with the "
"``flow`` qualifier), there must be a matching across variable (*i.e.,* a "
"variable without any qualifier)."
msgstr ""
"我们在前面讨论了\\ :ref:`acausal-vars`\\ 。\ "
"所以我们知道，每一个连接器内的穿越变量（即声明时带有\\ ``flow``\\ "
"限定词的变量），必须匹配一个横跨变量（即没有任何限定词的变量）。\ "

#: ../../source/components/components/component_models.rst:362
msgid ""
"The number of equations generated in a connection set is equal to the number"
" of connectors in the connection set multiplied by the number of through-"
"across pairs in the connector."
msgstr "连接集产生的方程数等于连接组的连接器数乘以穿越－横跨变量对的数目。\ "

#: ../../source/components/components/component_models.rst:366
msgid ""
"Remember that acausal variables come in pairs.  Equations for half of those "
"variables (one per pair) will be generated automatically via connections.  "
"That means the remaining half of the equations must come from the component "
"models themselves."
msgstr ""
"记得非因果变量是成对出现的。\ "
"这些变量所需的一半方程会自动通过连接产生（每对变量会生成一个方程）。\ "
"这意味着变量所需的一半方程必须来自组件模型本身。\ "

#: ../../source/components/components/component_models.rst:371
msgid ""
"Keep in mind that this discussion is focused only on acausal variables in "
"connectors.  We also need to take into account two other cases:"
msgstr "请记住，这里的讨论仅仅是关于连接器内的非因果变量。\ "
"我们还需要考虑两种其他情况："

#: ../../source/components/components/component_models.rst:374
msgid ""
"Variables declared within a component model (as opposed to on a connector)."
msgstr "组件模型内声明的变量（而不是在连接器上的）。\ "

#: ../../source/components/components/component_models.rst:376
msgid ""
"Causal variables on connectors (*i.e.,* those qualified by either ``input`` "
"or ``output``)."
msgstr "连接器上的因果变量（即前面带有\\ ``input``\\ 或\\ ``output``\\ 限定词的变量）。\ "

#: ../../source/components/components/component_models.rst:379
msgid ""
"Modelica requires that any non-``partial`` model be balanced.  But what does"
" that mean?  It means that the component should provide the proper number of"
" equations (no more and no less than necessary).  The question is how to "
"compute the number of equations required?"
msgstr ""
"Modelica的要求任何非\\ ``partial``\\ "
"模型均为平衡的。\ "
"但这是什么意思？这意味着组件应该提供正确数量的方程（不比需要的更多，也不更少）。\ "
"现在的问题是，如何计算所需方程的数目？"

#: ../../source/components/components/component_models.rst:384
msgid ""
"We already have a start based on our discussion about acausal variables.  "
"Since half of the equations needed for acausal variables come from generated"
" equations, the other half must come from within component models containing"
" these connectors.  Specifically, the component must provide one equation "
"for every through-across pair in each of its connectors.  In addition, it "
"should also provide one equation for every variable on its connectors that "
"has the ``output`` qualifier (note, the component does not have to provide "
"equations for any variables on its connectors with the ``input`` qualifier)."
"  The rationale here is that a component can assume that all ``input`` "
"signals are known (specified externally) and that it is responsible for "
"computing any ``output`` signals it advertises.  Finally, any "
"(non-``parameter``) variable declared within the component must also have an"
" equation."
msgstr ""
"我们在对非因果变量的讨论里已经有了一定的基础。\ "
"由于非因果变量所需的一半方程来自自动生成的方程，另一半方程必须来自含有这些连接器的组件模型之内。\ "
"具体来说，该组件必须为其连接器的穿越－横跨变量对提供一个方程式。\ "
"此外，组件还应该为其连接器具有\\"
" ``output``\\ 限定词的变量提供一个方程式（注意，该组件不需为其连接器具有\\ ``input``\\ "
"限定词的变量提供方程）。\ "
"其理由是，组件可以假定所有\\ ``input``\\ 信号均为已知（由外部指定）。\ "
"另外，组件要负责计算其声明的任何\\ "
"``output``\\ 信号。\ "
"最后，组件内声明的任何（非\\ ``parameter``\\ ）变量也必须对应一个公式。\ "

#: ../../source/components/components/component_models.rst:399
msgid ""
"In summary, the number of equations that a component must provide is the sum"
" of:"
msgstr "总之，组件必须提供的方程式数总和为："

#: ../../source/components/components/component_models.rst:402
msgid "The number of through-across pairs across all its connectors"
msgstr "其所有连接器内穿越－横跨变量对的数目"

#: ../../source/components/components/component_models.rst:403
msgid ""
"The number of non-``parameter`` variables declared in the component model."
msgstr "声明中的组件模型的非\\ ``parameter``\\ 变量的数目。\ "

#: ../../source/components/components/component_models.rst:405
msgid "The number of ``output`` variables across all its connectors."
msgstr "其所有连接器内\\ ``output``\\ 变量的数目。\ "

#: ../../source/components/components/component_models.rst:407
msgid ""
"Note that these equations can (and frequently do) originate in a ``partial``"
" model that is inherited."
msgstr "请注意，这些方程可以（而且经常确实是）来自其继承的\\ ``partial``\\ 模型。\ "

#: ../../source/components/components/component_models.rst:410
msgid ""
"If the number of equations provided by a component equals the number of "
"equations required, then the component model is said to be **balanced**."
msgstr "如果由组件所提供的方程数等于所需方程数，则该组件模型就成为是\\ **平衡的**\\ 。\ "

#: ../../source/components/components/component_models.rst:415
msgid "Component Definitions"
msgstr "组件定义"

#: ../../source/components/components/component_models.rst:417
msgid ""
"In this chapter we've discussed how to create component models. "
"Fundamentally, nothing has changed since we first discussed what a :ref"
":`model-definition` should include.  But it is worth emphasizing a few "
"things about component models."
msgstr ""
"本章里，我们讨论了如何创建组件模型。\ "
"我们此前讨论了\\ :ref:`model-definition`\\ "
"应该包括的内容。\ "
"而这一切从一开始就都没有改变，但关于组件模型有几件事情值得强调。\ "

#: ../../source/components/components/component_models.rst:423
msgid "Blocks"
msgstr "模块"

#: ../../source/components/components/component_models.rst:427
msgid ""
"First, in the discussion on :ref:`block-components` we introduced the idea "
"of a ``block``.  A ``block`` is a special kind of ``model`` where the "
"connectors contain only ``input`` and ``output`` signals."
msgstr ""
"首先，在讨论\\ :ref:`block-components`\\ 的时候，我们介绍了\\ ``block``\\ 这种建模方法。\ "
"\\ ``block``\\ 是一种特殊的\\ ``model``\\ 。\ "
"这种模型的连接器只包含\\ ``input``\\ 和\\ ``output``\\ 的信号。\ "

#: ../../source/components/components/component_models.rst:432
msgid "Conditional Variables/Connectors"
msgstr "有条件出现的变量/连接器"

#: ../../source/components/components/component_models.rst:434
msgid ""
"Another thing we saw in our discussion of the :ref:`optional-ground-"
"connector` was the ability to make a declaration conditional.  The "
"expression on which the conditional declaration depends cannot change as a "
"function of time (*i.e.,* the variable cannot appear and disappear during "
"the simulation).  Instead, it must be a function of parameters and constants"
" so that the compiler or simulation runtime can determine whether the "
"variable should be present prior to simulation.  As we saw, the syntax for "
"such a declaration is:"
msgstr ""
"我们对\\ :ref:`optional-ground-connector`\\ "
"的讨论中看到了另外一点。\ "
"这就是条件声明。\ "
"条件声明的条件表达式不能为时间的函数（即变量不能出现并在模拟期间消失）。\ "
"相反，表达式必须是参数和常量的函数。\ "
"这样编译器或仿真程序可以在仿真运行前判断变量是否应该存在。\ "
"正如我们所看到的，这样的声明语法如下："

#: ../../source/components/components/component_models.rst:448
msgid ""
"In other words, by including the ``if`` keyword and a conditional expression"
" immediately after the name of the variable (and any modifications that are "
"applied to the variable), we can make the declaration of that variable "
"conditional.  When the conditional expression is ``true``, the conditional "
"variable will be present. When it is ``false``, it will not be present."
msgstr ""
"换句话说，通过紧接着变量名称（以及添加到变量上的所有修改语句）添加\\ ``if``\\ "
"关键字条件表达式，就可以使该变量声明变为有条件出现的。\ "
"当条件表达式为\\ ``true``\\ ，有条件出现的变量才会存在。\ "
"当条件表达式为\\ "
"``false``\\ 时，该变量就不会存在。\ "

#: ../../source/components/components/component_models.rst:456
msgid "Model Limitations"
msgstr "模型的适用范围"

#: ../../source/components/components/component_models.rst:461
msgid "``assert``"
msgstr ""

#: ../../source/components/components/component_models.rst:465
msgid ""
"To understand how to enforce model limitations, we must first explain the "
"``assert`` function.  The syntax of a call to the ``assert`` function is:"
msgstr "要了解如何防止模型离开其适用范围，首先我们要解释一下\\ ``assert``\\ 函数。\ "
"调用\\ ``assert``\\ 函数的语法是："

#: ../../source/components/components/component_models.rst:473
msgid ""
"where ``conditional_expression`` is an expression that yields either "
"``true`` or ``false``.  A value of ``false`` indicates a failure of the "
"assertion.  We'll discuss the consequences of that momentarily. The second "
"argument must be a ``String`` that describes the reason that the assertion "
"failed.  The last argument, ``assertLevel``, is of type ``AssertionLevel`` "
"(which was defined in our previous discussion on ``enumerations``).  This "
"last argument is **optional** and has the default value of "
"``AssertionalLevel.error``."
msgstr ""
"其中\\ ``conditional_expression``\\ 是产生两种值，\\ ``true``\\ 或\\ ``false``\\ ，的表达式。\ "
"\\ ``false``\\ 值表示断言失败。\ "
"我们马上会讨论失败的后果。\ "
"第二个参数必须是\\ ``String``\\ "
"，用以描述断言失败的原因。\ "
"最后一个参数\\ ``assertLevel``\\ 的类型为\\ ``AssertionLevel``\\ （这在此前对\\ ``enumerations``\\ 的讨论中定义了） 。\ "
"这最后一个参数为\\ **可选**\\ 。\ "
"其默认值则为\\ ``AssertionalLevel.error``\\ 。\ "

#: ../../source/components/components/component_models.rst:482
msgid ""
"Now that we know how to use the ``assert`` function, let's examine the "
"consequences of assertions during simulation to understand why they are "
"important."
msgstr "现在我们知道了如何使用\\ ``assert``\\ 函数。\ "
"让我们来看看断言对模拟过程的影响。\ "
"由此，我们可以明白断言的作用。\ "

#: ../../source/components/components/component_models.rst:487
msgid "Defining Model Limitations"
msgstr "定义模型的适用范围"

#: ../../source/components/components/component_models.rst:493
msgid ""
"When creating a component ``model`` (or any ``model``, for that matter), it "
"is useful to incorporate any limitations on the equations in a model by "
"including them directly in the model.  This is done by adding ``assert`` "
"calls in either the ``equation`` or ``algorithm`` section.  As their name "
"implies, these assertions assert that certain conditions must always be "
"true."
msgstr ""
"在创建组件\\ ``model``\\ （或者说任何\\ ``model``\\ ）时，最好直接将公式使用范围添加到模型内。\ "
"这可以通过添加\\ ``assert``\\ 调用来完成。\ "
"\\ ``assert``\\ 调用既可以加在\\ ``equation``\\ 区域，也可以\\ "
"``algorithm``\\ 区域。\ "
"正如其名称所暗示的一样，这些断言语句要求某些条件必须始终为真。\ "

#: ../../source/components/components/component_models.rst:500
msgid ""
"If the equations within a model are only accurate or applicable under "
"certain conditions, it is essential that these conditions be included in the"
" model via assertions.  Otherwise, the model may silently yield an incorrect"
" solution.  If not uncovered, this could lead to bad decisions based on "
"model solutions.  If it is uncovered, it will undermine the trust people "
"have in the models.  So always try to capture such model limitations."
msgstr ""
"如果一个模型中的公式仅在一定条件下准确或者适用，那么有一点很重要。\ "
"这就是，上述限制必须包括在通过断言包含在模型内。\ "
"否则，模型会默默地产生一个不正确的解。\ "
"如果这个错误没有被发现，模型的仿真结果可能导致错误的决定。\ "
"如果这个错误被发现了，这会破坏大家对模型的信任。\ "
"所以，无论如何都要试图在模型中明示其局限性。\ "

#: ../../source/components/components/component_models.rst:510
msgid ""
"It is worth taking a moment to understand what impact such an assertion has "
"during simulation.  Part of the simulation process is the generation of so-"
"called *candidate solutions*.  These solutions may, or may not, end up being"
" actual solutions.  They are usually generated as the underlying solvers "
"propose solutions and then check to make sure that the solutions are "
"accurate to within some numerical tolerance.  Those candidate solutions that"
" are found to be inaccurate are typically refined in some way until a "
"sufficiently accurate solution is found."
msgstr ""
"这样的断言语句会对模拟有什么影响？这值得花些考虑。\ "
"模拟过程中会生成所谓的\\ *候选解*\\ 。\ "
"这些解有可能会就是最终的解。\ "
"但也可能不是。\ "
"求解器会提出不同的解。\ "
"然后它检查以确保解的精确度满足一定数值容差。\ "
"上述候选解就是在这个过程中产生的。\ "
"而不够精确的候选解一般而言会以某种方法进一步被改良，直到求解器找到足够精确的解。\ "

#: ../../source/components/components/component_models.rst:520
msgid ""
"If a candidate solution violates an assertion, then it is automatically "
"considered to be inaccurate.  The violated assertion will automatically "
"trigger the refinement process in an attempt to find a solution that is more"
" accurate and, hopefully, doesn't violate the assertion.  However, if these "
"refinement processes lead to a solution that is sufficiently accurate "
"(*i.e.,* satisfies the accuracy requirements to within the acceptable "
"tolerance), but that solution still violates any assertions in the system, "
"then the simulation environment will do one of two things.  If the ``level``"
" argument in the ``assert`` call is ``AssertionLevel.error`` then the "
"simulation is terminated.  If, on the other hand, the ``level`` argument is "
"``AssertionLevel.warning``, then the assertion description will be used to "
"generate a warning message to the user.  How this message is delivered is "
"specific to each simulation environment.  Recall that the default value for "
"the ``level`` argument (if none is provided in the call to ``assert``) is "
"``AssertionLevel.error``."
msgstr ""
"如果候选解违反了断言，那么该解会自动被认定为不准确。\ "
"被违反的断言语句会自动触发解的改善过程。\ "
"求解器会试图找到一个更准确、且希望不违反断言的新解。\ "
"但是，如果上述改善过程找到一个足够精确的解（即精度在要求的可接受容差范围内），\ "
"但该解仍违反系统中的某个断言，那么模拟环境将有两个选择。\ "
"如果\\ ``assert``\\ 调用内的\\ ``level``\\ 参数是\\ ``AssertionLevel.error``\\ "
"，那么仿真会终止。\ "
"但如果\\ ``assert``\\ 调用内的\\ ``level``\\ 参数是\\ "
"``AssertionLevel.warning``\\ ，那么用户会得到一条警告信息。\ "
"警告内容就是断言内的描述。\ "
"消息的传递在不同的仿真环境内可能会有所不同。\ "
"要注意，\\ ``level``\\ 参数的默认值\ "
"（未在调用\\ ``assert``\\ 时提供\\ ``level``\\ 的话）是 \\ ``AssertionLevel.error``\\ 。\ "
