[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-gnucap] modify frequenz of sin voltage source

From: al davis
Subject: Re: [Help-gnucap] modify frequenz of sin voltage source
Date: Thu, 11 May 2006 11:43:25 -0400
User-agent: KMail/1.9.1

On Thursday 11 May 2006 11:06, Markus Feldmann wrote:
> what is the best way to modify the frequenz of a sin voltage
> source for a transient simulation?
> What command schould i use?
> I wanna change the frequenz value in batch mode.
> gnucap >> <aufg11.cmd
> Here my circuit,
> ********************************************************
> .model q2n2222 npn (is=19f bf=150 vaf=100
> + ikf=0.18 ise=50p ne=2.5 br=7.5
> + var=6.4 ikr=12m isc=8.7p nc=1.2 rb=50
> + re=0.4 rc=0.3 cje=26p tf=0.5n cjc=11p
> + tr=7n xtb=1.5 kf=0.032f af=1)
> Q1 14 11 31 q2n2222
> Q2 25 0 31 q2n2222
> Q3 31 32 33 q2n2222
> R1 6 14 12K
> R2 6 25 12K
> R3 32 0 10K
> R4 32 7 10K
> R5 33 7 5.6K
> VDC1 6 0 DC 12V
> VDC2 0 7 DC 12V
> VAC1 11 0 SIN 0 1 1kHz
> ********************************************************

There are several ways.

If you are using an old version (0.34), the best way is to 
re-enter the line containing the source.

If you are running interactively, use the "build" command, then 
enter that component with the new value.

In the spice-like batch mode, with the dot commands. first 
do ".option dupcheck", which will make it reject components 
with duplicate labels, then re-enter that component.

Instead of the option dupcheck, you can delete the component and 
re-enter it.  (delete VAC1)

I forget what order the numbers go it, so gnucap accepts named 
parameters.  You could enter: VAC1 11 0 SIN  ampl=1 freq=1k ..

If you are using a recent version, you can use parameters.  
Instead of giving a number for the frequency, give it a name.  
How about "frequency".  Then you can change the frequency with 
a param statement:  ".param frequency=2k"  then ".param 
frequency=3k", and so on.

Another way is to use the "generator".  Make the value of the 
source "generator".  You don't need any more on that line.  
Then use the "generator" command to configure it.

.option trace
.option dupcheck
VAC1 11 0 SIN 0 1 2kHz
.print tran v(11)
.tran 0 .001 .00005
VAC1 11 0 SIN ampl=3 freq=3k
VAC1 11 0 SIN ampl=.05 freq=7k
VAC1 11 0 SIN ampl=.1 freq=frequency
.param frequency=4.6k
.param frequency=9.4k
VAC1 11 0 generator
.generator freq=2k ampl=2.4
.generator freq=5k

reply via email to

[Prev in Thread] Current Thread [Next in Thread]