Chronology Current Month Current Thread Current Date
[Year List] [Month List (current year)] [Date Index] [Thread Index] [Thread Prev] [Thread Next] [Date Prev] [Date Next]

Re: calculation format



Ludwik Kowalski wrote:

2) By the way, I do not like the way conversion
factors are displayed at:

<http://www.av8n.com/physics/energy-reserves.html>

For example,

: hour = 3600 // seconds
hour= 3600

a) What is the // operator?

As in C++ and related languages, // begins a comment.

The point of this particular comment is that times are
being measured in SI units, namely seconds. One hour is
3600 SI units.

b) Would it not be better to have 1 hr = 3600 seconds ?

If you feel strongly about it, you can define second=1
and then express hour = 3600*second.

I guess the underlying issue here is that general-purpose
mathematical programs are usually not designed to do
dimensional analysis. I am carrying some dimensional
analysis along in the comments.

c) Why two lines for each " hour = " ?

I have a source program that expresses what calculations
are to be done. Each line of the program is printed
(with a leading ":" mark); then the *result* of that
calculation is printed.

The relationship between the two lines is trivial in the case of
: hour = 3600
hour= 3600
but not so trivial in cases such as
: tower_unit_price = tower_capital / tower_life / tower_power
tower_unit_price= 1.27061e-08

To repeat: the first line shows how it was calculated, and
the second line gives the numerical result of the calculation.
I believe in showing my work.

If anybody can think of a more felicitous format for displaying
what needs to be displayed, please let me know.