Index: trunk/doc/tutorial/simulation/raw/01_dc.html =================================================================== --- trunk/doc/tutorial/simulation/raw/01_dc.html (revision 7922) +++ trunk/doc/tutorial/simulation/raw/01_dc.html (revision 7923) @@ -5,19 +5,18 @@

Scope

In this simulation we are going to calculate the DC operating point of a -simple voltage divider. This is also an introduction on how to set up a -sheet for circuit simulation and how this tutorial is going to deal -with differences between spice implementations: the document is written -for ngspice and differences for other implementations are described at the -bottom. +simple voltage divider. This is also an introduction to setting up a +sheet for circuit simulation. This tutorial deals with differences between +spice implementations by describing the process for ngspice and then any +differences for other implementations are described at the bottom.

The schematics

-The single-sheet schematics contains the voltage divider with all networks +The single-sheet schematic contains the voltage divider with all networks named and two extra symbols for the simulation:

@@ -28,23 +27,23 @@

Click the image to get the sch-rnd sheet

-

SPICE: what is DC op point

+

SPICE: what is a DC op point

In SPICE simulation there are different analysis options available: these are different simulation actions or operations or modes. Basically each analysis is a different algorithm to run on the circuit. The simplest -analysis is called the "DC analisys", or "DC operating point analysis". +analysis is called the "DC analysis", or "DC operating point analysis".

-In DC op point, the simulator will apply all sources, will assume all -inductors are shorted and all capacitors are open and calculate the voltage -for all nodes. (Node is the spice terminology for network.) This simulation is -not time or frequency dependent, it represents a single DC operating once -the circuit has already stabilized. +In the DC op point analysis, the simulator will apply all sources, assume +all inductors are shorted and assume all capacitors are open and then calculate +the voltage for all nodes. (Node is the spice terminology for an equipotential +electrical network.) This simulation is not time or frequency dependent, amd +represents a single DC operating point once the circuit has already stabilized.

In our example, this means V1's 5V is applied and the voltages at in, out1 and -out2 are calculated. Since V1 is an ideal voltage source capable of pushing +out2 are calculated. Since V1 is an ideal voltage source capable of supplying any amount of current, the voltage on the in network will be 5V; but the -voltages on out1 and out2 will depend on resistor values of R1, R2 and R3. +voltages on out1 and out2 will depend on the resistor values of R1, R2 and R3.

Preparing for simulation

@@ -52,21 +51,21 @@

Symbols and nets

Draw the schematics as usual; make sure there is a gnd network, spice won't -work without that. Best to use the stock gnd symbol for that. Make sure +work without that. Ideally, use the stock gnd symbol for that. Make sure all resistors have a unique name and a value. Spice understands the normal SI suffixes such as k for kilo, but as it is generally not case sensitive, -m and M are both milli, and you need to write meg to get mega. +m and M are both milli, so you will need to write meg to get mega.

Your symbols also need to have the proper spice pin numbers. First switch your view from the default pcb to spice_raw: there's a button for this on -the top right part of the main window, left to the help/support button; that -will pop up a view selector, click raw_spice twice and the selector closes -and the view changes. The new view will show pin numbers as the spice target -sees. For plain resistors, pin ordering does not matter, but it is -important for polarized parts like diodes, transistors, sources. The stock -library has spice pin numbers set up and should work out of the box. Later -chapters of this tutorial will explain how to deal with spice pin numbers -in symbols. +the top right part of the main window, on the left of the help/support button. +This pops up a view selector; click raw_spice twice and the selector will close +and the view will change. The new view will show pin numbers as seen by the +spice target. For plain resistors, pin ordering does not matter, but it is +important for polarized parts like diodes, transistors, and sources. The +stock library has spice pin numbers set up and should work without +modification. Later chapters of this tutorial will explain how to deal with +spice pin numbers in symbols.

V1

@@ -75,12 +74,12 @@ concrete model. The easiest way is to place a source-DC symbol from the stock library in between the in network and the ground. The name of the symbol does not matter; as we are using it as a voltage source, -it is best to name it V1. To make ir produce a steady 5V output, create +it is best to name it V1. To make it produce a steady 5V output, create an attribute called spice/params and set it to DC 5V. It is -also a good idea to make this visible in form of a floater. +also a good idea to make this visible in the form of a floater.

External resource: -ngspice manual on voltage and current sources explains all the different parameter options; spice/params is the part that gots written after N-; later chapters will demonstrate using more complex waveforms than plain flat DC. +ngspice manual on voltage and current sources explains all the different parameter options; spice/params is the part that gets written after N-; later chapters will demonstrate using more complex waveforms than plain flat DC. For a DC operating point we are only interested in the DC component, tho.

Raw spice commands

@@ -150,10 +149,10 @@ dc

-This tells gnucap what to print after a dc simulation than runs the dc simulation. +This tells gnucap what to print after a dc simulation then runs the dc simulation.

-After the export, write a single word spice in the first line of the -file (e.g. using a text editor), else gnucap won't know the file is in spice +After the export, write the single word spice in the first line of the +file (e.g. using a text editor), otherwise gnucap won't know the file is in spice syntax. Then run gnucap 01_dc.cir and it will print (among tons of noise) the two voltages.