home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / edu / 1370 < prev    next >
Encoding:
Internet Message Format  |  1992-08-26  |  4.4 KB

  1. Xref: sparky comp.edu:1370 comp.lang.fortran:3207
  2. Path: sparky!uunet!comp.vuw.ac.nz!waikato.ac.nz!aukuni.ac.nz!ecmtwhk
  3. Newsgroups: comp.edu,comp.lang.fortran
  4. Subject: Re: scientists as programmers (was: Small Language Wanted)
  5. Message-ID: <1992Aug27.060524.29129@ccu1.aukuni.ac.nz>
  6. From: ecmtwhk@ccu1.aukuni.ac.nz (Thomas Koenig)
  7. Date: Thu, 27 Aug 1992 06:05:24 GMT
  8. References: <1992Aug26.113215.20137@ccu1.aukuni.ac.nz> <mcdonald.247@aries.scs.uiuc.edu>
  9. Organization: University of Auckland, New Zealand.
  10. Lines: 85
  11.  
  12. mcdonald@aries.scs.uiuc.edu (J. D. McDonald) writes:
  13.  
  14. >In article <1992Aug26.113215.20137@ccu1.aukuni.ac.nz> ecmtwhk@ccu1.aukuni.ac.nz (Thomas Koenig) writes:
  15.  
  16. [without being aware that he was writing flamebait, btw]
  17.  
  18. >>Oh yes, and make the people use either straight SI units (without any
  19. >>multiplicators) or dimensionless numbers. 
  20.  
  21. >That is **TERRIBLE** advice for many cases. It would be OK to use
  22. >pure SI for a program to be used to teach freshman. But it would be wrong
  23. >fro most other purposes, certainly in my field. A good programmer (well,
  24. >a really topnotch one) would know better than that!!
  25.  
  26. Gee, thanks, but all I claim to be is to a good enough to get my 
  27. projects done:-)
  28.  
  29. >Units are very important, not only for understanding, but, even more
  30. >important, for numerical accuracy. SI units are amost never the best ones 
  31. >except for trivial codes. 
  32.  
  33. I have some trouble understanding that. How could one unit system be
  34. more or less accurate than another? The only problem I can see is over-
  35. and/or underflow. If your calculations involve squaring the charge of an
  36. electron, for example, then SI units are certainly the wrong choice.
  37.  
  38. Characterizing problems where SI units give results which fall within
  39. ten or fifteen orders of magnitute of unity (which all floating point
  40. representations that I'm aware of can hold without problems) as trivial
  41. seems to be somewhat of an understatement, however.
  42.  
  43. >Some sort of natural units are probably best for large calculations.
  44. >I personally loathe dimensionless units -- as, for example, are
  45. >traditional in quantum structure calculations or general relativity.
  46.  
  47. I find dimensionless numbers and dimensional analysis to be quite
  48. valuable tools, especially in heat transfer and flow calculations (I'm a
  49. chemical engineer, btw). Granted, dimensionless numbers are often not
  50. easy to visualize. For a lot of problems, however, dimensional analysis
  51. cuts down the parameter space to be investigated either with experiments
  52. or by computation so dramatically that I am willing to put up with the
  53. extra level of abstraction. Of course, many problems cannot be reduced,
  54. such as describing a stirred chemical reactor.
  55.  
  56. >But that is amatter of taste, as they are often of a size that makes the
  57. >numbers close to one (i.e. quantum structure calculations).
  58.  
  59. That is one of their nicer features, certainly.
  60.  
  61. >Also, SI units are often not the units normally used when discussing
  62. >certain topics. For example, in my field, dynamics of chemical reactions,
  63. >SI units are essentially **never** used. Oh, people may quote heats of
  64. >formation in them, or laser pulse energies, but the pressures in reaction 
  65. >chambers are never ever actually discussed in them - people usually use 
  66. >torr. Energies are usually quoted in electron volts or, very common, 
  67. >wavenumbers.
  68.  
  69. Discussing 'heat of formation' with my thermodynamics professor would
  70. have brought him close to apoplexy - are you talking energy or enthalpy
  71. of formation there? I thought these old, inexact terms had long since
  72. died the death they deserved...
  73.  
  74. If you look at single atoms, then SI units are indeed so far off unity
  75. as to cause grave problems.
  76.  
  77. As far as giving the pressure in torr goes, that is fine as long as
  78. you don't want to plug it into the ideal gas equation of state, for
  79. example.
  80.  
  81. [comment about "loathsome" electromagnetic SI units and European purists
  82. deteted]
  83.  
  84. Let me rephrase my piece of advice, then: In the sections of a program
  85. which do the actual computation, choose either dimensionless numbers or
  86. a consistent set of units, so that you can do the calculations
  87. themselves with no conversion factors at all. All that conversion
  88. factors do is introduce inefficiency and bugs. Conversion to other,
  89. maybe more familiar units should be restricted to sections of code
  90. dealing immediately with I/O. One consistent system in wide use is SI.
  91.  
  92. Can we agree on that? :-)
  93. -- 
  94. Thomas Koenig, ecmtwhk@ccu1.aukuni.ac.nz, ib09@rz.uni-karlsruhe.de
  95. The joy of engineering is to find a straight line on a double logarithmic
  96. diagram.
  97.