0

I'm trying to implement a simple linear DC circuit in ngspice, but the program and manual are overwhelming. The circuit I'm trying to get started with is a voltage source (e.g. cell) connected to itself through a resistance.

Looking at the list of independent voltage sources (which I assume is what I need), I can't find a simple potential difference:

  • Pulse
  • Sinusoidal
  • Exponential
  • Piece-Wise Linear
  • Single-Frequency FM
  • Amplitude modulated source (AM)
  • Transient noise source
  • Random voltage source
  • Arbitrary Phase Sources

Am I misunderstanding something? How to design the circuit?

Jan
  • 3
  • 1

1 Answers1

1

There are some simple example netlists in the \Tests folder.

A DC voltage source would be specified as:

V1 1 0 5

Where V1 is the name (could be V2, V3, etc) 1 is node 1, 0 is circuit ground and 5 is the voltage.

Here is a basic circuit to try, a voltage source connected to a 1 ohm resistor and stepped from 0 to 10V with current plotted for R1 (not tried it but it should be okay, let me know if not)

** Circuit Description **
V1 1 0 5
R1 1 0 1

*.option noacct
.dc V1 0 10 1

.plot i(R1)

.end

It's probably not the easiest SPICE to pick up, you might want to try LTSpice.

stevenvh
  • 145,832
  • 21
  • 457
  • 668
Oli Glaser
  • 55,140
  • 3
  • 76
  • 148
  • Unfortunately, LTSpice doesn't seem to be available to Linux. – Jan Sep 16 '11 at 08:07
  • Ah, that's a shame as it's a great tool. Maybe you can run it in Wine? – Oli Glaser Sep 16 '11 at 14:37
  • You can. I remember reading somewhere that the LTSpice developers purposely code things in a way to help ensure it runs within Wine properly. I wish I could cite where I found that. – draeath Sep 16 '11 at 17:02
  • @draeath - Is it not the link I posted above? (it's not to the Wine page, it's to a discussion of spice on linux and mentions the tweaking - I should have been more descriptive with the link name) – Oli Glaser Sep 16 '11 at 20:14
  • I did not read it. – draeath Sep 16 '11 at 20:37