aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2009-07-16 07:52:42 +0000
committerdos-reis <gdr@axiomatics.org>2009-07-16 07:52:42 +0000
commit6ca6195b5b843d2e5ca482cb7cf6eee934853ae6 (patch)
tree863686443215ca0d38db69f893ca97c255ed39ef
parent4f065a4bf2b814ffde4ef743cb89b384156e691d (diff)
downloadopen-axiom-6ca6195b5b843d2e5ca482cb7cf6eee934853ae6.tar.gz
* algebra/odeef.spad.pamphlet (ElementaryFunctionODESolver): Tidy.
-rwxr-xr-xconfigure18
-rw-r--r--configure.ac2
-rw-r--r--configure.ac.pamphlet2
-rw-r--r--src/ChangeLog4
-rw-r--r--src/algebra/odeef.spad.pamphlet37
-rw-r--r--src/input/kernel.input.pamphlet2
6 files changed, 42 insertions, 23 deletions
diff --git a/configure b/configure
index bfa3d76e..45aed5a8 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.63 for OpenAxiom 1.4.0-2009-07-13.
+# Generated by GNU Autoconf 2.63 for OpenAxiom 1.4.0-2009-07-16.
#
# Report bugs to <open-axiom-bugs@lists.sf.net>.
#
@@ -745,8 +745,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='OpenAxiom'
PACKAGE_TARNAME='openaxiom'
-PACKAGE_VERSION='1.4.0-2009-07-13'
-PACKAGE_STRING='OpenAxiom 1.4.0-2009-07-13'
+PACKAGE_VERSION='1.4.0-2009-07-16'
+PACKAGE_STRING='OpenAxiom 1.4.0-2009-07-16'
PACKAGE_BUGREPORT='open-axiom-bugs@lists.sf.net'
ac_unique_file="src/Makefile.pamphlet"
@@ -1502,7 +1502,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures OpenAxiom 1.4.0-2009-07-13 to adapt to many kinds of systems.
+\`configure' configures OpenAxiom 1.4.0-2009-07-16 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1572,7 +1572,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of OpenAxiom 1.4.0-2009-07-13:";;
+ short | recursive ) echo "Configuration of OpenAxiom 1.4.0-2009-07-16:";;
esac
cat <<\_ACEOF
@@ -1675,7 +1675,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-OpenAxiom configure 1.4.0-2009-07-13
+OpenAxiom configure 1.4.0-2009-07-16
generated by GNU Autoconf 2.63
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1689,7 +1689,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by OpenAxiom $as_me 1.4.0-2009-07-13, which was
+It was created by OpenAxiom $as_me 1.4.0-2009-07-16, which was
generated by GNU Autoconf 2.63. Invocation command line was
$ $0 $@
@@ -17704,7 +17704,7 @@ exec 6>&1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by OpenAxiom $as_me 1.4.0-2009-07-13, which was
+This file was extended by OpenAxiom $as_me 1.4.0-2009-07-16, which was
generated by GNU Autoconf 2.63. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -17767,7 +17767,7 @@ Report bugs to <bug-autoconf@gnu.org>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
-OpenAxiom config.status 1.4.0-2009-07-13
+OpenAxiom config.status 1.4.0-2009-07-16
configured by $0, generated by GNU Autoconf 2.63,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff --git a/configure.ac b/configure.ac
index 3b9d3a6d..124272ba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
sinclude(config/open-axiom.m4)
sinclude(config/aclocal.m4)
-AC_INIT([OpenAxiom], [1.4.0-2009-07-13],
+AC_INIT([OpenAxiom], [1.4.0-2009-07-16],
[open-axiom-bugs@lists.sf.net])
AC_CONFIG_AUX_DIR(config)
diff --git a/configure.ac.pamphlet b/configure.ac.pamphlet
index 3be646ca..ea4cce67 100644
--- a/configure.ac.pamphlet
+++ b/configure.ac.pamphlet
@@ -1141,7 +1141,7 @@ information:
<<Autoconf init>>=
sinclude(config/open-axiom.m4)
sinclude(config/aclocal.m4)
-AC_INIT([OpenAxiom], [1.4.0-2009-07-13],
+AC_INIT([OpenAxiom], [1.4.0-2009-07-16],
[open-axiom-bugs@lists.sf.net])
@
diff --git a/src/ChangeLog b/src/ChangeLog
index c17550cc..5146627c 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
+2009-07-16 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
+ * algebra/odeef.spad.pamphlet (ElementaryFunctionODESolver): Tidy.
+
2009-07-13 Gabriel Dos Reis <gdr@cs.tamu.edu>
* interp/g-opt.boot (optCatch): Lift nested functions.
diff --git a/src/algebra/odeef.spad.pamphlet b/src/algebra/odeef.spad.pamphlet
index 5598124b..37f26e8e 100644
--- a/src/algebra/odeef.spad.pamphlet
+++ b/src/algebra/odeef.spad.pamphlet
@@ -434,7 +434,7 @@ ElementaryFunctionODESolver(R, F): Exports == Implementation where
getfreelincoeff1: (F, K, List F) -> F
getlincoeff : (F, K) -> F
getcoeff : (F, K) -> UU
- parseODE : (F, OP, SY) -> Union(LEQ, NLQ)
+ parseODE : (F, OP, SY) -> Union(LEQ, NLQ, "failed")
parseLODE : (F, List K, UP, SY) -> LEQ
parseSYS : (List F, List OP, SY) -> Union(SYS, "failed")
parseSYSeq : (F, List K, List K, List F, SY) -> Union(ROW, "failed")
@@ -462,7 +462,9 @@ ElementaryFunctionODESolver(R, F): Exports == Implementation where
solve(diffeq:F, y:OP, center:EQ, y0:List F) ==
a := rhs center
kx:K := kernel(x := retract(lhs(center))@SY)
- (ur := parseODE(diffeq, y, x)) case NLQ =>
+ ur := parseODE(diffeq, y, x)
+ ur case "failed" => "failed"
+ ur case NLQ =>
not one?(#y0) => error "solve: more than one initial condition!"
rc := ur::NLQ
(u := solve(rc.dx, rc.dy, y, x)) case "failed" => "failed"
@@ -483,7 +485,9 @@ ElementaryFunctionODESolver(R, F): Exports == Implementation where
error "solve: not a first order linear system"
solve(diffeq:F, y:OP, x:SY) ==
- (u := parseODE(diffeq, y, x)) case NLQ =>
+ u := parseODE(diffeq, y, x)
+ u case "failed" => "failed"
+ u case NLQ =>
rc := u::NLQ
(uu := solve(rc.dx, rc.dy, y, x)) case "failed" => "failed"
uu::F
@@ -527,28 +531,39 @@ ElementaryFunctionODESolver(R, F): Exports == Implementation where
eq := eq - ci * y::F
[n, v, -eq]
--- returns either [p, g] where the equation (diffeq) is of the form p(D)(y) = g
--- or [p, q] such that the equation (diffeq) is of the form p dx + q dy = 0
+ -- returns either
+ -- [p, g] where the equation (diffeq) is of the form
+ -- p(D)(y) = g
+ -- or
+ -- [p, q] such that the equation (diffeq) is of the form
+ -- p dx + q dy = 0
parseODE(diffeq, y, x) ==
- f := y(x::F)
+ -- FIXME: Assume we don't have a parametric equation.
+ f := y(x::F)
l:List(K) := [retract(f)@K]
n:N := 2
for k in varselect(kernels diffeq, x) | is?(k, OPDIFF) repeat
if (m := height k) > n then n := m
n := (n - 2)::N
--- build a list of kernels in the order [y^(n)(x),...,y''(x),y'(x),y(x)]
+ -- build a list of kernels in the order [y^(n)(x),...,y''(x),y'(x),y(x)]
for i in 1..n repeat
l := concat(retract(f := differentiate(f, x))@K, l)
+ -- Determine the order of the equation and its leading coefficient
k:K -- #$^#& compiler requires this line and the next one too...
c:F
- while not(empty? l) and zero?(c := getlincoeff(diffeq, k := first l))
- repeat l := rest l
- empty? l or empty? rest l => error "parseODE: equation has order 0"
+ while not empty? l repeat
+ c' := getcoeff(diffeq, k := first l)
+ c' case "failed" => return "failed"
+ c := c'::F
+ not zero? c => break
+ l := rest l
+ empty? l or empty? rest l => "failed" -- maybe a functional equation?
diffeq := diffeq - c * (k::F)
ny := name y
l := rest l
height(k) > 3 => parseLODE(diffeq, l, monomial(c, #l), ny)
- (u := getcoeff(diffeq, k := first l)) case "failed" => [diffeq, c]
+ u := getcoeff(diffeq, k := first l)
+ u case "failed" => [diffeq, c]
eqrhs := (d := u::F) * (k::F) - diffeq
freeOf?(eqrhs, ny) and freeOf?(c, ny) and freeOf?(d, ny) =>
[monomial(c, 1) + d::UP, eqrhs]
diff --git a/src/input/kernel.input.pamphlet b/src/input/kernel.input.pamphlet
index 3652da8a..25e4007a 100644
--- a/src/input/kernel.input.pamphlet
+++ b/src/input/kernel.input.pamphlet
@@ -27,7 +27,7 @@ height mainKernel(sin x)
height mainKernel(sin cos x)
height mainKernel(sin cos (tan x + sin x))
operator mainKernel(sin cos (tan x + sin x))
-name mainKernel(sin cos (tan x + sin x))
+name operator mainKernel(sin cos (tan x + sin x))
f := operator 'f
e := f(x, y, 10)
is?(e, f)