How to "Feed" the GPOLY Parameters Through The Schematic Symbol

Looking for what to try next.
EPOLY20230929_1005.zip (44.9 KB)
I am trying to use the G current source as a Poly.
From the ngspice manual at: https://ngspice.sourceforge.io/docs/ngspice-41-manual.pdf
on page 119 I get some examples which are hard to understand in terms of the schematic symbol fields.

Here is my schematic a sine wave into the G source with a load resistor.

I want to for example offset the output, have a linear term and a square term.
Here is my schematic symbol properties:

Here is the net list:
image

I think this should be making an output current which is not the flat line in this simulation.

I have uploaded the project as a zip file.

Poly sources are not directly supported by the Eeschema GSOURCE symbol.
The ngspice netlist does show
G1 CurrentOut 0 POLY (1) 3 0 0.1 1.0 2.0
which you have typed in manually (Sim.Params field).
As the manual states, the tokens 3 0 are nodes of a controlling source. But in your netlist node 3 is not connected to anything. So it is an open node, which leads to ngspice bailing out during simulation. With the RSHUNT option node 3 of the netlist will be connected to 0 by a resistor. Then the simulation runs, but with 0 V as controlling voltage.

So you have to figure out what the name of the controlling net might be, or you may give it a name by a label. Here is seems to be ‘ControlToO2’. Then you have to type in this name instead of 3, like
G1 CurrentOut 0 POLY (1) ControlToO2 0 0.1 1.0 2.0
(not tested)

Regarding,

BINGO That is what I needed to understand.

Now I have the part like this:

The net list like this:
image

And the simulation like this:


In this simulation the square term doubles the frequency of the input sine wave as expected.

TEN THOUSAND THANKS for seeing my mistake and explaining it to me.

1 Like

Attached is the working simulation with the G1 POLY model.

EPOLY20231002_0752.zip (51.5 KB)

1 Like