#
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/elec_comps.rst:4
msgid "Electrical Components"
msgstr "电气部件"

#: ../../source/components/components/elec_comps.rst:6
msgid ""
"The previous section discussed how to create component models in the heat "
"transfer domain.  Now let's turn our attention to how to construct some "
"basic electrical components and then use them to simulate the kinds of "
"systems we saw in our previous :ref:`electrical example <elec-example>`."
msgstr ""
"前一节中讨论了如何在传热领域中创建组件模型。\ "
"现在让我们将注意力转移到如何构建一些基本的电气元件。\ "
"然后，我们会用这些模型来建立所看到的\ "
":ref:`\ 电气系统\ <elec-example>`\ 。\ "

#: ../../source/components/components/elec_comps.rst:12
msgid ""
"In this section we will implement the basic electrical component models "
"**twice**.  The first time through, we will implement each component without"
" any regard to the others.  But the second time through, we'll see how we "
"can use the inheritance mechanism in Modelica to make our lives a little "
"easier."
msgstr ""
"在这一节中，我们将\ **两次**\ 实现基本电气组件的模型。\ "
"第一次时，我们将独立地实现每个组件，不考虑组件间的关系。\ "
"但在第二次过程中，我们将看到怎样通过使用Modelica的继承机制去减轻我们的工作量。\ "

#: ../../source/components/components/elec_comps.rst:18
msgid ""
"But in both cases, we'll use the same connector definitions.  In our "
"discussion of :ref:`simple-domains`, we saw how to construct an electrical "
"connector.  As with the previous section on heat transfer, the examples in "
"this section will rely on the connector definitions from the Modelica "
"Standard Library.  Those connector definitions look like this:"
msgstr ""
"但在两种情况下，我们都将使用相同的接口定义。\ "
"在对\ :ref:`simple-domains`\ "
"的讨论里，我们看到了如何构建一个电连接器。\ "
"与上一节传热一样，本节中的例子将依赖于Modelica标准库的连接器定义。\ "
"这些接口的定义如下："

#: ../../source/components/components/elec_comps.rst:38
msgid "Basic Component Models"
msgstr "基本组件模型"

#: ../../source/components/components/elec_comps.rst:40
msgid ""
"Given these ``connector`` definitions, it is relatively straightforward to "
"construct a resistor model.  The goal of a resistor model is to encapsulate "
"the relationship between the voltage across the resistor and the current "
"through the resistor using Ohm's law. The following model represents how one"
" might expect such a resistor model to look:"
msgstr ""
"有了这些\ ``connector``\ "
"定义，构建电阻模型就相对简单了。\ "
"电阻模型的目标是使用欧姆定律去封装电阻两端电压与电阻器内电流之间的关系。\ "
"下面的模型表示上述电阻模型的一种可能形式："

#: ../../source/components/components/elec_comps.rst:52
msgid ""
"In the same way, we might create inductor and capacitor models as follows:"
msgstr "以同样的方式，我们可以创建电感和电容的模型，如下："

#: ../../source/components/components/elec_comps.rst:65
msgid ""
"The important thing to notice about these models is the amount of common "
"code shared between them.  In software development, this kind of redundancy "
"is frowned upon.  In fact, a common software maxim is \"Redundancy is the "
"root of all evil\".  The reason this redundancy is a problem is partly "
"because you are doing the same work multiple times, but also because this "
"code needs to be *maintained* as well.  When you repeat code and then find a"
" mistake in that code, you have to fix it everywhere."
msgstr ""
"要注意的这些模型之间共同代码。\ "
"在软件开发中，这种程度的冗余时常会被人鄙视。\ "
"事实上，有条常用的软件工程格言说：“冗余是万恶根源”。\ "
"这种冗余之所以是一个问题，一方面是由于你将同样的工作重复了多次，\ "
"另一方面也因为代码也是需要\ *维护*\ 的。\ "
"若你在重复代码内找到错误，你就要在每一处进行修复。\ "

#: ../../source/components/components/elec_comps.rst:77
msgid "The DRY Principle"
msgstr "DRY原则"

#: ../../source/components/components/elec_comps.rst:79
msgid ""
"This issue of redundancy is an important one.  So let's revisit building "
"models of resistors, inductors and capacitors with the goal of reducing the "
"amount of repeated code.  In software, there is something called the *DRY "
"principle* where DRY stands for \"Don't Repeat Yourself\".  So our next step"
" is to make our resistor, capacitor and inductor models DRY."
msgstr ""
"冗余是一个重要的问题。\ "
"因此，为减少重复的代码，让我们再观察了电阻、电感和电容的模型。\ "
"在软件工程里有所谓的\ *DRY原则*\ 。\ "
"其中DRY表示“不要重复”。\ "
"因此，我们的下一步任务就是使电阻、电容和电感模型让变得DRY。\ "

