Maker Pro
Maker Pro

Modelling discrete components

J

James Harris

Jan 1, 1970
0
I am looking for a way to write pieces of software to simulate the
'behaviour' of a resistor, a capacitor, an inductor, a diode etc. and
need a common set of parameters to communicate between the modules. Each
module would be one component. I wonder what would be the best
information for the interface between modules - i.e. for each component
to process and to output. I guess I'm looking for a common interface
between diverse components.

I don't think a simple voltage and current model is workable as I need
to account for the impedance of the supply. A simple resistor, if it is
low enough value relative to the supply impedance, will modify the
values passed to it so I cannot put, say, 3V across a resistor and
expect it to remain 3V.

My first thought is that I need to account for charge. If the component
is supplied
1) Potential across its terminals
2) Charge available
3) A time over which to calculate - say 1 microsecond

could it then 'reply' with the charge used (or, needed) in the time
interval?

Second thought is for the component to be supplied
1) Potential across its terminals
2) A time over which to calculate

and it returns an instantaneous resistance. A capacitor, for example,
would begin with zero and increase to infinity as it charges.

In either case I need to modify the source of the voltage according to
its impedance and the circuit load. Please note that the intention is to
model the components over 'real time' so a static analysis of an AC
circuit isn't any good.

There must be a better way that I have described. I'm not even sure I
can get this to work. Any suggestions?
 
P

Pooh Bear

Jan 1, 1970
0
James said:
I am looking for a way to write pieces of software to simulate the
'behaviour' of a resistor, a capacitor, an inductor, a diode etc.

Have you looked at Spice ?

Graham
 
D

Don Taylor

Jan 1, 1970
0
James Harris said:
I am looking for a way to write pieces of software to simulate the
'behaviour' of a resistor, a capacitor, an inductor, a diode etc. and
need a common set of parameters to communicate between the modules. Each
module would be one component. I wonder what would be the best
information for the interface between modules - i.e. for each component
to process and to output. I guess I'm looking for a common interface
between diverse components.
I don't think a simple voltage and current model is workable as I need
to account for the impedance of the supply. A simple resistor, if it is
low enough value relative to the supply impedance, will modify the
values passed to it so I cannot put, say, 3V across a resistor and
expect it to remain 3V.

My first thought was that you should model the supply too.
Then resistors remain relatively simple resistors, at least
as long as you don't exceed the power the device can handle.
That seems like it would make your components much closer
to the textbook models.
 
J

John Jardine.

Jan 1, 1970
0
"James Harris" <no.email.please> wrote in message

[...]
Before coming across Spice's real time 'Transient' analysis, I started
writing a prog using energy as the medium of exchange. The stuff either got
dissapated or pooled but the sums added up OK.
Joules were handed around and each circuit element dismantled it back into
appropriate volts and amps based on the component type and the stored state
from the previous time increment.
I remember it got horribly yukky but I'm not a programmer.
john
 
John said:
"James Harris" <no.email.please> wrote in message

[...]
Before coming across Spice's real time 'Transient' analysis, I started
writing a prog using energy as the medium of exchange. The stuff either got
dissapated or pooled but the sums added up OK.
Joules were handed around and each circuit element dismantled it back into
appropriate volts and amps based on the component type and the stored state
from the previous time increment.
I remember it got horribly yukky but I'm not a programmer.
john

That sounds like the kind of thing I was thinking about. I guess I
would need to deal in Volts and Charge rather than Energy if my
understanding of capacitors is correct: if one is charged from a 12V
supply then the supply is removed will the capacitor essentially
provide its charge into a load at 12V - at least initially? In other
words is the voltage at which the capacitor was charged important? I'm
a bit confused about that (as you can probably tell).

Using the water analogy I think of charge as the quantity of water and
voltage as its (average) height. Energy I understand as the product of
the two so I guess I will need to handle either Joules _or_ Volts and
Coulombs.
 
Jasen said:
It's been done. download the source for berkeley spice from sunsite.
snip

It sounds like you have a lot of simultaneous equations to solve...

I'm not sure. I think simultaneous equations would be needed to derive
a formula for how parts of the circuit vary with time (maybe I
misunderstand, though) but I was thinking of what I now understand is
called a discrete time simulation - don't you love buzzwords? I've
found an article on this at

<http://www.commsdesign.com/design_corner/showArticle.jhtml?articleID=175400126>
 
John said:
"James Harris" <no.email.please> wrote in message

[...]
Before coming across Spice's real time 'Transient' analysis, I started
writing a prog using energy as the medium of exchange. The stuff either got
dissapated or pooled but the sums added up OK.
Joules were handed around and each circuit element dismantled it back into
appropriate volts and amps based on the component type and the stored state
from the previous time increment.
I remember it got horribly yukky but I'm not a programmer.
john

That sounds like the kind of thing I was thinking about. I guess I
would need to deal in Volts and Charge rather than Energy if my
understanding of capacitors is correct: if one is charged from a 12V
supply then the supply is removed will the capacitor essentially
provide its charge into a load at 12V - at least initially? In other
words is the voltage at which the capacitor was charged important? I'm
a bit confused about that (as you can probably tell).

Using the water analogy I think of charge as the quantity of water and
voltage as its (average) height. Energy I understand as the product of
the two so I guess I will need to handle either Joules _or_ Volts and
Coulombs.
 
Top