- #1
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?
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.
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.
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.