ngspice-devel

 [Ngspice-devel] How to do stepping? From: Martin Schreiber - 2012-12-05 08:21:22 ```Hi, Currently in MSEspice we use a loop to do stepping, example: " * RC Lowpass Vin in gnd DC 1 AC 1 R1 in out 10k C1 out gnd 100n R2 out gnd 33k .control set curplot = new save all set curplot = unknown1 let b0 = @c1[c] let a0 = 2E-008 let n = 0 dowhile unknown1.n <= 5 alter @c1[c] = 5E-008+unknown1.n*unknown1.a0 ac dec 10 1 1000 let unknown1.n = unknown1.n + 1 let p0e1=db(v(out)/v(in)) let p0e2=v(out) end alter @c1[c] = unknown1.b0 write /home/mse/packs/standard/git/mseuniverse/tools/msespice/examples/mse_rclowpass.raw.tmp + ac1.p0e1 ac1.p0e2 + ac2.p0e1 ac2.p0e2 + ac3.p0e1 ac3.p0e2 + ac4.p0e1 ac4.p0e2 + ac5.p0e1 ac5.p0e2 + ac6.p0e1 ac6.p0e2 .endc .END " This is problematic for big stepcounts. Is there a better approach we could use instead? Martin ```
 Re: [Ngspice-devel] How to do stepping? From: Holger Vogt - 2012-12-08 14:08:50 ```Martin, what exactly is the problem then? Holger You may for example do something like: * RC Lowpass Vin in gnd DC 1 AC 1 R1 in out 10k C1 out gnd 100n R2 out gnd 33k .control set curplot = new save all set curplot = unknown1 let b0 = @c1[c] let a0 = 2E-008 let n = 0 dowhile unknown1.n <= 5 alter @c1[c] = 5E-008+unknown1.n*unknown1.a0 ac dec 10 1 1000 let unknown1.n = unknown1.n + 1 let p0e1=db(v(out)/v(in)) let p0e2=v(out) write mse_rclowpass_a.raw.tmp {\$curplot}.p0e1 {\$curplot}.p0e2 if unknown1.n = 1 set appendwrite end end alter @c1[c] = unknown1.b0 unset appendwrite .endc .END ```
 Re: [Ngspice-devel] How to do stepping? From: Martin Schreiber - 2012-12-08 19:41:28 ```On Saturday 08 December 2012 15:08:35 Holger Vogt wrote: > Martin, > > what exactly is the problem then? > The write statement becomes too big; there are too much extra vector variables and the line is too long. > > You may for example do something like: > [...] > set appendwrite Aha, why did I miss that in the docs! Thanks, implemented in MSEspice git master bcef042bcb3a58c2892eaf1bcb527ce74a77de37 http://gitorious.org/mseuniverse Is it possible to release the vector memory after the write statement? Thanks, Martin ```
 Re: [Ngspice-devel] How to do stepping? From: Holger Vogt - 2012-12-08 21:37:03 ```Martin, write mse_rclowpass_a.raw.tmp {\$curplot}.p0e1 {\$curplot}.p0e2 destroy {\$curplot} Holger ```
 Re: [Ngspice-devel] How to do stepping? From: Holger Vogt - 2012-12-08 22:03:46 ```Martin, the one below will lead to writing all data as 6 times the plot ac1: > write mse_rclowpass_a.raw.tmp {\$curplot}.p0e1 {\$curplot}.p0e2 > destroy {\$curplot} > the next one will write to plots ac1 ... ac6 write mse_rclowpass_a.raw.tmp {\$curplot}.p0e1 {\$curplot}.p0e2 unlet p0e1 unlet p0e2 Holger ```
 Re: [Ngspice-devel] How to do stepping? From: Martin Schreiber - 2012-12-09 20:33:51 ```On Saturday 08 December 2012 23:03:37 Holger Vogt wrote: > Martin, > > the one below will lead to writing all data as 6 times the plot ac1: > > write mse_rclowpass_a.raw.tmp {\$curplot}.p0e1 {\$curplot}.p0e2 > > destroy {\$curplot} > This is no problem because the names of the plots are not used, the order of the datablocks is controlling the assignment. It works well now. :-) Martin ```