help-gnucap
[Top][All Lists]
Advanced

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

jfet example


From: Felix Salfelder
Subject: jfet example
Date: Sat, 15 Feb 2020 00:43:20 +0100
User-agent: NeoMutt/20170113 (1.7.2)

On Fri, Feb 14, 2020 at 10:35:21PM +0100, Matthias Brennwald wrote:
> The wiki documentation seems like a skeleton that is missing a lot of
> content. The way it is, the wiki is not useful for a clueless newcomer like
> me.

There are some examples in [1]. As you say, some content is missing,
Perhaps time to create the Introduction page.

(I just noticed that all three "Hosted elsewhere" links are dead. this is
bad, because they seemed to be useful. perhaps the archive [2] can help?)

> Is there maybe some built-in command-line tool that provides some
> information on how to use Gnucap, like a "help" command? Or is there some
> other way to read up on how to use and learn Gnucap?

The built-in command line tool is gnucap. It reads input from a file, or
from the user, interactively. just like a shell.

Gnucap has a help command. You can distribute your extensions with
embedded documentation (great), but the project code base does not
currently include any help text (not so great?). Still i think that
there are ways to learn.

> If there is no sufficiently complete documentation available, it might be
> possible to get me going if someone would provide me with a step by step
> example using a circuit I can relate to. Consider the schematic in Fig. 15b
> in this article:
> https://audioxpress.com/article/JFETs-The-New-Frontier-Part-2
> - How would I set this up in Gnucap?
> - How would I use Gnucap to tell me the DC operating points?
> - How would I use Gnucap to determine and plot harmonic distortion present
> in the output signal for 1 kHz input a 1 Vrms?
>
> It would be great if someone could help me get the grips with Gnucap.

I have quickly turned Fig. 15B into a spice netlist + some simulation
commands (appended to this mail below, not attached). you can run it
with

$ gnucap jfet_15B.gc

and perhaps figure out what the commands do, and what the numbers mean.
Maybe this could be the basis for another section within [1], but
I'm afraid this is going to take more time...

cheers
felix

[1] http://gnucap.org/dokuwiki/doku.php/gnucap:manual:examples
[2] http://web.archive.org

==== jfet_15B.gc ====
spice
.load models/spice3f5/jfet.so

* some random jfet model parameters
.MODEL 2sk170 NJF
+ VTO=-5.21e-1 BETA=3.68e-2 LAMBDA=4.83e-3
+ IS=1.0e-9, RD=0. RS=0.
+ CGS=5.64e-11 CGD=2.56e-11
+ PB=4.86 FC=.5

* instanciate source follower similar to 15B in
* https://audioxpress.com/article/JFETs-The-New-Frontier-Part-2
Ij511 nout nvlo 4.7m
vhi nvhi 0 24
vlo nvlo 0 -24
r1 nin 0 10k
j1 nvhi nin nout 2sk170

* some load and input voltage
rl nout 0 5k
Cl nout 0 20n
vin nin 0 sin f=1k amplitude=20 ac 1

* print the circuit.
.list

* run a couple of analyses.
.print dc v(nodes)
.dc vin -24 24 4

.print tran v(nodes)
* .plot tran v(nin)(-24,24) v(nout)(-24,24)
.tran 1m

.op
.print ac v(nout)
.ac 1 1e6 * 10

.print fourier v(nout)
.fourier 1k
==== end ====



reply via email to

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