Menu

#43 absolute current ?

v1.0 (example)
open
nobody
None
5
2019-08-19
2019-08-06
Samir Sabri
No

I need to have a switch controlled by current, but I need to treat the current value as absolute value, so that wither its positive or negative, I can use the same model settings for the switch.

is there any possible way to achieve this?

Related

Support Requests: #43

Discussion

  • Holger Vogt

    Holger Vogt - 2019-08-06

    Use two switches in parallel, one opened with positive, one with negative current.

    Or use a B source with an expression containing the current and a ternary function a?b:c to check if the current is positive or negative.

     
    • Samir Sabri

      Samir Sabri - 2019-08-07

      Can you please give simple example of both approaches? I am just very new
      to Ngspice and I've just discovered B

      On Wed, Aug 7, 2019, 12:27 AM Holger Vogt h_vogt@users.sourceforge.net
      wrote:

      Use two switches in parallel, one opened with positive, one with negative
      current.

      Or use a B source with an expression containing the current and a ternary
      function a?b:c to check if the current is positive or negative.


      Status: open
      Group: v1.0 (example)
      Created: Tue Aug 06, 2019 05:42 PM UTC by Samir Sabri
      Last Updated: Tue Aug 06, 2019 05:55 PM UTC
      Owner: nobody

      I need to have a switch controlled by current, but I need to treat the
      current value as absolute value, so that wither its positive or negative, I
      can use the same model settings for the switch.

      is there any possible way to achieve this?

      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/ngspice/support-requests/43/

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

       

      Related

      Support Requests: #43

  • Samir Sabri

    Samir Sabri - 2019-08-19
     
    • marcel hendrix

      marcel hendrix - 2019-08-19

      On 2019-08-19 06:34, Samir Sabri wrote:

      [..]

      I need to have a switch controlled by current, but I need to treat the
      current value as absolute value, so that wither its positive or
      negative, I can use the same model settings for the switch.

      is there any possible way to achieve this?

      Instead of driving the switch directly from a network current,
      add a B-source to control it indirectly. The B-source equation
      allows one to apply an arbitrary expression to the node voltages
      and branch currents that are to set the switch state. Adding the
      B-source allow to use either a current or voltage controlled
      switch.

      -marcel

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.