<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2-ppt DokuWiki" -->
<?xml-stylesheet href="http://kaatskit.com/dokuwiki/lib/exe/css.php?s=feed" type="text/css"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#">
    <title>* gnucap:manual:examples</title>
    <tagline></tagline>
    <link rel="alternate" type="text/html" href="http://kaatskit.com/dokuwiki/"/>
    <id>http://kaatskit.com/dokuwiki/</id>
    <modified>2026-04-15T23:09:13-05:00</modified>
    <generator>FeedCreator 1.7.2-ppt DokuWiki</generator>
    <entry>
        <title>gnucap:manual:examples:experimentally_finding_model_parameters</title>
        <link rel="alternate" type="text/html" href="http://kaatskit.com/dokuwiki/doku.php/gnucap:manual:examples:experimentally_finding_model_parameters?rev=1449869995&amp;do=diff"/>
        <created>2015-12-11T15:39:55-05:00</created>
        <issued>2015-12-11T15:39:55-05:00</issued>
        <modified>2015-12-11T15:39:55-05:00</modified>
        <id>http://kaatskit.com/dokuwiki/doku.php/gnucap:manual:examples:experimentally_finding_model_parameters?rev=1449869995&amp;do=diff</id>
        <summary>Sometimes you need to determine model parameters, based on having no real information.

In this example, we find the parameter “IS” of a diode, based on its forward voltage.

We would like to have a diode...
D2 (a k) 1n4004
Now you need a model statement ...</summary>
    </entry>
    <entry>
        <title>gnucap:manual:examples:fm_spectrum_analysis</title>
        <link rel="alternate" type="text/html" href="http://kaatskit.com/dokuwiki/doku.php/gnucap:manual:examples:fm_spectrum_analysis?rev=1246511467&amp;do=diff"/>
        <created>2009-07-02T00:11:07-05:00</created>
        <issued>2009-07-02T00:11:07-05:00</issued>
        <modified>2009-07-02T00:11:07-05:00</modified>
        <id>http://kaatskit.com/dokuwiki/doku.php/gnucap:manual:examples:fm_spectrum_analysis?rev=1246511467&amp;do=diff</id>
        <summary>In this demo, we will look at the spectrum of a frequency modulated signal, with the intent of exploring the effect of overmodulation on bandwidth.

The circuit is simple, just a voltage source, with a Spice-style “SFFM” waveform.  We will use parameters to tinker with the signal, and the Fourier command to display the spectrum.  You could calculate the spectrum using Bessel functions, but we will look at it with simulation.</summary>
    </entry>
    <entry>
        <title>gnucap:manual:examples:hello_world</title>
        <link rel="alternate" type="text/html" href="http://kaatskit.com/dokuwiki/doku.php/gnucap:manual:examples:hello_world?rev=1242236204&amp;do=diff"/>
        <created>2009-05-13T12:36:44-05:00</created>
        <issued>2009-05-13T12:36:44-05:00</issued>
        <modified>2009-05-13T12:36:44-05:00</modified>
        <id>http://kaatskit.com/dokuwiki/doku.php/gnucap:manual:examples:hello_world?rev=1242236204&amp;do=diff</id>
        <summary>Copyright 1999 Telford Tendys (with mods by Albert Davis)

This is not an alternative to reading the manual. The manual is
very nicely presented in LaTeX and you should print it out and keep
it handy when working. This document is organised starting
from easy and working towards difficult and presumes that you have some
idea of what electrical circuits are but don't know much about simulators.
The manual is organised in alphabetical order and in groups of concepts
and it presumes that you know S…</summary>
    </entry>
    <entry>
        <title>gnucap:manual:examples:multiplying_two_voltages_using_diode_nonlinearity</title>
        <link rel="alternate" type="text/html" href="http://kaatskit.com/dokuwiki/doku.php/gnucap:manual:examples:multiplying_two_voltages_using_diode_nonlinearity?rev=1449869995&amp;do=diff"/>
        <created>2015-12-11T15:39:55-05:00</created>
        <issued>2015-12-11T15:39:55-05:00</issued>
        <modified>2015-12-11T15:39:55-05:00</modified>
        <id>http://kaatskit.com/dokuwiki/doku.php/gnucap:manual:examples:multiplying_two_voltages_using_diode_nonlinearity?rev=1449869995&amp;do=diff</id>
        <summary>The above example shows diode voltage drop behaviour but the diode can
also be used as an exponential function. In this example, a group of
diodes are used to construct a voltage multiplier. Most circuit components
add and subtract voltages and currents but multiplication is a bit special.
What is done in this circuit is to use the exponential behaviour of the
diodes to take the logarithm of two input voltages, then add those up and
use another diode to find the exponential of the sum. This work…</summary>
    </entry>
    <entry>
        <title>gnucap:manual:examples:noise_syntax</title>
        <link rel="alternate" type="text/html" href="http://kaatskit.com/dokuwiki/doku.php/gnucap:manual:examples:noise_syntax?rev=1449869995&amp;do=diff"/>
        <created>2015-12-11T15:39:55-05:00</created>
        <issued>2015-12-11T15:39:55-05:00</issued>
        <modified>2015-12-11T15:39:55-05:00</modified>
        <id>http://kaatskit.com/dokuwiki/doku.php/gnucap:manual:examples:noise_syntax?rev=1449869995&amp;do=diff</id>
        <summary>Noise Syntax

This section contains descriptions which are not implemented yet in simualtor. Work is in progress.

Spice .noise command syntax is implemented:

.noise V(&lt;N1&gt;[,&lt;N2&gt;]) &lt;VIN&gt; &lt;ac_description&gt;

	*  &lt;N1&gt;, &lt;N2&gt; - output node numbers, if N2 is omited ground is implied;
	*  &lt;VIN&gt; - input AC source at which noise power will be calculated;
	*  &lt;ac_description&gt;  - gnucap AC simulation statement.</summary>
    </entry>
    <entry>
        <title>gnucap:manual:examples:nonlinear_devices_--_diodes</title>
        <link rel="alternate" type="text/html" href="http://kaatskit.com/dokuwiki/doku.php/gnucap:manual:examples:nonlinear_devices_--_diodes?rev=1245905916&amp;do=diff"/>
        <created>2009-06-24T23:58:36-05:00</created>
        <issued>2009-06-24T23:58:36-05:00</issued>
        <modified>2009-06-24T23:58:36-05:00</modified>
        <id>http://kaatskit.com/dokuwiki/doku.php/gnucap:manual:examples:nonlinear_devices_--_diodes?rev=1245905916&amp;do=diff</id>
        <summary>All of the previous circuits have been linear. This is to say that all
the devices (voltage sources, current sources, dependent source and
resistors) are linear devices and the overall “shape” of the problem
does not change as the values of the system are scaled up or down.
For example, if a circuit is solved once, then after that all of the voltage
sources in the circuit are doubled, the circuit doesn't need to be solved
a second time because all the node voltages will merely be double those
of…</summary>
    </entry>
    <entry>
        <title>gnucap:manual:examples:paramset_recursive</title>
        <link rel="alternate" type="text/html" href="http://kaatskit.com/dokuwiki/doku.php/gnucap:manual:examples:paramset_recursive?rev=1673020719&amp;do=diff"/>
        <created>2023-01-06T09:58:39-05:00</created>
        <issued>2023-01-06T09:58:39-05:00</issued>
        <modified>2023-01-06T09:58:39-05:00</modified>
        <id>http://kaatskit.com/dokuwiki/doku.php/gnucap:manual:examples:paramset_recursive?rev=1673020719&amp;do=diff</id>
        <summary>A paramset permits the recursive definition of component models.

In this example we analyse a chain of RC lowpass filters whithout having to type it out explicitly.
some typing.

