Simulation of Circuits Without Kirchhoff's Laws?

Click For Summary
SUMMARY

This discussion focuses on simulating electrical circuits without relying on Kirchhoff's laws, specifically in the context of a project in Computational Physics. The project aims to numerically simulate Chua's Circuit using C++ 11 and the Runge-Kutta 4th order algorithm for time-dependent behavior. The developer seeks to define differential equations for circuit components as objects, tracking energy, voltage, and current, while exploring the nature of Kirchhoff's laws as either emergent behavior or governing principles. Key insights include the importance of maintaining Kirchhoff's laws in the simulation while avoiding complex matrix solutions.

PREREQUISITES
  • Understanding of C++ 11 programming concepts, including objects and polymorphism
  • Familiarity with numerical integration techniques, specifically Runge-Kutta 4th order
  • Basic knowledge of electrical circuit components, including resistors, inductors, and capacitors
  • Introductory concepts in Computational Physics and differential equations
NEXT STEPS
  • Research "C++ object-oriented programming for circuit simulation"
  • Learn about "numerical methods for solving differential equations in circuit analysis"
  • Explore "emergent behavior in electrical circuits and its implications"
  • Investigate "alternative algorithms for circuit simulation without Kirchhoff's laws"
USEFUL FOR

This discussion is beneficial for Computational Physics students, software developers working on circuit simulations, and electrical engineers interested in alternative methods for circuit analysis.

GEslinger
1. The problem statement, all variables, and given/known data
I am currently drafting a proposal for a project in Computational Physics. I'm planning on creating a program that simulates circuits numerically instead of solving the system of equations. The purpose of my project is to observe the emergent chaos in Chua's Circuit and compare it against a physical demo, though I plan to use my program to explore other circuits as well.
I would like to approach the project with numerical integration, as it supports time-dependent behavior in a circuit and provides a lot of data to compare with my demo. My problem is this: How do I find the proper differential equations (or systems thereof) to describe the circuit and link them together, preferably without solving a matrix with Kirchhoff's laws?

Homework Equations


The easiest algorithm for me to implement would be Runge-Kutta 4th order.
I can also implement a searching algorithm that identifies loops for use in Kirchoff's Laws, and I plan to store all junctions as objects to access the voltage and current at all points in the system.
I am currently using C++ 11 to program my project. It's extremely versatile and I have a lot of experience. I will probably be able to implement any solutions that use objects, polymorphic behavior, inheritance, and templates. What I cannot do, however, is pass around equations in a matrix, arrange them into REF or RREF, or isolate a variable to numerically integrate. I need the differential equations to be defined at the start of the program before I jump into a loop to start simulating the circuit. (If you know of a way to generate expressions at runtime, do tell!)
As for my weaknesses: I don't have a lot of experience with AC circuits nor LRC circuits. I am also somewhat new to Computational Physics, so I can't always come up with good algorithms. I still think my project is feasible.

The Attempt at a Solution


I would like to store each component in the circuit as an object, containing variables for resistance, inductance, capacitance, and the differential equations to track stored energy (for capacitors and inductors). They would also be able to access their voltages and currents through the junctions they're connected to. Every timestep would loop through each component, evaluate how its energy/voltage/current changes, and somehow update the voltage and current in each junction. I see a problem in that, inductors and capacitors can be driven by the circuit or drive it themselves, depending on the voltage and currents at a particular time.

The fundamental question that presents an issue is about the nature of all circuits. Are Kirchoff's laws simply emergent behavior of components acting individually, or do they govern the behavior of the circuit directly, thus being necessary to solve for every circuit? Any help, suggestions, or resources for further reading are appreciated.
 
Physics news on Phys.org
GEslinger said:
I see a problem in that, inductors and capacitors can be driven by the circuit or drive it themselves, depending on the voltage and currents at a particular time.
Not sure that you should worry about what drives what. These components have properties and follow rules that you should implement in your simulation. That should be all you have to worry about.
The fundamental question that presents an issue is about the nature of all circuits. Are Kirchoff's laws simply emergent behavior of components acting individually, or do they govern the behavior of the circuit directly, thus being necessary to solve for every circuit?
Your simulation should not violate Kirchoff's laws but that does not mean that you should have to solve a large matrix of simultaneous equations. The current into each node should equal the current out of it. And the sum of voltage drops around any closed loop should be 0. The current law can be simulated by making nodes an object that can neither create nor destroy current. I think simulating the voltage law is much more difficult since it includes an entire loop of components. It's not clear to me how to deal directly with that. Hopefully, it will take care of itself by the fact that all components follow correct electromagnetic rules.
 
Google : ' Analysis of electric circuits using differential equations and frontal solvers '
 

Similar threads

  • · Replies 22 ·
Replies
22
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
Replies
15
Views
3K
Replies
8
Views
2K
  • · Replies 42 ·
2
Replies
42
Views
7K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 17 ·
Replies
17
Views
13K
  • · Replies 1 ·
Replies
1
Views
2K