Help creating circuit simulation software

Click For Summary
SUMMARY

This discussion focuses on creating a circuit simulation software using Adobe Flash, where users can build circuits by dragging components like batteries, resistors, and bulbs onto a grid. The key challenge is resolving voltage and current values at various points in the circuit, which involves applying Kirchhoff's current law to generate equations for the circuit's nodes. The process requires labeling nodes, determining ground reference, and handling errors in user input. A linear matrix package will be necessary for solving the resulting equations.

PREREQUISITES
  • Understanding of Kirchhoff's current law
  • Basic knowledge of circuit components (batteries, resistors, etc.)
  • Familiarity with linear algebra and matrix operations
  • Experience with Adobe Flash for multimedia software development
NEXT STEPS
  • Research how to implement Kirchhoff's current law in circuit simulations
  • Learn about labeling nodes and handling dangling nodes in circuit design
  • Explore linear matrix packages for solving systems of equations
  • Investigate error handling techniques for user inputs in simulation software
USEFUL FOR

Software developers, electrical engineering students, and educators looking to create interactive circuit simulations or enhance their understanding of circuit analysis.

chuckylefrek
Messages
1
Reaction score
0
I am creating a circuit building simulation using multimedia software 'Flash'.

Basically the user is presented with a circuit board onto which they can drag components such as batteries, resistors, bulbs, ammeters, voltmeters, switches, and of course lengths of wire.

I have been reading up on ohms law and kirchhoffs law and whilst I understand the principles, I am not sure how to go about resolving the values for the voltage and current at any point on the circuit.

I think I need to work this out based on the entire circuit that the user has built.

What I would like is to know the order of steps to resolve a circuit. The circuit board will have 5 pegs across and 4 down. So the user basically drops the elements (e.g bulbs) in between the pegs to create their custom circuit.

I have a feeling that some seriously difficult maths and physics may be involved like simultaneous equations and matrixes?

If there are any physics experts out there, the more detail you can give me about solving this, the better!

Many thanks in advance

Paul
 
Physics news on Phys.org
In the completely general case, you will have a linear equation in 20 unknowns, the voltage at each of the 20 pegs on the board.

You generate the 20 equations to solve for the 20 unknowns by applying Kirchoff's current law at each peg

You'll have to decide what to do about wires - will they have a truly infinite conductance, or a finite conductance?
 
I had a few more thoughts about the best way to tackle this, but it may be an ambitious project.

The first step is to go through and to number or otherwise label all the "nodes" in the circuit. Any two "pegs" connected by wires should be given the same "node" number. You'll probably want to flag any "dangling" nodes with only one connection for special treatment. Unused pegs don't get a node number.

After this, you start generating equations. A battery connected between two different nodes will set the voltage difference between them. A battery with both terminals conneted to the same node is an error. You'll have to think about how you go about flagging this error to the user.

You'll need to set one node in the circuit as the "ground" or reference node, with a potential of zero. You might label one peg on your circuit "ground", you'll have to think about how the ground node is determined. What if the user doesn't connect anything to the ground node, for instance?

A node that does not connect to a battery in any way whatsoever will have its voltage determined by Kirchoff's current law. The current to a neighboring node will be the voltage difference divided by the resistance. Sum and set to zero. Nodes connected to a battery won't generate any Kirchoff's current law eq's because whatever current is needed will come from the battery.

You'll probably want to give voltmeters a finite but large resistance (10 megohms is probably good), in case some joker puts two voltmeters in series with a battery to see what happens.

You'll probably want to give switches a small but finite "on" resistance. What happens if someone shorts out a battery with a switch?

It may or may not be desirable to give ammeters a finite resistance.

You'll need someway to solve all the equations once you generate them (probably a linear matrix package, elimination to tri-diagonal form).
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 38 ·
2
Replies
38
Views
7K
  • · Replies 21 ·
Replies
21
Views
5K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
10K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K