Programming a circuit simulator

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?

Reply to
sert
Loading thread data ...

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.

Reply to
Pascal J. Bourguignon

I don't know anything about the nodal method apart from what I've just read at

formatting link
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?

formatting link
The following, I think, talks about transforming capacitances into linear-equivalent models that can be included in nodal analysis.

formatting link
Any use?

-- James

Reply to
James Harris

formatting link
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.

Reply to
osmium

PolyTech Forum 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.