Results for generator
On this page:
 
Dictionary:

generator

  (jĕn'ə-rā'tər) pronunciation
n.
    1. One that generates, especially a machine that converts mechanical energy into electrical energy.
    2. An apparatus that generates vapor or gas.
  1. A circuit that generates a specified waveform.
  2. Mathematics. See generatrix.
  3. Computer Science. A program that produces specific programs from the definition of an operation.

 
 

A machine in which mechanical energy is converted to electrical energy. Generators are made in a wide range of sizes, from very small machines with a few watts of power output to very large central-station generators providing 1000 MW or more. All electrical generators utilize a magnetic field to produce an output voltage which drives the current to the load. The electric current and magnetic field also interact to produce a mechanical torque opposing the motion supplied by the prime mover. The mechanical power input is equal to the electric power output plus the electrical and mechanical losses.

Generators can be divided into two groups, alternating current (ac) and direct current (dc). Each group can be subdivided into machines that use permanent magnets to produce the magnetic field (PM machines) and those using field windings. A further subdivision relates to the type of prime mover and the generator speed. Large generators are often driven by steam or hydraulic turbines, by diesel engines, and sometimes by electric motors. Generator speeds vary from several thousand rotations per minute for steam turbines to very low speeds for hydraulic or wind turbines. See also Diesel engine; Hydraulic turbine; Motor; Prime mover; Steam turbine; Wind power.

The field structure of a generator establishes the magnetic flux needed for energy conversion. In small generators, permanent magnets can be used to provide the required magnetic field. In large machines, dc field windings are more economical and permit changes in the magnetic flux and output voltage. This allows control of the generated voltage, which is important in many applications. In dc generators the field structure must be stationary to permit a rotating mounting for the commutator and armature windings. However, since the field windings require low voltage and power and have only two lead wires, it is convenient to place the field on the rotating member in ac generators. See also Electric power generation; Electric rotating machinery; Windings in electric machinery.


 
Modern Science: generator
generator

A device that produces electric current, usually by rotating a conductor in a magnetic field, thereby generating current through electromagnetic induction. This sort of generator produces an alternating current (AC).

 

(1) Software that creates software. See application generator and macro generator.

(2) A device that creates electrical power or synchronization signals.



 
Dental Dictionary: generator

n

One who, or that which, begets, causes, or produces.

 

Alternating-current (AC) and direct-current (DC) generators (top and bottom, respectively). The …
Alternating-current (AC) and direct-current (DC) generators (top and bottom, respectively). The … (credit: © Merriam-Webster Inc.)
Machine that converts mechanical energy to electricity for transmission and distribution over power lines to domestic, commercial, and industrial customers. Generators also produce the electric power required for automobiles, aircraft, ships, and trains. The mechanical power for an electric generator is usually obtained from a rotating shaft and is equal to the shaft torque multiplied by the rotational, or angular, velocity (speed). The mechanical power may come from various sources: turbines powered by water, wind, steam, or gas; gasoline engines; or diesel engines.

For more information on generator, visit Britannica.com.

 
Architecture: generator

