Re: [Numpy-discussion] length - sticks algorithm

2014-07-29 Thread Robert Kern
On Tue, Jul 29, 2014 at 12:47 PM, Josè Luis Mietta 
joseluismie...@yahoo.com.ar wrote:

  Robert, thanks for your help!

 Now I have:

 * Q nodes (Q stick-stick intersections)
 * a list 'NODES'=[(x,y,i,j)_1,, (x,y,i,j)_Q], where each element
 (x,y,i,j) represent the intersection point (x,y) of the sticks i and j.
 * a matrix 'H' with Q elements {H_k,l}.
 H_k,l=0 if nodes 'k' and 'l' aren't joined by a edge, and H_k,l = R_k,l =
 the electrical resistance associated with the union of the nodes 'k' and
 'l' (directly proportional to the length of the edge that connects these
 nodes).
 * a list 'nodes_resistances'=[R_1, ., R_Q].

 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 (see attached files). I
 have no ideas about how to do that. Can you help me?


Please do not send largish binary attachments to this list. I do not know
off-hand how to do this, but it looks like the EE201 document you attached
tells you how. It is somewhat beyond the scope of this mailing list to help
you understand that document, sorry.

-- 
Robert Kern
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] length - sticks algorithm

2014-07-29 Thread Derek Homeier
On 29 Jul 2014, at 02:43 pm, Robert Kern robert.k...@gmail.com wrote:

 On Tue, Jul 29, 2014 at 12:47 PM, Josè Luis Mietta 
 joseluismie...@yahoo.com.ar wrote:
 Robert, thanks for your help!
 
 Now I have: 
 
 * Q nodes (Q stick-stick intersections)
 * a list 'NODES'=[(x,y,i,j)_1,, (x,y,i,j)_Q], where each element 
 (x,y,i,j) represent the intersection point (x,y) of the sticks i and j.
 * a matrix 'H' with Q elements {H_k,l}. 
 H_k,l=0 if nodes 'k' and 'l' aren't joined by a edge, and H_k,l = R_k,l = the 
 electrical resistance associated withthe union of the nodes 'k' and 'l' 
 (directly proportional to the length of the edge that connects these nodes).
 * a list 'nodes_resistances'=[R_1, ., R_Q].
 
 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 (see attached files). I have 
 no ideas about how to do that. Can you help me? 
 
 Please do not send largish binary attachments to this list. I do not know 
 off-hand how to do this, but it looks like the EE201 document you attached 
 tells you how. It is somewhat beyond the scope of this mailing list to help 
 you understand that document, sorry.
 
And it is not a good idea to post copyrighted journal articles to a list where 
they will end
up in a public list archive (even if not immediately recognisable so).

Derek

___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] length - sticks algorithm

2014-07-22 Thread Robert Kern
What have you tried? What exactly are you having problems with? Loosely, I
would suggest the following approach:

For each stick, iterate over each stick that intersects with it (as
recorded in M). Find the coordinates of all of the intersection points.
Label the intersection points by the IDs of the two sticks that form the
intersection (normalize these IDs by keeping them in order so you don't
duplicate intersections already found; e.g. (2, 5), not (5, 2)).
Arbitrarily, but consistently, pick one end of the stick and find the
distances from that end to each of the intersection points. This induces an
order on the intersections with that stick by sorting the intersections by
their distance from the arbitrary end of the stick. You will need this to
determine which intersections on the same stick are neighbors and which
aren't. I.e., if you have 3 intersections with a given stick, (i,j), (i,k),
and (i,l), you want (i,j)-(i,k), and (i,k)-(i,l), but not (i,j)-(i,l). You
can find the distances between each of the intersections easily from that.
Use a networkx Graph to record the distances (you are making a so-called
weighted graph).


On Tue, Jul 22, 2014 at 12:19 PM, Josè Luis Mietta 
joseluismie...@yahoo.com.ar wrote:


Hi experts!

 Im working with 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:
 [image: enter image description here]
 without lose the connectivity information (which intersection is connected
 to which). In the figure, (A) is the system with sticks.

 I dont know how to do this. Im a python + numpy user.

 Waiting for your answers!

 Thans a lot

 ___
 NumPy-Discussion mailing list
 NumPy-Discussion@scipy.org
 http://mail.scipy.org/mailman/listinfo/numpy-discussion




-- 
Robert Kern
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion