# 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?
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>

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.
--
__Pascal Bourguignon__ http://www.informatimago.com /
In deep sleep hear sound,
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>

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
The following, I think, talks about transforming capacitances into linear-equivalent models that can be included in nodal analysis.
http://www.ecircuitcenter.com/SpiceTopics/Transient%20Analysis/Transient%20Analysis.htm
Any use?
-- James
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
"James Harris" wrote:

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.