Thread: Education: UK
View Single Post
  #38   Report Post  
Old 21-04-2003, 02:09 AM
Gordon Couger
 
Posts: n/a
Default Education: UK


"Oz" wrote in message
...
Gordon Couger writes

Computers do away with the need for some calculus. You can just work it

out
the long way.


Sure, and that's true of many real life problems.
However if you don't understand the concept of calculus then you are
doing it by rote. Further it's easy to simplify and find an analytic
solution that should be close to the answer to check that your result
looks plausible.

One engineer was trying to find the volume of a stream
profiles at different levels with a computer program. That is a classic

area
under a curve problem and she couldn't covert it to code. Since the data

was
on a X, Y data it was all straight lines. Each section of the stream

could
just be solve using the area of a triangle added to the are of he

rectangle
above it. When summed up in a recursive function it took about a half

page
of code and a hour to show her how to do it.


Indeed. The very same method that, taken to the limit, is used to prove
integration.

Hmm, I can't quite see why recursion is needed if I understand the
problem as stated.


A recurcusive soluouton that goes all the way throught to the other side of
the channel calulates the avergate and returns the area and return the area
to the incantaion that called where it is summed wiht the area of that
incantation and so on until the function fails back to the point it return
the area in the stream. It is all done with volitile variables and no house
keeping.

There was a chanle and they want to fill it with number of levels of water
and I could resue it without any dependance or effect outside the function
its self. We had a lot of that kind of data and it could drop in anywhere
with no side effects.

I doubt she understood recursion but she did get the point about

simplifying
the problem.


Quite. Mindless following by rote using tools you don't understand often
results in someone getting cut.

For an engineer anything difficult enough to require calculus has a look

up
table anyway

In 8 years of solving problems for engineers I never used calculus once.
Maybe they could solve the ones that needed calculus and just brought me

the
hard ones.


It's more than that, often. Frequently simple calculus is used to
generate the basic cell, which is then used numerically for the real
(and thus often tedious, analytically) life problem.

I set in on a course on open channel flow that the first words were you all
know what vector is 6 of them define a point in space, 3 of those can be
discarded because they are a mirror image of the other three and that is
called a tensor and tensor will be noted this way. Then he spent six weeks
defining a term u* then the math got hairy describing turbulent flow.

Anytime I needed a complex function on a computer I reduced it to a look up
table if at all possible because speed was always a problem. I have
algorithms for integer square roots, fixed point trig functions and a host
of other math tricks many that avoided division because of all the machine
cycles it uses. These are for working on micro controllers that run at 2
MHz. The biggest use of them if for engine controller in automobiles.

Of course the resolution of the data the computer reads is low and the
granularity of its actions so course crude approximation of many trig
functions and such work in many cases. Complex high resolution functions are
useless when you out put choices are limited to 16.

Gordon

Gordon