Hello,
I'm trying to modify he parameter of a voltage source between different transient simulations. I would like to alter the amplitude of the parameter sin. I checked the manual and tried it with alter @v1[sin] = [ 0 1 100meg ]. But every time the program is quitting with a segFault. I checked it for other parameters (f.ex. [pulse]) and it shows the same behaviour.
Below you can find a minimal example of the problem:
V1 0 1 sin(0 2 100meg)
R1 0 1 50
.end
Can you provide a solution for the problem. I compiled the latest release of ngspice.
best regards,
v1 0 1 dc 0 sin (0 2 100meg)
rq 0 1 50
.control
alter @v1[sin]=[ 0 1 100meg ]
tran 5p 20n
plot v(1)
.endc
.end
Note the white space inside [ ] at the beginning and end.
Kind regards,
Justin Fisher.
Last edit: Justin Fisher 2017-04-06
So it's only possible to use it inside a script?
But I would like to use it in the interactive interpreter. I'm using
sharedspice.
best regards,
On Thu, 2017-04-06 at 09:21 +0000, Justin Fisher wrote:
--
M.Sc. Enrico Pannicke
Forschungscampus Stimulate
Otto-von-Guericke University Magdeburg
Chair of Electromagnetic Compatibility
Tel: +49 391 67 59365
Fax: +49 391 67 19347
Experimentelle Fabrik
Room 04.07
Sandtorstrasse 23
39106 Magdeburg
Germany
Related
Bugs:
#342Enrico,
it is no problem to run the sequence interactively in ngspice. It is also no problem to enter the commands one-by-one using shared ngspice, using ng_start64.exe under Windows as offered at http://ngspice.sourceforge.net/shared.html .
To figure out what your fault might be, you have to be much more specific. What is your calling program? What is your command sequence until the segfault occurs?
Holger
Hello Holger,
I just found the mistake. I included whitespace around the =. Removing
them prevents the segmentation fault and I can alter the amplitude of
the source.
Thank you for your help.
best regards,
Enrico
On Thu, 2017-04-06 at 15:47 +0000, Holger Vogt wrote:
--
M.Sc. Enrico Pannicke
Forschungscampus Stimulate
Otto-von-Guericke University Magdeburg
Chair of Electromagnetic Compatibility
Tel: +49 391 67 59365
Fax: +49 391 67 19347
Experimentelle Fabrik
Room 04.07
Sandtorstrasse 23
39106 Magdeburg
Germany
Enrico,
thanks for the detail.
It is a nuisance not to recognize spaces around '='.
We have to take care of that.
Holger
Hi Holger.
If this is going to be worked on, there are a few other areas where whitespace has some strange behavior. I'm guessing there's no simple fix to that would generally fix all the issues, so maybe it's a case where we have to know where they are an issue? If that's true I can suggest the set sourcepath command in the control section. If there isn't a whitespace after the opening bracket and before the closing bracket the line isn't read.
In general it seems there are places where no whitespaces are permitted and others where they must be - which is confusing.
Using inpcom 9 in my original solution I find the following combinations work
alter @v1[sin]=[ 0 1 100meg]
alter @v1[sin] =[ 0 1 100meg]
alter @v1[sin] = [ 0 1 100meg]
alter @v1[sin] = [ 0 1 100meg ]
alter @v1[sin ]=[ 0 1 100meg]
But the following combinations do not
alter @v1[sin]=[0 1 100meg]
alter @v1[ sin]=[ 0 1 100meg]
For some reason the whitespace after "v1[" and "=[" are critical (for opposite reasons) but in this case - the rest are not.
--
Kind regards,
Justin Fisher
Hi Justin,
Your example works for me with branch scope-inpcom-11
on Windows 7, VS2017.
I note that (a) and (b) are notations that Enrico
says don't work for him.
Enrico uses "shardspice, latest release."
I therefore assume he means ngspice-26 official release.
The bug "spaces around '=' needed" is (apparently) fixed in the
next release.
That one should write "[ 0 1 100meg ]" with spaces around
'[' and ']' is in the (current) manual:
-marcel
Last edit: marcel hendrix 2017-04-11
There is a fix available in scope-inpcom-11.
Ngspice reacted differently, either if you used a script or (as Enrico asked for) manually entered the alter command in interactive mode.
Holger