SPICE QUESTION

Hello,

I have a 3 nodes in circuit, and I'll like to apply a signal to each of them in a random manner while observing the output.

Is there a way to make the SPICE RND function do this?

Thanks.

Reply to
rush3k
Loading thread data ...

I posted a similiar question some time ago: See

formatting link

I did a short cut and just stung together a bunch of sine generators at strategic frequencies and amplitudes. D from BC

Reply to
D from BC

I'm not quite clear on what you mean by "in a random manner." Do you mean each signal is a (pseudo)random value, or that each signal is on or off at a point in time determined by a random draw? Or perhaps you mean something else.

I use LTSpice; its random function is certainly up to either task, though the second is easier, especially if you are willing to divide time into equal segments. You get a different random number, uniformly distributed between 0 and 1, from LTSpice's rand(x) function, for each different value of integer(x). That is to say, if you get y1 for rand(x), you will get y1 if you ask for rand(x) again with the same x, or with any x with the same integer part. You will get a different y for each different integer value of the argument. So you can do something like rand(1e6*time) to get a new random value each microsecond of your simulation. You can use SW components and boolean functions to generate on and off states of the switches as you desire--or you can multiply your signals by some function of the random value--or.... For example, "B 0 1 V=rand(1e6*time)>0.4" generates 1 volt 60% of the time, and 0 volts 40% of the time, divided into microsecond long chunks. Repeating the simulation gives the same result; add a large integer to the argument for rand to get a different set of random values.

Cheers, Tom

Reply to
Tom Bruhns

Le Fri, 02 Feb 2007 13:32:52 -0800, rush3k a écrit :

Random word should neer used at random.

Time-dependent or Frequency-dependent sources is merely achieved with spice

Habib

Reply to
habib.bouaziz-viallet

Yes, the link sheds some light on another way I could run the simulation and still get desired effects. Thanks!

Reply to
rush3k

Thanks for the reply Tom. LT/SwitcherCAD Spice has some interesting capabilities. However, its the nodes of the circuit that are to be chosen in a random manner. The amplitude and frequency of the signal is going to be fixed. So say I have 50 nodes numbered 1,2,3,...,49,50 in my netlist, I want to be able to apply the signal randomly to each of these nodes (23, 1, 38, 24, 51 ... etc) for a period of time. I have figured the RND function in SPICE is not able to do this .. so I'll probably use some BATCH programming or a PERL script with my SPICE

Reply to
rush3k

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.