A machine that converts mechanical power into electric power.


 
in electricity, machine used to change mechanical energy into electrical energy. It operates on the principle of electromagnetic induction, discovered (1831) by Michael Faraday. When a conductor passes through a magnetic field, a voltage is induced across the ends of the conductor. The generator is simply a mechanical arrangement for moving the conductor and leading the current produced by the voltage to an external circuit, where it actuates devices that require electricity. In the simplest form of generator the conductor is an open coil of wire rotating between the poles of a permanent magnet. During a single rotation, one side of the coil passes through the magnetic field first in one direction and then in the other, so that the induced current is alternating current (AC), moving first in one direction, then in the other. Each end of the coil is attached to a separate metal slip ring that rotates with the coil. Brushes that rest on the slip rings are attached to the external circuit. Thus the current flows from the coil to the slip rings, then through the brushes to the external circuit. In order to obtain direct current (DC), i.e., current that flows in only one direction, a commutator is used in place of slip rings. The commutator is a single slip ring split into left and right halves that are insulated from each other and are attached to opposite ends of the coil. It allows current to leave the generator through the brushes in only one direction. This current pulsates, going from no flow to maximum flow and back again to no flow. A practical DC generator, with many coils and with many segments in the commutator, gives a steadier current. There are also several magnets in a practical generator. In any generator, the whole assembly carrying the coils is called the armature, or rotor, while the stationary parts constitute the stator. Except in the case of the magneto, which uses permanent magnets, AC and DC generators use electromagnets. Field current for the electromagnets is most often DC from an external source. The term dynamo is often used for the DC generator; the generator in automotive applications is usually a dynamo. An AC generator is called an alternator. To ease various construction problems, alternators have a stationary armature and rotating electromagnets. Most alternators produce a polyphase AC, a complex type of current that provides a smoother power flow than does simple AC. By far the greatest amount of electricity for industrial and civilian use comes from large AC generators driven by steam turbines.


 

Something that produces or causes to exist; a machine that converts mechanical to electrical energy.

  • pulse g. — the power source for a cardiac pacemaker system, usually powered by a lithium battery, supplying impulses to the implanted electrodes, either at a fixed rate or in a programmed pattern.


 

Device used to convert mechanical energy to electrical energy.


 
Word Tutor: generator
pronunciation

IN BRIEF: A machine for changing mechanical energy into electricity. Also: Any person or thing that causes something to happen.

pronunciation They needed a generator when the electricity went out.

 
Wikipedia: generator (computer science)


In computer science, a generator is a special routine that can be used to control the iteration behaviour of a loop. A generator is very similar to a function that returns an array, in that a generator has parameters, can be called, and generates a sequence of values. However, instead of building an array containing all the values and returning them all at once, a generator yields the values one at a time, which requires less memory and allows the caller to get started processing the first few values immediately. Therefore, lazy evaluation can be used in the implementation of generators in certain cases. However, generators are not referentially transparent. In short, a generator looks like a function but behaves like an iterator.

History

Generators first appeared in CLU (1975)[1] and are now available in Python[2], C#, and JavaScript[3]. (In CLU and C#, generators are called iterators.) Generators are also a prominent feature in a string manipulation language, Icon.

Uses

Generators are usually invoked inside loops. The first time that a generator invocation is reached in a loop, an iterator object is created that encapsulates the state of the generator routine at its beginning, with arguments bound to the corresponding parameters. The generator's body is then executed in the context of that iterator until a special yield action is encountered; at that time, the value provided with the yield action is used as the value of the invocation expression. The next time the same generator invocation is reached in a subsequent iteration, the execution of the generator's body is resumed after the yield action, until yet another yield action is encountered. In addition to the yield action, execution of the generator body can also be terminated by a finish action, at which time the innermost loop enclosing the generator invocation is terminated.

Because generators compute their yielded values only on demand, they are useful for representing sequences that are expensive to compute, or even infinite.

A pseudorandom number generator is an example of a generator.

In the presence of generators, loop constructs of a language can be reduced into a single loop ... end loop construct; all the usual loop constructs can then be comfortably simulated by using suitable generators in the right way.

Python

An example Python generator:

<source lang="python"> def countfrom(n):

   while True:
       yield n
       n += 1
  1. Example use: printing out the integers from 10 to 20.
  2. Note that this iteration terminates normally, despite countfrom() being
  3. written as an infinite loop.

for i in countfrom(10):

   if i <= 20:
       print i
   else:
       break
  1. Another generator, which produces prime numbers indefinitely as needed.

def primes():

   n = 2
   p = []
   while True:
       if not any( [n % f == 0 for f in p] ):
           yield n
           p.append( n )
       n += 1

>>> f = primes() >>> f.next() 2 >>> f.next() 3 >>> f.next() 5 >>> f.next() 7 </source>

This example works in Python <= 2.5 and uses the any() function from the numpy module.

In Python, a generator can be thought of as an iterator that contains a frozen stack frame. Whenever the iterator's next() method is called, Python resumes the frozen frame, which executes normally until the next yield statement is reached. The generator's frame is then frozen again, and the yielded value is returned to the caller.

Generators can be implemented in terms of more expressive control flow constructs, such as coroutines or first-class continuations.[4]

C#

An example C# 2.0 generator:

<source lang="csharp"> // Method that takes an iterable input (possibly an array) // and returns all even numbers. public static IEnumerable<int> GetEven(IEnumerable<int> numbers) {

   foreach (int i in numbers)
   {
       if ((i % 2) == 0)
       {
           yield return i;
       }
   }

} </source>

You may even use multiple yield return statements and the compiler is smart enough to return them in order on each iteration:

<source lang="csharp"> public class CityCollection : IEnumerable<string> {

  public IEnumerator<string> GetEnumerator()
  {
     yield return "New York";
     yield return "Paris";
     yield return "London";
  }

} </source>

Both of these examples utilise Generics, but this is not required. To use the yield keyword, you must using at least C# version 2.0. The current version of the C# compiler at this time is 3.5 and is currently in beta.

C++

Defines a generator (implemented as a function object) that counts from 10 up, and we invoke the generator 11 times and print the results. <source lang="cpp">

  1. include <iostream>
  2. include <iterator>
  3. include <algorithm>

class countfrom { private:

 int count;

public:

 countfrom(int n) : count(n) {}
 int operator()() { return count++; }

};

int main() {

 std::generate_n(std::ostream_iterator<int>(std::cout, "\n"), 11, countfrom(10));
 return 0;

} </source>

PHP

In PHP, especially when working with MySQL databases, it is often useful to use the built-in function mysql_fetch_array, which is a generator.

<source lang="php">

  $sql = 'SELECT * FROM `users` ORDER BY `user_id` DESC LIMIT 10';
  $res = mysql_query( $sql );
  // this generator will keep returning data, satisfying the while condition
  // as long as there is something new to return, or false when there is no
  // more data to return.
  // Keep in mind that the equals sign is not a comparison operator, but
  // an assignment operator
  while ( $row = mysql_fetch_array( $res ) ) { 
      // process $row
  }

</source>

Other Implementations

