gnucap-devel
[Top][All Lists]
Advanced

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

Re: [Gnucap-devel] precalc_last-2


From: al davis
Subject: Re: [Gnucap-devel] precalc_last-2
Date: Fri, 25 Mar 2016 00:10:07 -0400

I was just getting ready to ask you to check it.

On Fri, 25 Mar 2016 02:56:55 +0100
Felix Salfelder <address@hidden> wrote:
> i merged that into -uf, and everything looks good. but theres one
> (minor) issue. consider
> 
> """
> spice
> .MODEL TESTR RES (TC1=1m TC2=0 DEFW=1 RSH=1)
> .options temperature=37
> R1 1 0 TESTR(w=2, l=4)
> .print tran r(R1)
> .tran 0 1 .5 te=1342

Special transient analysis with temp=1342

> .tran 2

Continue to 2.

Question:  What's the temperature?

Is it 37 (options) or 1342 (remembering from previous)?

Looking at the code,
see line 169, s_tr_set.cc
restores to option temperature

That is ..  temperature set on tran command DOES NOT carry to future
tran commands.

> i think, both are correct somehow. and the manual does not seem to cover
> this. is your implementation intentional? i cannot remember why i did it
> the other way, and i might rather change it back.


-uf was different because it reran precalc (updating actual values)
a second time ONLY if temp was specified.

So what if something else changes?  A param????
The -uf code would miss this.

Removing line 169 would change it, but then it wouldn't respond to an
option change.

This leads me to think it is correct, but maybe not.  Read on.

But AC keeps the temperature, because it is linearized around an
operating point or a time point, whatever was left from the previous
command, so AC would have the tran temp.  I think this is consistent.

AC has the option temp, which overrides and is remembered. 
Not sure whether this is correct or not.


Now .. DC-OP ...   Keeps the temperature, usually ignoring .option
temp.  I don't think this is correct.

OP is definitely incorrect, because op can sweep temperature and it
doesn't rerun precalc as the temp is being swept.  It worked in early
acs/gnucap because temp effects were computed in tr_eval, in hopes of
supporting self-heating.  But now, op temp sweep works for some devices
and not others.

Proposed fix: op needs to call precalc_last on every step of sweep.

I had planned to extend op to sweep parameters, and make temp just a
parameter, eliminating the pointer hack.  That too would need precalc
on every step.

DC too???   DC differs from OP only in what it sweeps.  So, yes, it
goes along with eliminating the pointer hack.

In Spice, DC differs from OP in that only DC sweeps, OP has no args,
and only OP sets up for AC.  This makes Spice AC much less flexible.

This branch isn't finished anyway.  I still need to look at
precalc_first/precalc_last on models.  It may make sense to eliminate
precalc_first, moving it all either to precalc_last or to expand.


But still the question ...  Keep temp as dc/op does? or reset temp as
tran does?  I think the memory from command to command is confusing, so
it is better not to keep it, and to not have memory of command options
from command to command.






reply via email to

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