I have been experimenting with writing a few little programs to perform
numerical integration, in which I have been running into difficulties.  I
can do all the operations I need from the command line, but I run into
problems when I try to bundle those commands into a program.

As a simple example, suppose I wanted a program to implement the two-point
Gaussian rule, which approximates the integral of f(x) between -1 and 1 by
f(-1/sqrt(3))+f(1/sqrt(3)).

On an interval other than [-1,1], we need a scaling transformation.  So I
might have a file called "gauss2.input" which contains one function:

gauss2(f,a,b)==
  xs:LIST Float := [-1/sqrt(3),1/sqrt(3)]
  g := (x:Float):Float +-> f((b-a)/2*x+(b+a)/2)
  int2 := (b-a)/2*(g(xs.1) + g(xs.2))
  return(int2)

However, the system clams up on the use of the scaling function g(x), and
this gives no results.

I have two questions here: first, how do I get round this?  and second, if
I'm writing programs, should I be writing them in Aldor (that's the
language of ".input" files, isn't it?), or SPAD?

For that matter, how do all the languages Aldor, SPAD, Lisp, Boot link up -
which is used for which purpose, and why?

Thanks,
Alasdair

-- 
[image: http://www.facebook.com/alasdair.mcandrew]
<http://www.facebook.com/alasdair.mcandrew> [image:
https://plus.google.com/+AlasdairMcAndrew/posts]
<https://plus.google.com/+AlasdairMcAndrew/posts> [image:
https://www.linkedin.com/pub/alasdair-mcandrew/a/178/108]
<https://www.linkedin.com/pub/alasdair-mcandrew/a/178/108> [image:
https://twitter.com/amca01] <https://twitter.com/amca01> [image:
http://numbersandshapes.net] <http://numbersandshapes.net>
_______________________________________________
Axiom-mail mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/axiom-mail

Reply via email to