Find closed figures within a group of points?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Find closed figures within a group of points?
For anyone who is interested in following my quest for "finding closed figures within a group of points".
Attached my latest progress using the input from forum.
I added small boxes to each point to later use a routine to detect the intersection of a wire or resistor with the point. I still have not found a simple way to find the resistor loops (rectangles containing resistors and wires).
Thanks,
David
Attached my latest progress using the input from forum.
I added small boxes to each point to later use a routine to detect the intersection of a wire or resistor with the point. I still have not found a simple way to find the resistor loops (rectangles containing resistors and wires).
Thanks,
David
- Attachments
-
- Circuit Resistace Finder_Zip_3.livecode.zip
- (9.9 KiB) Downloaded 160 times
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Find closed figures within a group of points?
Hi David,
if you give a relevant name for yours groups (you began it with "Resistor_A"), this will be clearer and you will be able to define yours loops.
Best
Jean-Marc
if you give a relevant name for yours groups (you began it with "Resistor_A"), this will be clearer and you will be able to define yours loops.
Best
Jean-Marc
https://alternatic.ch
Re: Find closed figures within a group of points?
Jean-Marc,
I have update my LC file with relative name on the resistors to define the loops. In this example, I have three loops:
Loop 1 - Resistor_1, Resistor_2, Resistor_3, Resistor_6, Resistor_9, Resistor_11, Resistor_12
Loop 2 - Resistor_4, Resistor_5, Resistor_6, Resistor_7, Resistor_8
Loop 3 - Resistor_8, Resistor_9, Resistor_10
Is there a relative easy way of for a routine to find these three loops?
Thanks,
David
I have update my LC file with relative name on the resistors to define the loops. In this example, I have three loops:
Loop 1 - Resistor_1, Resistor_2, Resistor_3, Resistor_6, Resistor_9, Resistor_11, Resistor_12
Loop 2 - Resistor_4, Resistor_5, Resistor_6, Resistor_7, Resistor_8
Loop 3 - Resistor_8, Resistor_9, Resistor_10
Is there a relative easy way of for a routine to find these three loops?
Thanks,
David
- Attachments
-
- Circuit Resistace Finder.livecode 4.zip
- (10.05 KiB) Downloaded 163 times
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Find closed figures within a group of points?
David
Relevant naming becomes the base for me.
I lost a lot of times avoiding this step.
Probably use array would be a good way in this case
I'm not a specialist but I'am sure someone will help soon
Best
Jean-Marc
Relevant naming becomes the base for me.
I lost a lot of times avoiding this step.
Probably use array would be a good way in this case
I'm not a specialist but I'am sure someone will help soon
Best
Jean-Marc
https://alternatic.ch
-
- VIP Livecode Opensource Backer
- Posts: 9656
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Find closed figures within a group of points?
I still do not know the basic intent. It has always been to create closed loops, not to create resistor networks, which do not require closure. I do understand that you need at least one closed loop since I now see a voltage source in the mix.I still have not found a simple way to find the resistor loops
If you set a string point, and I highly recommend that you do, say, always the upper left at the anode, and you have mapped and named the grid intersections. you can use brute force to find you way through what essentially a maze.
So if you travel you will know the names of the adjacent points. You can then see if there are any components there. These might orient in one of three possible directions. A property of each MUST have its orientation as well as its points. Try one after another, always in the same order, collecting components and their map locations until you find yourself at the cathode.
This is real brute force, as I said. In your latest picture, you start upwards. You continue up until you either find yourself at the border or find a component. You do indeed find a component, and it is a wire going to the right.
Just keep going. You will get to points with two or more filled adjacent points. Collect them all. Keep track. When you get to the cathode, you have a list of connections.
I still think that unclosed pathways have merit.
Fun
Craig
Re: Find closed figures within a group of points?
Craig,
The intent of this app is to provide a tool for finding the total resistance of groups of resistors that the user configures between the dots. To calculate the total resistance using the "Mesh Current" method, I need to have current flow through each circuit. That is why there is a voltage source and why the loops have to be closed.
You are right, there must be a starting point and that point is the anode of the voltage source. The end point of one of the loops will need to be at the cathode.
So the point of this app is to allow the user to quickly create a resistor group for which he or she is wanting to know the total resistance of.
I am thinking that your "brute force" method may be the only way to accomplish my goal of finding all the loops within the group of points.
Thanks,
David
The intent of this app is to provide a tool for finding the total resistance of groups of resistors that the user configures between the dots. To calculate the total resistance using the "Mesh Current" method, I need to have current flow through each circuit. That is why there is a voltage source and why the loops have to be closed.
You are right, there must be a starting point and that point is the anode of the voltage source. The end point of one of the loops will need to be at the cathode.
So the point of this app is to allow the user to quickly create a resistor group for which he or she is wanting to know the total resistance of.
I am thinking that your "brute force" method may be the only way to accomplish my goal of finding all the loops within the group of points.
Thanks,
David
-
- VIP Livecode Opensource Backer
- Posts: 9656
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Find closed figures within a group of points?
David.
Just reread the entire thread, and missed a couple of replies, which is why I kept harping on what your intent was and why you needed closed loops.
There are probably methods in several disciplines that can do this much more cleverly. If Euler could do it with the Konigsberg bridges, LC can do it with brute force. It will be fun if you don't get bogged down with the forks on top of the forks.
Craig
Just reread the entire thread, and missed a couple of replies, which is why I kept harping on what your intent was and why you needed closed loops.
There are probably methods in several disciplines that can do this much more cleverly. If Euler could do it with the Konigsberg bridges, LC can do it with brute force. It will be fun if you don't get bogged down with the forks on top of the forks.
Craig
Re: Find closed figures within a group of points?
Thanks Craig