Friday, April 26, 2013

User defined objects

While examining current sources, I figured that since the basis for the circuit solver is mesh analysis, the current source will have to be converted to a voltage source in series with a resistance. This means a voltage source and a resistance in series connected in parallel with a voltmeter. So essentially the voltage source has to be adjusted with respect to the voltage measured so as to produce the necessary current.

So this starts another task that I was planning to do just before I released a major version. That is of user defined objects. Suppose, a user wants to create an object which is a voltage source in series with an RLC network and make a dozen copies of it in the circuit, how would that be done? As of now, the entire solver works on the basis of cell positions on the spreadsheet. But now these cell positions won't exist in real but fictitious cell positions will have to be created.

Suppose such an object is to be defined. How would the details be internally? Suppose it is placed at position 7E in the spreadsheet. How would each element be defined as cell positions in the loop as it may be more than one loop if there is a parallel element. One possibility is to go ahead with just one cell position but replicate the loop by the number of parallel elements in the loop (essentially the number of branches in parallel). So every time the object is called, an identifier needs to be created to know which parallel element to consider.

So essentially a third dimension needs to be added. This makes sense as we are adding layers to the spreadsheet. But this might need a complete rework of the entire solver! Need to think over this.

No comments:

Post a Comment