Menu

#314 How to probe a current inside a subckt

v1.0 (example)
closed-invalid
nobody
None
3
2015-09-23
2015-09-22
No

I would like to know how to probe a current inside subckt. I can not find an example of that in the manual.

Ex.
.subckt test a b
VR1 a c 0
R1 c b 10
.ends

XR1 ax 0
V1 ax 0 1

.control
save @XR1.R1[i] all
dc v1 0 5 0.1

plot @XR1.R1[i] <-- Does not work
plot i(XR1.VR1) <-- Does not work

.endc

.end

I don't know what else to try.
Note. I work with voltages but not currents?

Could somebody please guide me
Thank you.

Related

Bugs: #314

Discussion

  • marcel hendrix

    marcel hendrix - 2015-09-23

    Use the "listing e" command to see how to reference.
    The below example works.

    The .save command has a problem with "@" that I don't
    understand right now, or maybe it has to do with the
    DC command.

    -marcel

    ~~~~
    ::html

    Example probing

    .subckt test a b
    VR1 a c dc=1.234
    R1 c b 10
    .ends test

    XR1 ax 0 test
    V1 ax 0 dc=1

    .save @r.xr1.r1[i] all

    .control
    listing e
    dc v1 0 5 0.1
    plot v(xr1.c)
    plot @r.xr1.r1[i]
    .endc

    .end

     

    Last edit: marcel hendrix 2015-09-23
    • Carsten B Rasmussen

      Hej Marcel.
      Thank you for clarifying this.

      So as I understand from you the syntax for device probing is.

      @<device letter="">.<subckt>. ..<devicename></devicename></subckt></device>

      Correct!

      Thanks

      marcel hendrix wrote:

      Use the "listing e" command to see how to reference.
      The below example works.

      The .save command has a problem with "@" that I don't
      understand right now, or maybe it has to do with the
      DC command.

      -marcel

      ~~~~
      ::html

      Example probing

      .subckt test a b
      VR1 a c dc=1.234
      R1 c b 10
      .ends test

      XR1 ax 0 test
      V1 ax 0 dc=1

      .control
      listing e
      dc v1 0 5 0.1
      plot v(xr1.c)
      plot @r.xr1.r1[i]
      .endc

      .end


      ** [bugs:#314] How to probe a current inside a subckt**

      Status: open
      Group: v1.0 (example)
      Created: Tue Sep 22, 2015 10:29 PM UTC by Carsten B Rasmussen
      Last Updated: Tue Sep 22, 2015 10:29 PM UTC
      Owner: nobody

      I would like to know how to probe a current inside subckt. I can not find an example of that in the manual.

      Ex.
      .subckt test a b
      VR1 a c 0
      R1 c b 10
      .ends

      XR1 ax 0
      V1 ax 0 1

      .control
      save @XR1.R1[i] all
      dc v1 0 5 0.1

      plot @XR1.R1[i] <-- Does not work
      plot i(XR1.VR1) <-- Does not work

      .endc

      .end

      I don't know what else to try.
      Note. I work with voltages but not currents?

      Could somebody please guide me
      Thank you.


      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/ngspice/bugs/314/

      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

      --

      Yours sincerely

      Carsten Bleser Rasmussen
      Technical Director - R & D


      Polaric
      Jernholmen 54B
      DK-2650 Copenhagen SV
      Denmark
      (tlf) (+45)70225579
      (mob) (+45)42720739
      http://www.polaric.dk


       

      Related

      Bugs: #314

  • marcel hendrix

    marcel hendrix - 2015-09-23

    In principle: yes.

    My example lacked a .save command for the resistor current. I have corrected that now by editting the answer. The plots should now be what you intended.

    Your question is not a bug and is better put on the ngspice-user forum.

    -marcel

     
  • marcel hendrix

    marcel hendrix - 2015-09-23
    • status: open --> closed-invalid
     

Log in to post a comment.

MongoDB Logo MongoDB