Re: What is a good way to get joules integrated in a .dat output?

John Griessen <[email protected]> Tue, 23 Aug 2016 13:31:21 -0500
Newsgroups gmane.comp.gnu.gnucap.general
Message-ID <[email protected]>
On 08/22/2016 09:48 AM, Felix Salfelder wrote:
> On Mon, Aug 22, 2016 at 09:32:09AM -0500, John Griessen wrote:
>> > .print tran v(vin) i(C2) v(v2) v(vout) i(R3) i(R2) p(R3) p(R2)
>> > .tran 0 0.000090 .0000005 >voltagedoubler.dat
>> >
>> > How would I print the integral of pd(R2) to my waveform file?
> try
>
> .store tran p(R2)
> .tran 0 1 .1
> .measure x=integral(probe="p(R2)")

I read some docs and tried this below:

* DO NOT MODIFY THIS FILE DIRECTLY, IT IS GENERATED FROM  the .hdr and .sim files!

* Contents of voltagedoubler.hdr follow:
.model custom1 D(IS=16.7p RS=4.166 N=3.98 )
*Vcc is defined by a pulse starting at -1500, that rises to +1500, falls abruptly, repeats.
Vcc (vin 0) pulse(iv=-1500, pv=1500, period=0.000010, width=0.000005)


* voltagedoubler.net COMES FROM RUNNING gnetlist -g spice on voltagedoubler.sch:
R2 xfmr-ideal xfmr 500
R3 vout 0 30k
R1 xfmr-ideal vin 2
C1 xfmr v2 10nF
C2 vout 0 10nF
D2 0 v2 custom1
D1 v2 vout custom1

* Contents of voltagedoubler.sim follow:
.print tran v(vin) i(C2) v(v2) v(vout) i(R3) i(R2) pd(R3) pd(R2) x
.store tran pd(R2)
.measure x=integral(probe="pd(R2)")
.tran 0 0.000090 .0000005 >voltagedoubler.dat



gnucap -b voltagedoubler.ckt
.
.
main version: master 2016-02-02a
core-lib version: master 2016-02-02a
default plugins: master 2016-02-02a
* DO NOT MODIFY THIS FILE DIRECTLY, IT IS GENERATED FROM  the .hdr and .sim files!
.print tran v(v ... R2) pd(R3) pd(R2) x
                                         ^ ? need device or node
no match: pd(R2)

How do you print x if it is not a function of time?  If it is just a single number,
it would need a time to start and stop.  I was hoping for a way to get a waveform with
the same step sizes as the usual .print tran v(vin) i(C2) v(v2) v(vout) i(R3) i(R2) pd(R3) pd(R2)
gives.

John Griessen