From: Stefan Jahn <stefan@gr...>  20110404 09:41:23

Am Mo, 4.04.2011, 10:01 schrieb Carsten Koegler: HellO! >> > In an optimization, can I assign a value to a capacitor, that is not >> > equal to a variable, but depends on 2 variables? >> > >> > I use Qucs and ASCO to optimize 5 capacitors in a SParameter >> > simulation >> > and have some problems with converging the optimization. >> > Out of previous insight it is known, that 2 of the capacitors will >> > have >> > only slightly different value. So I thought, instead of having 2 >> > variables >> > in my optimization >> >  cap1 >> >  cap2 >> > >> > I should better have >> >  cap_mean >> >  cap_offset >> > >> > cap_mean will have the value range as before, but cap_offset >> > will have a much smaller value range and thus helping me converging >> > the >> > optimization. >> > >> > But I can't assign a capacitor in the schematic a value >> > C=cap_mean+cap_offset. >> > This gives >> >>>>>>>>>>>>> >> > line 18: syntax error, unrecognized character: `+' >> > line 18: syntax error, unexpected InvalidCharacter, expecting '"' >> > <<<<<<<<<<<< >> >> For this I suggest to introduce an equation block with >> cap1 = cap_mean+cap_offset >> and setting C = cap1 into the property of the capacitor. >> >> Best regards, Stefan. > > > Mmmh. Assigning a single optimization variable to an equation works, but > not > equation = variable1 + variable2 ?? > > <Qucs Schematic 0.0.16> > <Properties> > <View=0,60,1411,1081,0.909091,0,0> > <Grid=10,10,1> > <DataSet=coupled_variables.dat> > <DataDisplay=coupled_variables.dpl> > <OpenDisplay=0> > <Script=coupled_variables.m> > <RunScript=0> > <showFrame=0> > <FrameText0=Title> > <FrameText1=Drawn By:> > <FrameText2=Date:> > <FrameText3=Revision:> > </Properties> > <Symbol> > </Symbol> > <Components> > <R R1 1 790 110 15 26 0 1 "50 Ohm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" > 0 "european" 0> > <C C1 1 500 80 26 17 0 0 "c_match_equation" 1 "" 0 "neutral" 0> > <.Opt Opt1 1 110 320 0 43 0 0 "Sim=SP1" 0 > "DE=3102200.85131e610100" 0 > "Var=c_match_baseyes7.736736E1400.1e12LIN_DOUBLE" 0 > "Var=c_match_diffyes6.553473E1400.1e12LIN_DOUBLE" 0 > "Goal=S11_dBLE50" 0> > <.SP SP1 1 110 420 0 71 0 0 "lin" 1 "300MHz" 1 "301MHz" 1 "2" 1 "no" 0 > "1" 0 "2" 0 "no" 0 "no" 0> > <Eqn Eqn_FAIL 1 640 310 31 17 0 0 > "c_match_equation=c_match_base+c_match_diff" 1 "yes" 0> > <Eqn Eqn3 1 320 340 31 17 0 0 "S11_dB=dB(yvalue(S[1,1],300e6))" 1 "yes" > 0> > <Pac P1 1 90 180 18 26 0 1 "1" 1 "50 Ohm" 1 "0 dBm" 0 "300 MHz" 0 > "26.85" 0> > <Eqn Eqn_WORKS 0 640 420 31 17 0 0 "c_match_equation=c_match_base" 1 > "yes" 0> > </Components> > <Wires> > <90 210 90 260 "" 0 0 0 ""> > <90 260 790 260 "" 0 0 0 ""> > <790 140 790 260 "" 0 0 0 ""> > <530 80 790 80 "" 0 0 0 ""> > <90 80 90 150 "" 0 0 0 ""> > <90 80 470 80 "" 0 0 0 ""> > </Wires> > <Diagrams> > <Tab 600 672 335 72 3 #c0c0c0 1 00 1 0 1 1 1 0 1 1 1 0 1 1 315 0 225 "" > "" ""> > <"c_match_equation" #0000ff 0 3 1 0 0> > </Tab> > </Diagrams> > <Paintings> > </Paintings> Attached the working setup... (I hope) Best regards, Stefan. 