Page 1 of 1

Fitting the output of the Linear Circuit Builder

Posted: Sun Aug 26, 2018 12:22 pm
by finesniper
Dear Ted,

I encountered a problem when fitting the voltage-response of a node with the multiple run fitter. I could do everything as expected until a certain point, which was the implementation of more than 12 parallel RC components into my reduced circuit. After the 13th, the Linear Circuit Builder said that I encountered inconsistencies. This always happened at the 13th point, with ordiary values as well, so I stopped at 12. However, when I started fitting the voltage of a certain node, which I could do before the 12 RC components (with a reduced circuit), the multiple run fitter started to encounter some problems. The regular error massage was: Section access unspecified.. This always happens, no mather what point I chose as variable to fit, and at the same time, I can plot the desired variable at the current graph window. I would greatly appreciate if yo could help me with this problem.


Re: Fitting the output of the Linear Circuit Builder

Posted: Sun Aug 26, 2018 4:56 pm
by ted
Does the MRF reference variable and parameter names that the interpreter understands? Remember, the nice names that appear on the LinearCircuit tool's canvas aren't the ones that the interpreter will know. For example, I just now set up a simple circuit like this
where the circuit elements on the canvas are called B, R, and C, and the ungrounded nodes are labeled Vi (i for input) and Vo (o for output). Clicking on the LinearCircuit tool's "Name map" button (on the tool's Simulate page) brings up a panel that reveals the following:
the parameter values for C and R are stored in the first elements of two Vectors (ElementBase[1].val.x[0] and ElementBase[1].val.x[0]), and the values of Vi, Vo, and the current I delivered by the voltage source are stored in three elements of one Vector (Vector[5].x[0], Vector[5].x[1], and Vector[5].x[2]). If the voltage source generates a 1 mV pulse that starts at t = 1 ms and continues forever, and the values of R and C are 1 megohm and 1 nF (so time constant is 1 ms), then if I launch a simulation that ends at t = 2 milliseconds, this command
for j=0,2 print j, Vector[5].x[j]
0 1
1 0.62756938
2 0.37243062
and these are the correct values for Vi, Vo, and I at t = 2 ms.

Since problems didn't happen until your model grew to 12 or 13 nodes, presumably the MRF can deal with variables and parameters that have names like ElementBase[1].val.x[0] and Vector[5].x[0]--and presumably you have been fastidious about using these names when you configured the MRF. If your answer is yes, then it seems likely that you have exposed a bug in the MRF, and it will be necessary for us to reproduce the problem in order to identify its cause and fix it.

Which is my way of asking if you can send me a toy example that generates the error message.

Re: Fitting the output of the Linear Circuit Builder

Posted: Mon Aug 27, 2018 5:17 am
by finesniper
Thanks for the quick reply! The first part is understood, I could make it work this way. The second part, dealing with the 13 RC components is however not an MRF bug. This happens whether or not I fit anything. This problem persists even if nothing is open, but the LinearCircuitBuilder itself. I have a limited number of RC components and amplifiers, which works appropriately, but when I want to add a lot of RC components, Neuron will encounter "inconsistencies", when I add the 13th element. I sent the code with the session file to you in email.