sany
asked on
Electronics calculations using C
I am looking for an appropriate data-structure to represent and calculate the values of electronic components that connected (wired) in a circuit.
Questions:
- How do I resolve data storage for components that have many values (transistors) and for components that have a only a few (resistors, capacitors, yet don't end up with a dozen different "typedef struct"?
- How do I represent nodes -e.g. wires - connecting each components, since the components are
- not limited only to 2 nodes (transistors has 3 nodes)
- not limited to 2 wires (from a node any number of wires can origin)
If you have no idea, please answer these:
- Is it the problem that I am thinking too pictorically, and problems of this nature should be derived into equations and solved algebrically?
- Wouldn't be better to use C++ and create classes of components to pass data between components to simulate voltage/current/resistance values through the circuit?
- Am I have gone nuts?
Questions:
- How do I resolve data storage for components that have many values (transistors) and for components that have a only a few (resistors, capacitors, yet don't end up with a dozen different "typedef struct"?
- How do I represent nodes -e.g. wires - connecting each components, since the components are
- not limited only to 2 nodes (transistors has 3 nodes)
- not limited to 2 wires (from a node any number of wires can origin)
If you have no idea, please answer these:
- Is it the problem that I am thinking too pictorically, and problems of this nature should be derived into equations and solved algebrically?
- Wouldn't be better to use C++ and create classes of components to pass data between components to simulate voltage/current/resistance
- Am I have gone nuts?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If you need wires this is just a dummy element which as many nodes as you need.
ASKER
A linked list provides only a partial solution, and I'll still end up with all those struct for different components. Traveling a list even more difficult, but this is the only solution I have found so far, and have to consider...
Thanks -san
Thanks -san
I don't remember enuf about electronics though to give you much further advice though..