Boost logo

Boost :

From: Matthias Schabel (boost_at_[hidden])
Date: 2007-03-26 18:50:49


Phil,

> simple awk script to do the arithmetic. If dimensional analysis
> had been available, it would have been a useful confidence builder
> that the code was doing the right thing. The problem was this: I
> have measured the temperatures on the surfaces of an electrical
> device - a power supply - and I want to calculate the power
> dissipated. The maths is simple: power = temperature difference to
> atmosphere * area * heat transfer coefficient. I tried to write
> this using the units library.

If you don't need to store the heat transfer coefficient, you can
make this a one-liner without worrying about the type of the HTC
itself (assuming you've defined quantities for dT and A already) :

quantity<power> P = dT*A*7.5*watts/kelvin/square_meter;

Matthias


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk