With the
- Windows version of Qucs 0.0.19 (win32, mingw482) and ASCO 0.4.10, as well as with
- Linux version of Qucs 0.0.20 (amd64, Ubuntu/Debian repo v. 0.0.20.201022-2) and ASCO 0.4.9
I ran into a rather strange problem.
Premise:
- A Project
- One circuit file with a subcircuit to optimize (
circuit.sch)
- The subcircuit file (
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
.Def:subcircuit _net0 _net1 Lcorner="1n"
L:L1 _net0 _net1 L="ind1" I=""
Eqn:Eqn1 ind1="#Lc#orner" Export="yes"
.Def:End
(note the #Lc# replacement)
OR
.Def:subcircuit _net0 _net1 Lcorner="1n"
L:L1 _net0 _net1 L="ind1" I=""
Eqn:Eqn1 ind1="1.141129E-9orner" Export="yes"
.Def:End
(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 the asco_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
With the
I ran into a rather strange problem.
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.txtfile, 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.txtand only bothered to look closely at theasco_netlist.txtmuch 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
LcL_cinstead.test_mwe_prj.zip