Open cweickhmann opened 3 years ago
Hi, I can reproduce it with qucs 0.0.20-rc2 and ASCO-0.4.10. I only get the version with ind1="#Lc#orner" How did you provoke ind1="1.141129E-9orner" ? It's most probably caused by qucs. If I reneame the asco executable, qucs complains that it cannot find asco, but still generates the fawlty netlist.
The replacement happens in opt_sim.cpp in line 230 (function Optimize_Sim::createASCOnetlist):
splitLine[i].replace(*it, "#"+*it+"#");
Hi! Thanks for picking this up!
I tried to reproduce the float replacement, but did not succeed yet. I hope I can tell you soon. It happened in an optimisation with s-parameter sim and an touchstone block, if that's of any help.
Don't worry, its not so important. The float replacement is done probably by asco, following a fawlty replacement from qucs.
note: The asco documentation says about the spice input netlist:
All values that are to be replace by the optimizer are enclosed in number sign # #. This does not necessarily imply a variable to optimize. It can also be a fixed number whose value is set for flexibility in the configuration file. This is a simple method to optimize a write protected SPICE input netlist circuit with different operating conditions.
With the
Premise:
circuit.sch
)subcircuit.sch
)The subcircuit, say, has an element "L1" with the value given as "ind1". An equation is given in the subcircuit, where "ind1" is assigned the parameter "Lcorner". The circuit file, an equation is given with a parameter "Lc" which is the variable to optimise. I assign "Lc" to "Lcorner" in the subcircuit block. This runs fine without the optimiser block (e.g. in an S-parameter simulation).
Once you activate the optimiser block (with that variable and goals defined), it fails with a syntax error like "line 4: syntax error, unexpected Identifier". When you open the
netlist.txt
file, you won't find a syntax error in line 4. Everything is fine there.However, if you open
asco_netlist.txt
, you'll find something strange happening to the Eqn:Eqn1 line in the subcircuit block. I found two variations of this. Either(note the
#Lc#
replacement)OR
(note the literal replacement of "Lc" with its numerical value.
I am not sure this is a bug in Qucs or ASCO, but it is certainly irritating. Especially, since it seems to be caused simply by using an equation in the subcircuit. It was very hard for me to debug, as I naturally checked the
netlist.txt
and only bothered to look closely at theasco_netlist.txt
much later.You can work around this, if you don't allow variables to start with the same characters. I.e. in this case, the problem is solved by calling
Lc
L_c
instead. test_mwe_prj.zip