First, define two modules as follows.


module tln0(a, b);
  parameter r;
  parameter c;
  resistor #(.r(r)) r(a b);
  capacitor #(.c(c)) c(b, 0);
endmodule

module tln1(a, b);
  parameter length
  parameter r;
  parameter c;
  resistor #(.r(r)) r(a i);
  capacitor #(.c(c)) c(i, 0);
  tln #(.length(length - 1) .c(c) .r…</summary>
    </entry>
    <entry>
        <title>gnucap:manual:examples:phase_shift_oscillator</title>
        <link rel="alternate" type="text/html" href="http://kaatskit.com/dokuwiki/doku.php/gnucap:manual:examples:phase_shift_oscillator?rev=1449869995&amp;do=diff"/>
        <created>2015-12-11T15:39:55-05:00</created>
        <issued>2015-12-11T15:39:55-05:00</issued>
        <modified>2015-12-11T15:39:55-05:00</modified>
        <id>http://kaatskit.com/dokuwiki/doku.php/gnucap:manual:examples:phase_shift_oscillator?rev=1449869995&amp;do=diff</id>
        <summary>Getting started

In this example, we will analyze a phase shift oscillator.  It was designed in a hurry, so the specs are not expected to be very good.  We will see.

It uses a single BJT, plus an emitter follower, and runs on a single-ended 12 volt supply.</summary>
    </entry>
    <entry>
        <title>gnucap:manual:examples:polyglot</title>
        <link rel="alternate" type="text/html" href="http://kaatskit.com/dokuwiki/doku.php/gnucap:manual:examples:polyglot?rev=1681799481&amp;do=diff"/>
        <created>2023-04-18T01:31:21-05:00</created>
        <issued>2023-04-18T01:31:21-05:00</issued>
        <modified>2023-04-18T01:31:21-05:00</modified>
        <id>http://kaatskit.com/dokuwiki/doku.php/gnucap:manual:examples:polyglot?rev=1681799481&amp;do=diff</id>
        <summary>In some situations it may be desirable to share circuit and analysis across multiple backends. Examples are cross verification, benchmarking, pointing out differences,  or demonstrate problems.

Gnucap provides a mechanism that can be used to share batch files with other spice implementations more easily. Consider the following spice input.</summary>
    </entry>
    <entry>
        <title>gnucap:manual:examples:resistors_and_sources</title>
        <link rel="alternate" type="text/html" href="http://kaatskit.com/dokuwiki/doku.php/gnucap:manual:examples:resistors_and_sources?rev=1449869995&amp;do=diff"/>
        <created>2015-12-11T15:39:55-05:00</created>
        <issued>2015-12-11T15:39:55-05:00</issued>
        <modified>2015-12-11T15:39:55-05:00</modified>
        <id>http://kaatskit.com/dokuwiki/doku.php/gnucap:manual:examples:resistors_and_sources?rev=1449869995&amp;do=diff</id>
        <summary>The previous example covers enough concepts to model arbitrarily complex
networks of resistors and sources. These are essentially linear circuits
that have no relation to time. A more elaborate example is presented below:

eg2.ckt


NETWORK OF RESISTORS AND VOLTAGE SOURCES
V1 2 1 10
V2 4 3 5
V3 0 3 3
R1 1 2 220
R2 2 3 4.7k
R3 4 5 3.3k
R4 3 5 10k
R5 0 1 22k
R6 0 5 15k</summary>
    </entry>
    <entry>
        <title>gnucap:manual:examples:simple_power_supply</title>
        <link rel="alternate" type="text/html" href="http://kaatskit.com/dokuwiki/doku.php/gnucap:manual:examples:simple_power_supply?rev=1666086662&amp;do=diff"/>
        <created>2022-10-18T04:51:02-05:00</created>
        <issued>2022-10-18T04:51:02-05:00</issued>
        <modified>2022-10-18T04:51:02-05:00</modified>
        <id>http://kaatskit.com/dokuwiki/doku.php/gnucap:manual:examples:simple_power_supply?rev=1666086662&amp;do=diff</id>
        <summary>Getting started

