1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Help me understand what is happening with my NGSPICE coding..

Discussion in 'Circuit Simulation & PCB Design' started by sr13579, Jan 26, 2018.

  1. sr13579

    sr13579 Member

    Joined:
    Sep 9, 2017
    Messages:
    40
    Likes:
    0
    The thing is, I am confused with rawfile and .print card (spice.out file).
    There are like 3 options for rawfile generation: NONE,COMPACT and ACCURATE. While I am using NONE with the .print card the result is going inside a .out file without generating a rawfile. But when I am using ACCURATE or COMPACT the print card is ignored and showing some no listing warning. The rawfile is generated but the code is ignoring print card which means I am not getting any analytical result. How to fix this problem?(The code is:
    Voltage divider
    r1 1 2 10k
    r2 2 3 5k
    r3 3 4 4k
    r4 4 0 3k
    v 1 0 dc 4
    .dc v 4 4 1
    .print dc v(1,2) v(2,3) v(3,4) v(4)
    .op
    .end
     

    Attached Files:

  2. eTech

    eTech Active Member

    Joined:
    Apr 25, 2012
    Messages:
    636
    Likes:
    72
    ONLINE
    hi

    I use LTspice but the code should work.

    This is all you need:
    <-----I had to put a blank line here for the code to work.
    r1 1 2 10k
    r2 2 3 5k
    r3 3 4 4k
    r4 4 0 3k
    v1 1 0 dc 4 <---I renamed the voltage source for clairity
    ;.dc v1 4 4 1 <---don't need this because it defines a DC sweep
    .op
    ;.print dc v(1,2) v(2,3) v(3,4) v(4) <--don't need this because .op prints out all voltage and currents.

    Results from LTspice:

    --- Operating Point ---
    V(1): 4 voltage
    V(2): 2.18182 voltage
    V(3): 1.27273 voltage
    V(4): 0.545455 voltage
    I(R4): 0.000181818 device_current
    I(R3): 0.000181818 device_current
    I(R2): 0.000181818 device_current
    I(R1): 0.000181818 device_current
    I(V1): -0.000181818 device_current


    eT
     
    • Like Like x 1
  3. sr13579

    sr13579 Member

    Joined:
    Sep 9, 2017
    Messages:
    40
    Likes:
    0
    See that is what I was talking about. It won't generate a printed file .This is what is painful.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice