- Greetings.

I'm using some simple ploticus scripts to generate graphs from temperature and

energy meter data:

http://spiff.hax.se/log.html

I would like plot the difference between two of the temps, input and output

temps from a heatpump, and multiply that difference with a contant, which will

be a simple approximation of the output power of the heat pump, and also divide

that number with the current power consumption into the heatpump, which will

give the COP (Coefficient Of Performance).

Here's the script generating the second graph, which plots two of the temp

fields I'm interested in doing arithmetic on:

---

#proc page

#proc getdata

file: /export/home/thomas/logger/log.out

fieldnameheader: yes

#proc areadef

title: Värmekretstemp (°C)

titledetails: size=14 align=C

rectangle: 1 1 8 4

xscaletype: time hh:mm:ss

xrange: 00:00:00 23:59:59

yautorange: datafield=RK-fram,RK-retur,VP->VVB,VP->Ack,VVB/Ack->VP nearest=10

#proc xaxis

stubs: inc 2 hours

minorticinc: 30 minutes

stubformat: hh

#proc yaxis

stubs: inc 10

gridskip: min

ticincrement: 100 1000

#proc curvefit

maxinpoints: 1500

xfield: time

yfield: RK-fram

linedetails: color=blue width=.5

legendlabel: RK fram

#proc curvefit

maxinpoints: 1500

xfield: time

yfield: RK-retur

linedetails: color=red width=.5

legendlabel: RK retur

#proc curvefit

maxinpoints: 1500

xfield: time

yfield: VP->VVB

linedetails: color=green width=.5

legendlabel: VP->VVB

#proc curvefit

maxinpoints: 1500

xfield: time

yfield: VP->Ack

linedetails: color=orange width=.5

legendlabel: VP->Ack

#proc curvefit

maxinpoints: 1500

xfield: time

yfield: VVB/Ack->VP

linedetails: color=black width=.5

legendlabel: VVB/Ack->VP

#proc legend

location: max-1 max

seglen: 0.2

---

How do I generate and plot the difference of the two temps "VP->Ack" and

"VVB/Ack->VP"?

Thanks,

Thomas - Thomas,

you should be able to use a filter in #proc getdata to compute a

difference between two fields.

your field names are problematic in that they contain symbols such as '-',

'/' . Although the docs say you can use just about any alphanumeric

characters in your field names, in order to perform arithmetic on the

fields you'd be best off sticking with letters, digits, and underscore.

assuming you use different names, you should be able to use something like

this to compute the difference:

#proc getdata

file: ...

fieldnameheader: yes

showresults: yes

filter:

##set DIFF = $arith( @@VPACK-@@VVBACKVP )

##print @@VVPACK @@VVBACKVP @@DIFF ....

- Steve

On Tue, 1 Nov 2005, Thomas Tornblom wrote:

> Greetings.

>

> I'm using some simple ploticus scripts to generate graphs from temperature and

> energy meter data:

>

> http://spiff.hax.se/log.html

>

> I would like plot the difference between two of the temps, input and output

> temps from a heatpump, and multiply that difference with a contant, which will

> be a simple approximation of the output power of the heat pump, and also divide

> that number with the current power consumption into the heatpump, which will

> give the COP (Coefficient Of Performance).

>

> Here's the script generating the second graph, which plots two of the temp

> fields I'm interested in doing arithmetic on:

> ---

> #proc page

>

> #proc getdata

> file: /export/home/thomas/logger/log.out

> fieldnameheader: yes

>

> #proc areadef

> title: Värmekretstemp (°C)

> titledetails: size=14 align=C

> rectangle: 1 1 8 4

> xscaletype: time hh:mm:ss

> xrange: 00:00:00 23:59:59

> yautorange: datafield=RK-fram,RK-retur,VP->VVB,VP->Ack,VVB/Ack->VP nearest=10

>

> #proc xaxis

> stubs: inc 2 hours

> minorticinc: 30 minutes

> stubformat: hh

>

> #proc yaxis

> stubs: inc 10

> gridskip: min

> ticincrement: 100 1000

>

> #proc curvefit

> maxinpoints: 1500

> xfield: time

> yfield: RK-fram

> linedetails: color=blue width=.5

> legendlabel: RK fram

>

> #proc curvefit

> maxinpoints: 1500

> xfield: time

> yfield: RK-retur

> linedetails: color=red width=.5

> legendlabel: RK retur

>

> #proc curvefit

> maxinpoints: 1500

> xfield: time

> yfield: VP->VVB

> linedetails: color=green width=.5

> legendlabel: VP->VVB

>

> #proc curvefit

> maxinpoints: 1500

> xfield: time

> yfield: VP->Ack

> linedetails: color=orange width=.5

> legendlabel: VP->Ack

>

> #proc curvefit

> maxinpoints: 1500

> xfield: time

> yfield: VVB/Ack->VP

> linedetails: color=black width=.5

> legendlabel: VVB/Ack->VP

>

> #proc legend