In this example, we will analyze a simple power supply.

The power supply consists of a “lump” power transformer with fairly loose coupling for short circuit protection, a full wave bridge rectifier, and a filter capacitor.  The desired output is about 50 volts at .5 amps (100 Ohm load), with less than 1 volt of ripple.  The power supply should be able to handle a short with no damage, with no fuse.</summary>
    </entry>
    <entry>
        <title>gnucap:manual:examples:spice_to_verilog</title>
        <link rel="alternate" type="text/html" href="http://kaatskit.com/dokuwiki/doku.php/gnucap:manual:examples:spice_to_verilog?rev=1713478620&amp;do=diff"/>
        <created>2024-04-18T17:17:00-05:00</created>
        <issued>2024-04-18T17:17:00-05:00</issued>
        <modified>2024-04-18T17:17:00-05:00</modified>
        <id>http://kaatskit.com/dokuwiki/doku.php/gnucap:manual:examples:spice_to_verilog?rev=1713478620&amp;do=diff</id>
        <summary>Transition from SPICE to Verilog

In the not so distant past, people migrated from Fortran to C. But, as rewriting Fortran code does not always pay off, there are means to intergrate Fortran libraries into modern systems. Now close to everyone is running Fortran code, most without even noticing. We are in a very similar situation with SPICE and Verilog. Here are some examples that show how to connect the worlds. These build on verilog_basics.</summary>
    </entry>
    <entry>
        <title>gnucap:manual:examples:things_that_can_go_wrong</title>
        <link rel="alternate" type="text/html" href="http://kaatskit.com/dokuwiki/doku.php/gnucap:manual:examples:things_that_can_go_wrong?rev=1449869995&amp;do=diff"/>
        <created>2015-12-11T15:39:55-05:00</created>
        <issued>2015-12-11T15:39:55-05:00</issued>
        <modified>2015-12-11T15:39:55-05:00</modified>
        <id>http://kaatskit.com/dokuwiki/doku.php/gnucap:manual:examples:things_that_can_go_wrong?rev=1449869995&amp;do=diff</id>
        <summary>Voltage sources in parallel

eg4.ckt


VOLTAGE SOURCES IN PARALLEL

V1 1 0 10.0
V2 1 0 10.2
.print dc v(1) i(V1) i(V2)
.dc
.end


Here we have V1 and V2 both driving the same node at about 10 volts.
Actually, V2 is very slightly higher than 10 volts so there will be
some argument between V1 and V2 as to exactly what the final voltage
at node 1 really is. You should see that huge currents are flowing
through the supplies (10,000 amps) just due to this small voltage
difference. Also note that gnuc…</summary>
    </entry>
    <entry>
        <title>gnucap:manual:examples:verilog_basics</title>
        <link rel="alternate" type="text/html" href="http://kaatskit.com/dokuwiki/doku.php/gnucap:manual:examples:verilog_basics?rev=1681908475&amp;do=diff"/>
        <created>2023-04-19T07:47:55-05:00</created>
        <issued>2023-04-19T07:47:55-05:00</issued>
        <modified>2023-04-19T07:47:55-05:00</modified>
        <id>http://kaatskit.com/dokuwiki/doku.php/gnucap:manual:examples:verilog_basics?rev=1681908475&amp;do=diff</id>
        <summary>getting started, device and testbench

Lets look at spice first. An RC lowpass (1 ohm, 1 farad)... The stanza


gnucap&gt; spice
spice&gt; .subckt rclp in out ref
spice&gt;   R1 in out 1
spice&gt;   C1 out ref 1
spice&gt; .ends


declares a subcircuit (macro) with 3 ordered ports and no
parameters. It could model a PCB with a 3 pin connector (or so), and
some oversimplification.</summary>
    </entry>
</feed>