Since Java does not have continuation or functionality out of the box, an attempt to implement the concept was made, using a bytecode manipulator (specifically, WebObject's ASM) and the new Java 5 feature of VM Instrumentation. The code was made public here.

Example of using it:

<source lang="java"> public static Iterable countFrom(final int n) {

 return new Yielder() {
   protected void yieldNextCore() {
     int times = n;
     while (times-- > 0) {
       yieldReturn(times);
     }
   }
 };

} </source>

See also

  • List comprehension for another construct that generates a sequence of values
  • Iterator for the concept of producing a list one element at a time
  • Lazy evaluation for producing values when needed
  • Corecursion for potentially infinite data by recursion instead of yield
  • Coroutine for even more generalization from subroutine
  • Continuation for generalization of control flow

References

  1. ^ Liskov, Barbara (April 1992). A History of CLU (pdf).
  2. ^ Python Enhancement Proposals: PEP 255: Simple Generators, PEP 289: Generator Expressions, PEP 342: Coroutines via Enhanced Generators
  3. ^ New In JavaScript 1.7. Retrieved on 2006-10-10.
  4. ^ Kiselyov, Oleg (January 2004). General ways to traverse collections in Scheme.
  • Stephan Murer, Stephen Omohundro, David Stoutamire and Clemens Szyperski: Iteration abstraction in Sather. ACM Transactions on Programming Languages and Systems, 18(1):1-15 (1996) [1][[Category:Articles with example C++ code]]

 
Translations: Generator

Dansk (Danish)
n. - generator, frembringer, grundtone

Nederlands (Dutch)
stroomopwekker, machine die stoom/gas etc. maakt, degene die iets voortbrengt (b.v. idee)

Français (French)
n. - (Élec) générateur, groupe électrogène, créateur (qn)

Deutsch (German)
n. - Generator, Dynamo, Dampf-/Gaserzeuger, Schöpfer

Ελληνική (Greek)
n. - (ηλεκτρο)γεννήτρια, γενέτης, δημιουργός

Italiano (Italian)
generatore

Português (Portuguese)
n. - gerador (m) (Mec.) (Eletr.)

Русский (Russian)
генератор, производитель

Español (Spanish)
n. - generador, dínamo

Svenska (Swedish)
n. - alstrare, generator (tekn.)

中文(简体) (Chinese (Simplified))
产生器, 生产者, 发电机

中文(繁體) (Chinese (Traditional))
n. - 產生器, 生產者, 發電機

한국어 (Korean)
n. - 발전기

日本語 (Japanese)
n. - 発電機, 発生器, ガス発生器

العربيه (Arabic)
‏(الاسم) مولد‏

עברית (Hebrew)
n. - ‮מחולל, דינמו, גנרטור, יוזם, ממציא‬


 
Best of the Web: generator

Some good "generator" pages on the web:


Math
mathworld.wolfram.com
 
 
 

Join the WikiAnswers Q&A community. Post a question or answer questions about "generator" at WikiAnswers.

 

Copyrights:

Dictionary. The American Heritage® Dictionary of the English Language, Fourth Edition Copyright © 2007, 2000 by Houghton Mifflin Company. Updated in 2007. Published by Houghton Mifflin Company. All rights reserved.  Read more
Sci-Tech Encyclopedia. McGraw-Hill Encyclopedia of Science and Technology. Copyright © 2005 by The McGraw-Hill Companies, Inc. All rights reserved.  Read more
Modern Science. The Dictionary of Cultural Literacy, Second Edition, Revised and updated Edited by E.D. Hirsch, Jr., Joseph F. Kett, and James Trefil. Copyright © 1993 by Houghton Mifflin Company . All rights reserved.  Read more
Computer Desktop Encyclopedia. THIS COPYRIGHTED DEFINITION IS FOR PERSONAL USE ONLY.
All other reproduction is strictly prohibited without permission from the publisher.
© 1981-2008 Computer Language Company Inc.  All rights reserved.  Read more
Dental Dictionary. Mosby's Dental Dictionary. Copyright © 2004 by Elsevier, Inc. All rights reserved.  Read more
Britannica Concise Encyclopedia. Britannica Concise Encyclopedia. © 2006 Encyclopædia Britannica, Inc. All rights reserved.  Read more
Architecture. McGraw-Hill Dictionary of Architecture and Construction. Copyright © 2003 by McGraw-Hill Companies, Inc. All rights reserved.  Read more
Columbia Encyclopedia. The Columbia Electronic Encyclopedia, Sixth Edition Copyright © 2003, Columbia University Press. Licensed from Columbia University Press. All rights reserved. www.cc.columbia.edu/cu/cup/  Read more
Veterinary Dictionary. The Veterinary Dictionary. Copyright © 2007 by Elsevier. All rights reserved.  Read more
Electronics Dictionary. Copyright 2001 by Twysted Pair. All rights reserved.  Read more
Word Tutor. Copyright © 2004-present by eSpindle Learning, a 501(c) nonprofit organization. All rights reserved.
eSpindle provides personalized spelling and vocabulary tutoring online; free trial Read more
Wikipedia. This article is licensed under the GNU Free Documentation License. It uses material from the Wikipedia article "Generator (computer science)" Read more
Translations. Copyright © 2007, WizCom Technologies Ltd. All rights reserved.  Read more

On this page:   E-mail   print Print  Link  

 

Keep Reading

Mentioned In: