help-gnucap
[Top][All Lists]
Advanced

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

Re: [Help-gnucap] What is a good way to get joules integrated in a .dat


From: Felix Salfelder
Subject: Re: [Help-gnucap] What is a good way to get joules integrated in a .dat output?
Date: Wed, 24 Aug 2016 12:15:13 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Tue, Aug 23, 2016 at 06:43:15PM -0500, John Griessen wrote:
> On 08/23/2016 02:21 PM, Felix Salfelder wrote:
> >i'm not sure if i understand. would you like to get an output close to
> >
> >#time  probe   integral(probe)
> >0       0            0
> >1       0            0
> >2       1            0
> >3       1            1
> >4       1            2
> >5       1            3
> >
> >?
> 
> Yes, if that was easy to ask for when simulating some transformer volts and 
> current,
> it would be a quick thing to see when a pulse width is in saturation as you 
> look at plots of waves.

(i asked specifically, because the answer is lengthy.)

as you know, the current wave/measure implementation only does
post-processing. to get output during a simulation, you need a component
that takes part in the simulation and provides data by means of a probe,
or by controlling a voltage or a current, which you can then attach a
probe to.

integration by itself is a simple thing to do, if what you integrate is
just a node voltage. you could express your computation as a monitoring
subcircuit consisting of controlled sources and caps, and then probe a
voltage, the subcircuit produces. i understand that this is what spice
people use(d?) to do... somewhat simpler, such a monitoring device can
be expressed as a verilog-a component, see here for an example [1].

what you would really need is a component that can attach probes to
other components, so it can do what i would call "online measurements".
it looks close to the way how spice style sources can be controlled by
currents somewhere else in the circuit. this is actually implemented in
gnucap (as part of the spice components). but it does not get you
anywhere, because it does not understand generic probes (such as pd).
and it does not integrate...

close to this, but not entirely useful, i have once started to implement
the qucsator "Eqn" device [2], which appeared to do something related.
the/my Eqn device takes expressions as arguments, which are evaluated
*during simulation* (they can be probed, as you intend). when i was about
to add foreign probe support to Eqn, i noticed that qucs Eqn was just
(ab?)used and intended as a substitute for *parameter expressions*, so
it actually was not necessary to implement it at all (bad luck?).
anyway, now it's there for recycling. maybe shuffled with DEV_MEAS [3],
a pre-verilog ad-hoc node-voltage based integrator...

finally, a standard way to this... even probes don't seem to be part of
verilog-a. (there's an an ad-hoc extension in ADMS, watch out for
"*ask*"). perhaps probes are the wrong track? to my knowledge,
in verilog-a, components are meant to communicate through nodes and nets
and wires only. that makes some sense, but it will not let you integrate
pd.

> Next I might want to build up an approximated calculation of magnetic field 
> intensity in Teslas.
> That integrates up as time goes forward also, and can be derived from volt 
> and amp probes.

to some extent, gnucap-adms supports cross-discipline modelling. and
likely needs more work as well.

have fun
felix

[1] http://git.savannah.gnu.org/cgit/gnucap/gnucap-adms.git/tree/tests/int.va
[2] https://github.com/Qucs/gnucsator/blob/master/d_eqn.cc
[3] https://github.com/felix-salfelder/gnucap/blob/testing-uf/src/d_meas.cc



reply via email to

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