GPOLY Parameters Alternating Sign?

I have overcome getting the Schematic Symbol to feed paramters to the the GPOLY model. See:

Now I am trying to apply the model and am not getting the behavior I expected.

When I give the polynomial a constant term of 0.5 the output is a negative 0.5


I might just swap the leads and conclude that the symbol only poorly represents the polarity.

But wait, Here I make the same offset and set the linear term to 1.0


The linear term has the correct sign. The output gets more positive as the input goes positive.

Try with single quadratic term. I expect this to make an output which is positive and has twice the frequencey of the intput. Here is what I get


The output has opposit polarity from what I expected.

Lets try third order.


The sign is correct just like the linear term.

It is as if the even power terms have inverted sign and the odd power terms are correct.

I cannot correct this error by simply swapping leads. I would have to alternate signs with in the parameters which is unexpected.

I do not understand the root of this problem

Anyone?

Related note. My KiCad is version 7.0. How do I find the version of the NGSPICE?

OK after pondering I figured it is the input I need to swap around.

I first rewired the input at pins 3 and 4 but that made no change.

Then I edited the parameters list:
from POLY (1) 0 ControlToO2 0 0 0 1
to: POLY (1) ControlToO2 0 0.5 1 1 1

Here is a simulation with power terms from zero to three and the output (blue) is as expected.

So bottom line I conclude that the symbol as drawn misleads me as to how I should understand the signs of the GPOLY function.

1 Like