Maker Pro
Maker Pro

Programming a circuit simulator

S

sert

Jan 1, 1970
0
I'm programming a circuit simulator for nonlinear circuits. It
uses the nodal method and Newton-Raphson approximation to
calculate the node voltages. But I'm currently facing a problem:
how to treat dynamic elements, capacitor and inductances. I can
approximate the derivatives and integrals on which they depend,
but only if there is a previous value to use. What if it is t=0?

Obviously, we use the initial value supplied by the user, but
simply using the nodal method does not suffice in that case. Is
there some general programmable way to get the program started?
 
P

Pascal J. Bourguignon

Jan 1, 1970
0
sert said:
I'm programming a circuit simulator for nonlinear circuits. It
uses the nodal method and Newton-Raphson approximation to
calculate the node voltages. But I'm currently facing a problem:
how to treat dynamic elements, capacitor and inductances. I can
approximate the derivatives and integrals on which they depend,
but only if there is a previous value to use. What if it is t=0?

Obviously, we use the initial value supplied by the user, but
simply using the nodal method does not suffice in that case. Is
there some general programmable way to get the program started?

Well, you will have to start the (emulated) device first. Emulate a
switch on the power line, and start with the circuit open. You will
have 0 A of current everywhere, from t=0 to t=t1 when you close the
circuit.
 
O

osmium

Jan 1, 1970
0
James Harris said:
I don't know anything about the nodal method apart from what I've just
read at

http://en.wikipedia.org/wiki/Nodal_analysis

It does say it is for linear elements only which I presume doesn't
include capacitors and inductors - hence your post. Is section 3
onwards of the following any help?


http://montagne.nl/analog-electronics/modified-nodal-analysis/modified-nodal-analysis.xhtml

Nonlinear means the circuit contains an amplifier, such as a transistor.
Ordinary capacitors and inductors are linear, but there is an obscure thing
called a "swinging choke" (an inductor) which may alter something for the
joy of the green eyeshade set. I don't know what the OP was trying to
convey when he said "dynamic"; in my mind there is nothing dynamic about
capacitors and inductors. The _currents_ and _voltages_ change with time,
not the elements.

Nodal analysis depends on Kirchoff's law which says that the algebraic sum
of all currents entering and leaving a junction are zero.

The OP wants to do what is called "transient analysis" using Kirchoff's law.
There must be at least one voltage present to do the analysis and he has
already been told to assume it goes from zero to some known value,
identified in the circuit diagram, at t=0.
 
Top