Behavioral Source in NgSpice

Discussion in 'General Electronics Chat' started by Nina_, Feb 12, 2013.

  1. Nina_

    Thread Starter New Member

    Dec 11, 2012
    7
    0
    [​IMG] 2013-02-12 10:20:49 PST
    [​IMG] 2013-02-12 10:20:49 PST
    Hallo everybody,

    I try to simulate an electronic circuit depicted in the annexed file.
    https://dl-web.dropbox.com/get/GlobalmodelB.pdf?w=AAAAsgT0zh0uZdsEnE24XsTYvXqRwNzqshJwuDjh3k8TMg

    This circuit contains two nonlinear devices : These two devices are depending on the charge density and are defined as follows:

    Vs = K * Q^2

    Id = kd1 * exp(-Q/kd2)

    where I = dQ / dt

    Is it possible to use the Behavioral Source? According to the ngspice manual 25 , the nonlinear Source are only depending on the node voltages and branch current. In my case the nonlinear Source or device depends on the integration of the branch current. Is it possible to define a B-source which depends on the integration of the branch current ?

    Many thanks in advance !

    Best regards

    Nina
     
  2. Nina_

    Thread Starter New Member

    Dec 11, 2012
    7
    0
  3. Brownout

    Well-Known Member

    Jan 10, 2012
    2,375
    998
    As far as I know, there is no facility to use behavioral source in Spice simulators. I could be wrong, and if I am, I'd be interested in finding out. I've often wanted to do this in LTSpice, but believed that I couldn't. However, that doesn't mean you can't simulate this circuit. You should be able to quite easily.
     
  4. Brownout

    Well-Known Member

    Jan 10, 2012
    2,375
    998
    PS: It occured to me that you can probably do what you want in Matlab or Simulink. Not sure, I'm not really a Matlab guy, but there are forums dedicated to it, not on this site obviously.
     
  5. Nina_

    Thread Starter New Member

    Dec 11, 2012
    7
    0
    Hallo, iI try to do it in ngSpice which is comprised of Spice3 , xspice and cider..
    Ngspice allows using of Behavioral source...
    like ,
    B1 n2 n1 V= f(v or i) or
    B2 n2 n1 I= f(v or i )

    but my problem is that my function depends on the Integration of i not on the i directly !
     
Loading...