> location: max-1 max

> seglen: 0.2

> ---

>

> How do I generate and plot the difference of the two temps "VP->Ack" and

> "VVB/Ack->VP"?

>

> Thanks,

> Thomas

>

>

>

>

>

> Yahoo! Groups Links

>

>

>

>

>

>

>

Stephen C. Grubb scg@... x-6633

Scientific Software Engineer, The Jackson Laboratory

600 Main Street Bar Harbor, Maine 04609 USA > To: ploticus@yahoogroups.com

Thanks Steve.

> From: "Stephen C. Grubb" <scg@...>

> Date: Wed, 2 Nov 2005 08:32:16 -0500 (EST)

> Subject: Re: [ploticus] Arithmetic on tabular data, how?

>

> Thomas,

>

> you should be able to use a filter in #proc getdata to compute a

> difference between two fields.

>

> your field names are problematic in that they contain symbols such as '-',

> '/' . Although the docs say you can use just about any alphanumeric

> characters in your field names, in order to perform arithmetic on the

> fields you'd be best off sticking with letters, digits, and underscore.

>

> assuming you use different names, you should be able to use something like

> this to compute the difference:

>

> #proc getdata

> file: ...

> fieldnameheader: yes

> showresults: yes

> filter:

> ##set DIFF = $arith( @@VPACK-@@VVBACKVP )

> ##print @@VVPACK @@VVBACKVP @@DIFF ....

>

>

> - Steve

I woked around the problem by using an awk script to preprocess the data and

then plot the output. As I needed some conditionals also I figured awk is

probably a better tool for this :-)

Cheers,

Thomas

>

and

>

>

> On Tue, 1 Nov 2005, Thomas Tornblom wrote:

>

> > Greetings.

> >

> > I'm using some simple ploticus scripts to generate graphs from temperature

> > energy meter data:

will

> >

> > http://spiff.hax.se/log.html

> >

> > I would like plot the difference between two of the temps, input and output

> > temps from a heatpump, and multiply that difference with a contant, which

> > be a simple approximation of the output power of the heat pump, and also

divide

> > that number with the current power consumption into the heatpump, which will

nearest=10

> > give the COP (Coefficient Of Performance).

> >

> > Here's the script generating the second graph, which plots two of the temp

> > fields I'm interested in doing arithmetic on:

> > ---

> > #proc page

> >

> > #proc getdata

> > file: /export/home/thomas/logger/log.out

> > fieldnameheader: yes

> >

> > #proc areadef

> > title: Värmekretstemp (°C)

> > titledetails: size=14 align=C

> > rectangle: 1 1 8 4

> > xscaletype: time hh:mm:ss

> > xrange: 00:00:00 23:59:59

> > yautorange: datafield=RK-fram,RK-retur,VP->VVB,VP->Ack,VVB/Ack->VP

> >

Real life: Thomas Törnblom Email: Thomas.Tornblom@...

> > #proc xaxis

> > stubs: inc 2 hours

> > minorticinc: 30 minutes

> > stubformat: hh

> >

> > #proc yaxis

> > stubs: inc 10

> > gridskip: min

> > ticincrement: 100 1000

> >

> > #proc curvefit

> > maxinpoints: 1500

> > xfield: time

> > yfield: RK-fram

> > linedetails: color=blue width=.5

> > legendlabel: RK fram

> >

> > #proc curvefit

> > maxinpoints: 1500

> > xfield: time

> > yfield: RK-retur

> > linedetails: color=red width=.5

> > legendlabel: RK retur

> >

> > #proc curvefit

> > maxinpoints: 1500

> > xfield: time

> > yfield: VP->VVB

> > linedetails: color=green width=.5

> > legendlabel: VP->VVB

> >

> > #proc curvefit

> > maxinpoints: 1500

> > xfield: time

> > yfield: VP->Ack

> > linedetails: color=orange width=.5

> > legendlabel: VP->Ack

> >

> > #proc curvefit

> > maxinpoints: 1500

> > xfield: time

> > yfield: VVB/Ack->VP

> > linedetails: color=black width=.5

> > legendlabel: VVB/Ack->VP

> >

> > #proc legend

> > location: max-1 max

> > seglen: 0.2

> > ---

> >

> > How do I generate and plot the difference of the two temps "VP->Ack" and

> > "VVB/Ack->VP"?

> >

> > Thanks,

> > Thomas

> >

> >

> >

> >

> >

> > Yahoo! Groups Links

> >

> >

> >

> >

> >

> >

> >

>

>

> Stephen C. Grubb scg@... x-6633

> Scientific Software Engineer, The Jackson Laboratory

> 600 Main Street Bar Harbor, Maine 04609 USA

>

>

>

>

>

> Yahoo! Groups Links

>

>

>

>

>

>

>

>

> !DSPAM:4368bff227718116145615!

>

Snail mail: Banvallsvägen 14 Phone: +46 18 290 290

S - 754 40 Uppsala, Sweden Cellular: +46 70 261 1372