#: ../../source/components/components/elec_comps.rst:88
msgid ""
"The key to eliminating redundant code is to identify all the common code "
"between these models and create a ``partial`` model that we can inherit "
"from.  We highlighted the common lines previously.  Now we can capture them "
"in their own model as follows:"
msgstr ""
"要消除冗余代码的关键在于，要确定这些模型内所有的公共代码，\ "
"并创建一个我们可以从之继承的\ ``partial``\ 模型。\ "
"我们在前面已经高亮了公共代码行。\ "
"现在，我们可以将这些代码放到一个如下的单独模型内："

#: ../../source/components/components/elec_comps.rst:97
msgid ""
"In summary, we've extracted the declarations for ``p``, ``n`` and ``v`` from"
" the previous models into this model.  We've also included a variable, "
"``i``, to represent the current flowing from pin ``p`` to pin ``n``.  "
"Finally, the conservation of charge equation is also included."
msgstr ""
"简而言之，我们将\ ``p``\ 、\ ``n``\ 和\ ``v``\ 的声明从旧模型提取这个模型里。\ "
"我们还引入了一个变量\ ``i``\ ，以代表从引脚\ ``p``\ 到引脚\ ``n``\ 的电流。\ "
"最后，电荷守恒方程也包括在内。\ "

#: ../../source/components/components/elec_comps.rst:103
msgid ""
"Creating such a model then allows us to create a much more succinct resistor"
" model as follows:"
msgstr "创建这样的模型后，我们就可以创建一个更简洁的电阻模型，如下："

#: ../../source/components/components/elec_comps.rst:110
msgid ""
"There are several things to notice about this ``Resistor`` model.  The first"
" is how much shorter it is.  This is because we inherit the electrical pins,"
" the conservation of charge equation and the variables ``v`` and ``i`` from "
"the ``TwoPin`` model.  Another thing to notice is that, by leverage the "
"definitions of ``v`` and ``i``, Ohm's law looks just like it would if you "
"saw it in a text book."
msgstr ""
"这个\ ``Resistor``\ 模型有几点事情需要注意。\ "
"首先是模型变得有多短。\ "
"这是因为我们从\ ``TwoPin``\ "
"模型继承了电引脚、电荷守恒方程和变量\ ``v``\ 以及\ ``i``\ 。\ "
"另一个要注意的点是，通过使用\ ``v``\ 和\ ``i``\ 的定义，\ "
"欧姆定律看起来一本教科书里的一模一样。\ "

#: ../../source/components/components/elec_comps.rst:117
msgid "We can give the same treatment to our inductor and capacitor models:"
msgstr "我们可以用相同方法处理电感和电容的模型："

#: ../../source/components/components/elec_comps.rst:127
msgid ""
"Again, we see that the models are much more succinct.  Ultimately, factoring"
" out common code in this way means that the component models are easier to "
"write and easier to maintain."
msgstr "我们再一次看到的模型编得更为简洁。\ "
"基本上，以这种方式抽出公共代码意味着，组件模型编得更容易编写以及更方便维护。\ "

#: ../../source/components/components/elec_comps.rst:132
msgid "Circuit Model"
msgstr "电路模型"

#: ../../source/components/components/elec_comps.rst:134
msgid ""
"So far, we've only built component models.  In order to create a circuit "
"model we first need to define a few more component models. Specifically, we "
"need to create a step voltage source model:"
msgstr "到目前为止，我们只创建了组件模型。\ "
"为了创建电路模型，我们首先还需要多定义几个组件模型。\ "
"具体来说，我们需要创建一个阶跃电压源模型："

#: ../../source/components/components/elec_comps.rst:142
msgid ""
"Note how the ``StepVoltage`` model also leverages the ``TwoPin`` model.  We "
"will also need a ground model which we model as follows:"
msgstr "请注意\ ``StepVoltage``\ 模型也利用了\ ``TwoPin``\ 模型。\ "
"我们还需要如下的接地模型："

#: ../../source/components/components/elec_comps.rst:149
msgid ""
"The ``Ground`` model has only one pin so it cannot inherit from ``TwoPin``."
"  Recall how we described the :ref:`amb-cond` model from our discussion on "
":ref:`heat-transfer-components` an infinite reservoir.  The ``Ground`` model"
" serves a very similar purpose.  No matter how much current flows in to or "
"out of an electrical ground, the voltage remains zero."
msgstr ""
"\ ``Ground``\ 模型只有一个引脚，因此不能继承\ ``TwoPin``\ 。\ "
"回想一下在讨论\ :ref:`heat-"
"transfer-components`\ 的\ :ref:`amb-cond`\ 模型时，我们是如何描述无限大容器的。\ "
"\ "
"``Ground``\ 模型提供了非常类似的功用。\ "
"不管多少电流流入或流出电接地，电压保持为零。\ "

#: ../../source/components/components/elec_comps.rst:156
msgid ""
"Having defined all these components, we can now create a circuit model as "
"follows:"
msgstr "定义了所有这些组件后，现在我们可以创建电路模型如下："

#: ../../source/components/components/elec_comps.rst:162
msgid "The schematic diagram for this model is rendered as:"
msgstr "该模型的示意图显示如下："
