Reputation: 81
Im working conductivity of sticks film - systems**. In my algorithm (N sticks) I have the intersection graph matrix M (M is a NxN matrix, M_ij=1 if sticks 'i' and 'j' do intersect, and M_ij=0 if sticks 'i' and 'j' do not).
Also I have 2 lists with the end-points of each stick. In addition, I can calculate the intersection point (If exist) between sticks.
I want to calculate all the distances between the points of intersection (1,2,3,...N) in the next figure without lose the connectivity info (which intersection is connected to which):
In this figure (A) is the system with sticks.
Any idea for a code that do this?
Im a python + numpy user.
Waiting for your answers!
Thans a lot
Now I have:
All nodes with 'j' (or 'i') = N+1 have a electric potential 'V' respect all nodes with 'j' or 'i' = N.
Now I must apply NODAL ANALYSIS for determinate the electrical current through each of the edges, and the net current. I have no ideas about how to do that. Can you help me?
Thanks a lot!
Best regards, José Luis
Upvotes: 1
Views: 149
Reputation: 34829
The first step is to determine what data structures are needed to store information about the network. For example, in the C programming language, I would start with 3 arrays of structures (afaik the python equivalent is lists of tuples).
The first structure would have information about each intersection, including the intersection ID and (x,y) coordinates.
The second structure would have stick information, including the stick ID, and resistance per unit length.
The final structure would be the connection structure, which would contain two intersection IDs (the endpoints of the connection), and a stick ID (the stick that makes the connection).
That dataset fully describes the network, and once you've got that set up, you should be able to proceed to the next step: solving the network.
The next step is to apply Kirchhoff's law and Ohm's law to the network to create a large number of linear equations in a large (hopefully equal) number of variables. In the drawing below, Kirchhoff's law tells us that
i13 + i23 - i34 = 0
In other words, the sum of the currents flowing into Node 3 must be zero. (Since i34 is flowing out of Node 3, it gets a sign change.)
Then from Ohm's law we know that
i13 = (V1 - V3) / R13
i23 = (V2 - V3) / R23
i34 = (V3 - V4) / R34
Substituting back into the first equation, we have
V1/R13 + V2/R23 + V3*(-1/R13 + -1/R23 + -1/R34) + V4/R34 = 0
Hence we have 1 equation in 4 variables. All we need is another 3 equations, and we should be able to solve for all of the V's. Having found N equations in N variables, you'll need to come up with software that solves that system of equations. I won't be able to help you with that. Good luck :)
Upvotes: 1