pspice netlist ac analysis

Discussion in 'The Projects Forum' started by sab.0991@gmail.com, Apr 13, 2011.

  1. sab.0991@gmail.com

    Thread Starter New Member

    Apr 13, 2011
    2
    0
    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
     
  2. sab.0991@gmail.com

    Thread Starter New Member

    Apr 13, 2011
    2
    0
    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
     
  3. retched

    AAC Fanatic!

    Dec 5, 2009
    5,201
    312
    have you defined a ground?
     
  4. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    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:

    Code ( (Unknown Language)):
    1.        --- AC Analysis ---
    2.  
    3. frequency:  60  Hz
    4. V(1):   mag:         12 phase:          0°     voltage
    5. V(2):   mag:    7.94876 phase:   -48.5171°     voltage
     
  5. StayatHomeElectronics

    Well-Known Member

    Sep 25, 2008
    864
    40
    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
     
  6. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    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.
     
  7. StayatHomeElectronics

    Well-Known Member

    Sep 25, 2008
    864
    40
    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...
     
  8. StayatHomeElectronics

    Well-Known Member

    Sep 25, 2008
    864
    40
    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 "*".
     
Loading...