pspice netlist ac analysis

Thread Starter

sab.0991@gmail.com

Joined Apr 13, 2011
2
can some1 help me??? i am gettin an error in pspice ad
node 1 is floating
node 2 is floating
v1 1 0 ac 12 sin

r1 1 2 30ohm

c1 2 0 100uf

.ac lin 1 60 60

.print ac v(1,2) v(2)

.end
 

SgtWookie

Joined Jul 17, 2007
22,230
have you defined a ground?
Node 0 is ground.
V1 and C2 both have the 2nd terminals connected to node 0.

Sab,
Don't know why you're getting that error in pspice.

I ran it in LTSpice, and received this output:

Rich (BB code):
       --- AC Analysis ---

frequency:	60	Hz
V(1):	mag:         12 phase:          0° 	voltage
V(2):	mag:    7.94876 phase:   -48.5171° 	voltage
 
I ran the same thing in LTSpice and was only able to get the same output as Sgt.Wookie after I put a comment line in as the first line. Below is the file that I ran. I don't remember back to the days where I typed in my SPICE input, but a first line comment may be required.

First Order LowPass Filter
v1 1 0 ac 12 sin
r1 1 2 30ohm
c1 2 0 100uF
.ac lin 1 60 60
.print ac v(1,2) v(2)
.end
 

SgtWookie

Joined Jul 17, 2007
22,230
StayatHomeElectronics,
In order to tell SPICE that a line is a comment, you need to start it with an asterisk "*"

* Example SPICE comment line
* Sab.0991's spice file
v1 1 0 ac 12 sin
r1 1 2 30ohm
c1 2 0 100uF
.ac lin 1 60 60
.print ac v(1,2) v(2)
.end

I did not need a starting comment. I did try it both with and without the double spacing, but it made no difference in LTSpice.
 
I also used LTSpice, version IV.

The first line in the editor that I get to seems to be forced to be a comment, i.e. it is highlighted green like other lines that are marked with the asterisk. It appears to be a comment with or without the asterisk. If I just skip the first line and leave it blank, the simulation also works correctly.

There seems to be something special about the first line there, I don't know why. But I did get errors running the simulations when actual code is on the first line. It did not read it correctly. Skip down to the second line and all seems fine...
 
After reading about SPICE netlists, the first line seems to be ignored or considered the title line in many implementations. So, it is not a true comment like I referred to it before, which require the "*".
 
Top