Discussion:
[Axiom-math] Axiom: Printing multiple variables in axiom.
Constantine Frangos
2007-11-08 21:47:28 UTC
Permalink
In the function below, I tried to use the following commands

)display value Acon
print(['Acon = Acon])

to print one or more variable.

However, I get very strange behaviour and error messages, so had to comment
them out. There might be a bug somwhere in my program.

If an axiom expert could implement a simplified version of the Maxima
display() function (probably a lisp function) in lisp/axiom, then this would
be very useful.

In Maxima:

x1:1;
x2:2;
x3:3;
display(x1,x2,x3); ->
x1 = 1
x2 = 2
x3 = 3

Any assistance would be appreciated.

TIA

C. Frangos.


testkinemat1 ==
--)read expandsincos.input
Acon := matrix([[1 , 0 , Lo1*sin(phi) , -sin(phi)*a , 0 , 0 , 0 , 0 , 0],_
[0 , 1 , -Lo1*cos(phi) , a*cos(phi) , 0 , 0 , 0 , 0 , 0],_
[1 , 0 , -Lo1*sin(phi) , 0 , -a*sin(phi), 0 , 0 , 0 , 0],_
[0 , 1 , Lo1*cos(phi) , 0 , a*cos(phi) , 0 , 0 , 0 , 0],_
[1,0,-Lc*cos(phi)+Lo1*sin(phi),0,0,0,-a*sin(phi)*cos(delta3)_
-a*cos(phi)*sin(delta3),0,0],_
[0,1,-Lc*sin(phi)-Lo1*cos(phi),0,0,0,a*cos(phi)*cos(delta3)_
-a*sin(phi)*sin(delta3),0,0],_
[1,0,-Lc*cos(phi)-Lo1*sin(phi),0,0,(-2*sin(phi)*Lo1*sin(delta3)-sin(phi)*_
Lc*cos(delta3)-cos(phi)*Lc*sin(delta3))*a/sqrt(4*Lo1^2*sin(delta3)^2+_
4*Lo1*sin(delta3)*Lc*cos(delta3)+Lc^2*cos(delta3)^2+Lc^2*sin(delta3)^2),0,0,0
],_

[0,1,-Lc*sin(phi)+Lo1*cos(phi),0,0,a*(2*cos(phi)*Lo1*sin(delta3)+_
cos(phi)*Lc*cos(delta3)-sin(phi)*Lc*sin(delta3))/sqrt(4*Lo1^2*sin(delta3)^2+_
4*Lo1*sin(delta3)*Lc*cos(delta3)+Lc^2*cos(delta3)^2+Lc^2*sin(delta3)^2),0,0,0
],_ [0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , -k]])
pause()
Acon := map(simplify,Acon)
--)display value Acon
-- print('Acon = Acon)
print(Acon)
pause()
rankAcon := rank(Acon)
-- print('rankAcon = rankAcon)
print(rankAcon)
pause()
Acone := rowEchelon(Acon)
--)display value Acone
-- print('Acone = Acone)
print(Acone)
pause()
Aconnull := nullSpace(Acon)
--)display value Aconnull
-- print('Aconnull = Aconnull)
print(Aconnull)
pause()
Aconnullity := nullity(Acon)
--)display value Aconnullity
-- print('Aconnullity = Aconnullity)
print(Aconnullity)
Martin Rubey
2007-11-09 18:41:09 UTC
Permalink
Post by Constantine Frangos
In the function below, I tried to use the following commands
)display value Acon
print(['Acon = Acon])
to print one or more variable.
However, I get very strange behaviour and error messages, so had to comment
them out. There might be a bug somwhere in my program.
If an axiom expert could implement a simplified version of the Maxima
display() function (probably a lisp function) in lisp/axiom, then this would
be very useful.
x1:1;
x2:2;
x3:3;
display(x1,x2,x3); ->
x1 = 1
x2 = 2
x3 = 3
Well, axiom functions always evaluate all it's arguments first. So, for
debugging I usually use

output ["x1: ", x1, " x2: ", x2]

If you want cleaner output, you'll have to look into OutputForm. For example,
to print a string without the quotes, you can use message$OUTFORM:

(1) -> message("1")$OUTFORM

(1) 1
Type: OutputForm

At least for expressions there is a way to quote and unquote, but I don't have
it present right now.

Martin
Constantine Frangos
2007-11-10 08:23:17 UTC
Permalink
Hi Martin,

Thanks for the reply. I tried your suggestion and this works perfectly - the
inverted commas are ok.

I tried your suggestion from a previous email to get axiom expressions in the
form: 2*x1 instead of 2x1.

However, I get an error for the example below.

C. Frangos.


(9) -> y
(9) ->
(9) cos(x2) + 2x1
Type: Expression Integer
(10) -> unparse(y)::OUTFORM
There are no exposed library operations named unparse but there is
one unexposed operation with that name. Use HyperDoc Browse or
issue
)display op unparse
to learn more about the available operation.

Cannot find a definition or applicable library operation named
unparse with argument type(s)
Expression Integer

Perhaps you should use "@" to indicate the required return type,
or "$" to specify which version of the function you need.
(10) ->
Post by Martin Rubey
Post by Constantine Frangos
In the function below, I tried to use the following commands
)display value Acon
print(['Acon = Acon])
to print one or more variable.
However, I get very strange behaviour and error messages, so had to
comment them out. There might be a bug somwhere in my program.
If an axiom expert could implement a simplified version of the Maxima
display() function (probably a lisp function) in lisp/axiom, then this
would be very useful.
x1:1;
x2:2;
x3:3;
display(x1,x2,x3); ->
x1 = 1
x2 = 2
x3 = 3
Well, axiom functions always evaluate all it's arguments first. So, for
debugging I usually use
output ["x1: ", x1, " x2: ", x2]
If you want cleaner output, you'll have to look into OutputForm. For
(1) -> message("1")$OUTFORM
(1) 1
Type: OutputForm
At least for expressions there is a way to quote and unquote, but I don't
have it present right now.
Martin
--
Constantine Frangos, Pr.Eng.
Professor
Dept. of Mathematics and Statistics
University of Johannesburg
Auckland Park Kingsway Campus
P O Box 524
Auckland Park
Johannesburg 2006
South Africa

Tel: +27-11-559-2452
Fax: +27-11-559-2832
e-mail: ***@uj.ac.za , ***@telkomsa.net
Martin Rubey
2007-11-10 11:11:32 UTC
Permalink
Post by Constantine Frangos
Hi Martin,
Thanks for the reply. I tried your suggestion and this works perfectly - the
inverted commas are ok.
I tried your suggestion from a previous email to get axiom expressions in the
form: 2*x1 instead of 2x1.
why do you want to coerce the result of unparse (which is a string) to OUTFORM?
Note that unparse takes something of type InputForm, so you'll have to coerce
y to INFORM before passing it to unparse. The error message is telling you
exactly this.

Martin
Post by Constantine Frangos
(9) -> y
(9) ->
(9) cos(x2) + 2x1
Type: Expression Integer
(10) -> unparse(y)::OUTFORM
There are no exposed library operations named unparse but there is
one unexposed operation with that name. Use HyperDoc Browse or
issue
)display op unparse
to learn more about the available operation.
Cannot find a definition or applicable library operation named
unparse with argument type(s)
Expression Integer
or "$" to specify which version of the function you need.
(10) ->
Post by Martin Rubey
Post by Constantine Frangos
In the function below, I tried to use the following commands
)display value Acon
print(['Acon = Acon])
to print one or more variable.
However, I get very strange behaviour and error messages, so had to
comment them out. There might be a bug somwhere in my program.
If an axiom expert could implement a simplified version of the Maxima
display() function (probably a lisp function) in lisp/axiom, then this
would be very useful.
x1:1;
x2:2;
x3:3;
display(x1,x2,x3); ->
x1 = 1
x2 = 2
x3 = 3
Well, axiom functions always evaluate all it's arguments first. So, for
debugging I usually use
output ["x1: ", x1, " x2: ", x2]
If you want cleaner output, you'll have to look into OutputForm. For
(1) -> message("1")$OUTFORM
(1) 1
Type: OutputForm
At least for expressions there is a way to quote and unquote, but I don't
have it present right now.
Martin
--
Constantine Frangos, Pr.Eng.
Professor
Dept. of Mathematics and Statistics
University of Johannesburg
Auckland Park Kingsway Campus
P O Box 524
Auckland Park
Johannesburg 2006
South Africa
Tel: +27-11-559-2452
Fax: +27-11-559-2832
Constantine Frangos
2007-11-11 20:10:20 UTC
Permalink
I am getting the result below for y.

However, the output I actually want is:

"cos(x2) + 2*x1"

or even better,

cos(x2) + 2*x1

Is this possible ?

Regards,

C. Frangos.


(42) -> y
(42) ->
(42) cos(x2) + 2x1
Type: Expression Integer
(43) -> unparse(y::INFORM)
(43) ->
(43) "DCOS(x2)+2*x1"
Type: String
(44) -> unparse(y::INFORM)::OUTFORM
(44) ->
(44) "DCOS(x2)+2*x1"
Type: OutputForm
(45) ->
Post by Martin Rubey
Post by Constantine Frangos
Hi Martin,
Thanks for the reply. I tried your suggestion and this works perfectly -
the inverted commas are ok.
I tried your suggestion from a previous email to get axiom expressions in
the form: 2*x1 instead of 2x1.
why do you want to coerce the result of unparse (which is a string) to
OUTFORM? Note that unparse takes something of type InputForm, so you'll
have to coerce y to INFORM before passing it to unparse. The error message
is telling you exactly this.
Martin
Post by Constantine Frangos
(9) -> y
(9) ->
(9) cos(x2) + 2x1
Type: Expression
Integer (10) -> unparse(y)::OUTFORM
There are no exposed library operations named unparse but there is
one unexposed operation with that name. Use HyperDoc Browse or
issue
)display op unparse
to learn more about the available operation.
Cannot find a definition or applicable library operation named
unparse with argument type(s)
Expression Integer
or "$" to specify which version of the function you need.
(10) ->
Post by Martin Rubey
Post by Constantine Frangos
In the function below, I tried to use the following commands
)display value Acon
print(['Acon = Acon])
to print one or more variable.
However, I get very strange behaviour and error messages, so had to
comment them out. There might be a bug somwhere in my program.
If an axiom expert could implement a simplified version of the Maxima
display() function (probably a lisp function) in lisp/axiom, then
this would be very useful.
x1:1;
x2:2;
x3:3;
display(x1,x2,x3); ->
x1 = 1
x2 = 2
x3 = 3
Well, axiom functions always evaluate all it's arguments first. So,
for debugging I usually use
output ["x1: ", x1, " x2: ", x2]
If you want cleaner output, you'll have to look into OutputForm. For
example, to print a string without the quotes, you can use
(1) -> message("1")$OUTFORM
(1) 1
Type: OutputForm
At least for expressions there is a way to quote and unquote, but I
don't have it present right now.
Martin
--
Bill Page
2007-11-11 23:14:57 UTC
Permalink
Why do you write 'unparse(y::INFORM)' ? Do you mean you literally want
to output a ' * ' character for multiplication? If so, I think there
must be a better way than this ...
Post by Constantine Frangos
I am getting the result below for y.
"cos(x2) + 2*x1"
or even better,
cos(x2) + 2*x1
Is this possible ?
Regards,
C. Frangos.
(42) -> y
(42) ->
(42) cos(x2) + 2x1
Type: Expression Integer
(43) -> unparse(y::INFORM)
(43) ->
(43) "DCOS(x2)+2*x1"
Type: String
(44) -> unparse(y::INFORM)::OUTFORM
(44) ->
(44) "DCOS(x2)+2*x1"
Type: OutputForm
(45) ->
Post by Martin Rubey
Post by Constantine Frangos
Hi Martin,
Thanks for the reply. I tried your suggestion and this works perfectly -
the inverted commas are ok.
I tried your suggestion from a previous email to get axiom expressions in
the form: 2*x1 instead of 2x1.
why do you want to coerce the result of unparse (which is a string) to
OUTFORM? Note that unparse takes something of type InputForm, so you'll
have to coerce y to INFORM before passing it to unparse. The error message
is telling you exactly this.
Martin
Post by Constantine Frangos
(9) -> y
(9) ->
(9) cos(x2) + 2x1
Type: Expression
Integer (10) -> unparse(y)::OUTFORM
There are no exposed library operations named unparse but there is
one unexposed operation with that name. Use HyperDoc Browse or
issue
)display op unparse
to learn more about the available operation.
Cannot find a definition or applicable library operation named
unparse with argument type(s)
Expression Integer
or "$" to specify which version of the function you need.
(10) ->
Post by Martin Rubey
Post by Constantine Frangos
In the function below, I tried to use the following commands
)display value Acon
print(['Acon = Acon])
to print one or more variable.
However, I get very strange behaviour and error messages, so had to
comment them out. There might be a bug somwhere in my program.
If an axiom expert could implement a simplified version of the Maxima
display() function (probably a lisp function) in lisp/axiom, then
this would be very useful.
x1:1;
x2:2;
x3:3;
display(x1,x2,x3); ->
x1 = 1
x2 = 2
x3 = 3
Well, axiom functions always evaluate all it's arguments first. So,
for debugging I usually use
output ["x1: ", x1, " x2: ", x2]
If you want cleaner output, you'll have to look into OutputForm. For
(1) -> message("1")$OUTFORM
(1) 1
Type: OutputForm
At least for expressions there is a way to quote and unquote, but I
don't have it present right now.
Martin
--
_______________________________________________
Axiom-math mailing list
http://lists.nongnu.org/mailman/listinfo/axiom-math
Martin Rubey
2007-11-12 06:45:58 UTC
Permalink
Post by Bill Page
Why do you write 'unparse(y::INFORM)' ? Do you mean you literally want
to output a ' * ' character for multiplication? If so, I think there
must be a better way than this ...
I guess that Constantine also wants 1-dimensional output. I.e., x^2 instead of

2
x

But I'm not sure.

Of course, the real solution would be to overwrite the coercion to OutputForm
in Expression. But that's probably too much to ask for from Constantine, and I
don't have the time to play around with that.

Constantine, I believe that mainly the trig functions get "funny" names. You
could first get a string with

str := unparse(y::INFORM)

and then use

pos := position("DCOS", str, 1)
if pos > 0 then replace(str,pos..pos+3,"cos")

to replace the names you dislike.

Martin
Constantine Frangos
2007-11-12 21:06:13 UTC
Permalink
Post by Martin Rubey
Post by Bill Page
Why do you write 'unparse(y::INFORM)' ? Do you mean you literally want
to output a ' * ' character for multiplication? If so, I think there
must be a better way than this ...
I guess that Constantine also wants 1-dimensional output. I.e., x^2 instead of
2
x
But I'm not sure.
Yes, that's correct. It would be helpful to obtain one-dimensional output
(ala Maxima with display2d : false) that can be pasted as is, in other axiom
functions, and run correctly.
Post by Martin Rubey
Of course, the real solution would be to overwrite the coercion to
OutputForm in Expression. But that's probably too much to ask for from
Constantine, and I don't have the time to play around with that.
Constantine, I believe that mainly the trig functions get "funny" names.
You could first get a string with
str := unparse(y::INFORM)
and then use
pos := position("DCOS", str, 1)
if pos > 0 then replace(str,pos..pos+3,"cos")
to replace the names you dislike.
I was thinking of defining

DCOS(x) == cos(x)
DSIN(x) == sin(x)
etc.

Regards,

C. Frangos.
Bill Page
2007-11-13 00:05:39 UTC
Permalink
Post by Constantine Frangos
Post by Martin Rubey
Post by Bill Page
Why do you write 'unparse(y::INFORM)' ? Do you mean you literally
want to output a ' * ' character for multiplication? If so, I think there
must be a better way than this ...
I guess that Constantine also wants 1-dimensional output. I.e., x^2 instead of
2
x
But I'm not sure.
Yes, that's correct. It would be helpful to obtain one-dimensional
output (ala Maxima with display2d : false) that can be pasted as
is, in other axiom functions, and run correctly.
Ok, I understand.
Post by Constantine Frangos
Post by Martin Rubey
Of course, the real solution would be to overwrite the coercion
to OutputForm in Expression. But that's probably too much to
ask for from Constantine, and I don't have the time to play around
with that.
...
I was thinking of defining
DCOS(x) == cos(x)
DSIN(x) == sin(x)
etc.
After looking at the Axiom source code I see that 'unparse' is
actually internally calling functions which convert an expression in
Axiom form to Fortran form. The necessary code is found here:

http://wiki.axiom-developer.org/axiom--test--1/src/algebra/MkfuncSpad
http://wiki.axiom-developer.org/axiom--test--1/src/interp/NewfortBoot
http://wiki.axiom-developer.org/axiom--test--1/src/interp/FormatBoot

But it isn't really necessary for you to understand all that. Here is
a distillation of the important parts into a fairly simple function
that I think probably does what you want:

(1) -> output1d(e)== _
message( _
concat map(string,destruct _
fortranCleanUp( _
exp2Fort1( _
exp2FortOptimize( _
outputTran(e::INFORM)$Lisp _
)$Lisp _
)$Lisp _
)$Lisp _
) _
)$OutputForm
Type: Void
(2) -> output1d(cos(x2) + 2*x1)
Compiling function output1d with type Expression Integer ->
OutputForm
`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.

(2) cos(x2)+2*x1
Type: OutputForm
(3) ->

If you would like an explanation of how this works, just ask.

Regards,
Bill Page.
Bill Page
2007-11-13 02:32:52 UTC
Permalink
Post by Bill Page
After looking at the Axiom source code I see that 'unparse' is
actually internally calling functions which convert an expression in
http://wiki.axiom-developer.org/axiom--test--1/src/algebra/MkfuncSpad
http://wiki.axiom-developer.org/axiom--test--1/src/interp/NewfortBoot
http://wiki.axiom-developer.org/axiom--test--1/src/interp/FormatBoot
But it isn't really necessary for you to understand all that. Here is
a distillation of the important parts into a fairly simple function
(1) -> output1d(e)== _
message( _
concat map(string,destruct _
fortranCleanUp( _
exp2Fort1( _
exp2FortOptimize( _
outputTran(e::INFORM)$Lisp _
)$Lisp _
)$Lisp _
)$Lisp _
) _
)$OutputForm
Type: Void
(2) -> output1d(cos(x2) + 2*x1)
Compiling function output1d with type Expression Integer ->
OutputForm
`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
(2) cos(x2)+2*x1
Type: OutputForm
(3) ->
Oops, the version about fails for expressions like:

output1d(x2/x2)

because of some additional unnecessary Fortran processing by
the routine 'outputTran'. Please use this slightly simpler version:

(1) -> output1d(e)== _
message( _
concat map(string,destruct _
fortranCleanUp( _
exp2Fort1( _
exp2FortOptimize( _
e::INFORM _
)$Lisp _
)$Lisp _
)$Lisp _
) _
)$OutputForm
Type: Void
(2) -> output1d(cos(x2) + 2*x1)
Compiling function output1d with type Expression Integer ->
OutputForm
`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.

(2) cos(x2)+2*x1
Type: OutputForm
(3) -> output1d(x2/x1)
Compiling function output1d with type Fraction Polynomial Integer
-> OutputForm
`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.

(3) x2/x1
Type: OutputForm
(4) -> output1d(sqrt(x1))

(4) x1**(1/2)
Type: OutputForm
(5) ->

-------------

I have recorded this issue at:

http://axiom-wiki.newsynthesis.org/401UnparseGeneratesFortranFunctionNames

since I think that really this is due to a bug in 'unparse'. It really
should not generate those Fortran-type names if it's purpose is really
to unparse Axiom commands in such a manner that they can be re-parsed
by the Axiom interpreter.

At the above link I also proposed a more general solution that
corrects this problem for other parts of Axiom as well.

Regards,
Bill Page.
Constantine Frangos
2007-11-13 20:51:26 UTC
Permalink
Thanks for the program.

I tried this program on a simple matrix (see below). I was expecting to get
matrix([[x1,x2],[x3,x4]])

but the result is different.

C. Frangos.


(67) -> s:=matrix([[x1,x2],[x3,x4]])
(67) ->
+x1 x2+
(67) | |
+x3 x4+
Type: Matrix Polynomial Integer
(68) -> output1d(s)
(68) ->
(68) matrix(construct(construct(x1,x2),construct(x3,x4)))
Type: OutputForm
(69) ->
Post by Bill Page
Post by Bill Page
After looking at the Axiom source code I see that 'unparse' is
actually internally calling functions which convert an expression in
http://wiki.axiom-developer.org/axiom--test--1/src/algebra/MkfuncSpad
http://wiki.axiom-developer.org/axiom--test--1/src/interp/NewfortBoot
http://wiki.axiom-developer.org/axiom--test--1/src/interp/FormatBoot
But it isn't really necessary for you to understand all that. Here is
a distillation of the important parts into a fairly simple function
(1) -> output1d(e)== _
message( _
concat map(string,destruct _
fortranCleanUp( _
exp2Fort1( _
exp2FortOptimize( _
outputTran(e::INFORM)$Lisp _
)$Lisp _
)$Lisp _
)$Lisp _
) _
)$OutputForm
Type: Void
(2) -> output1d(cos(x2) + 2*x1)
Compiling function output1d with type Expression Integer ->
OutputForm
`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
(2) cos(x2)+2*x1
Type: OutputForm
(3) ->
output1d(x2/x2)
because of some additional unnecessary Fortran processing by
(1) -> output1d(e)== _
message( _
concat map(string,destruct _
fortranCleanUp( _
exp2Fort1( _
exp2FortOptimize( _
e::INFORM _
)$Lisp _
)$Lisp _
)$Lisp _
) _
)$OutputForm
Type: Void
(2) -> output1d(cos(x2) + 2*x1)
Compiling function output1d with type Expression Integer ->
OutputForm
`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
(2) cos(x2)+2*x1
Type: OutputForm
(3) -> output1d(x2/x1)
Compiling function output1d with type Fraction Polynomial Integer
-> OutputForm
`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
(3) x2/x1
Type: OutputForm
(4) -> output1d(sqrt(x1))
(4) x1**(1/2)
Type: OutputForm
(5) ->
-------------
http://axiom-wiki.newsynthesis.org/401UnparseGeneratesFortranFunctionNames
since I think that really this is due to a bug in 'unparse'. It really
should not generate those Fortran-type names if it's purpose is really
to unparse Axiom commands in such a manner that they can be re-parsed
by the Axiom interpreter.
At the above link I also proposed a more general solution that
corrects this problem for other parts of Axiom as well.
Regards,
Bill Page.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group. To post to this group, send email
group at http://groups.google.com/group/fricas-devel?hl=en
-~----------~----~----~----~------~----~------~--~---
Bill Page
2007-11-13 22:10:29 UTC
Permalink
Post by Constantine Frangos
Thanks for the program.
I tried this program on a simple matrix (see below). I was expecting to get
matrix([[x1,x2],[x3,x4]])
but the result is different.
C. Frangos.
(67) -> s:=matrix([[x1,x2],[x3,x4]])
(67) ->
+x1 x2+
(67) | |
+x3 x4+
Type: Matrix Polynomial Integer
(68) -> output1d(s)
(68) ->
(68) matrix(construct(construct(x1,x2),construct(x3,x4)))
Type: OutputForm
(69) ->
You will admit I think, that this does product the required result:

(1) -> matrix(construct(construct(x1,x2),construct(x3,x4)))

+x1 x2+
(1) | |
+x3 x4+
Type: Matrix Polynomial Integer
(2) ->

This is what you expected, right?

The bracket [ ... ] notation in the Axiom is (usually) just a
short-hand syntax sugar for the construct( ... ) operation.

If you really think that the [ ... ] notation is preferrable, that
could probably be arranged with a little more special coding.

Regards,
Bill Page.
Constantine Frangos
2007-11-13 12:35:22 UTC
Permalink
Following the recent posting re. aldor and axiom etc, I dowloaded the aldor
system file aldor-linux-i386-glibc2.3-1.0.3.bin (21051230 bytes).

What program in suse linux 10.2, can be used to unpack this file ? (extension
.bin is unfamiliar). I guess that there are instructions on how to compile,
etc.

I know aldor can do numeric computations, but its not clear whether it can
also manipulate symbolic expressions, matrices, plot graphs, etc like in
axiom ?

TIA

C. Frangos.
Ralf Hemmecke
2007-11-13 13:40:34 UTC
Permalink
That is a shell script concatenated with a .tar.gz file.

Simply say

sh aldor-linux-i386-glibc2.3-1.0.3.bin

Ralf
Post by Constantine Frangos
Following the recent posting re. aldor and axiom etc, I dowloaded the aldor
system file aldor-linux-i386-glibc2.3-1.0.3.bin (21051230 bytes).
What program in suse linux 10.2, can be used to unpack this file ? (extension
.bin is unfamiliar). I guess that there are instructions on how to compile,
etc.
I know aldor can do numeric computations, but its not clear whether it can
also manipulate symbolic expressions, matrices, plot graphs, etc like in
axiom ?
TIA
C. Frangos.
Constantine Frangos
2007-11-13 20:48:33 UTC
Permalink
I installed aldor under suse 10.2 (32 bit) but am getting the following error
with the test program below:

aldor -Fx -laldor aldortest.as
sh: gcc32: command not found
#2 (Fatal Error) C compile failed. Command was: unicl
-I/home/apps/aldornew/aldor/linux/1.0.3/include -c aldortest.c
"aldortest.as", line 10: nfact :Integer;
^
[L10 C1] #1 (Warning) Suspicious `:'. Do you mean `local' or `default'?

#1 (Warning) Removing file `aldortest.c'.


#include "aldor"
#include "aldorio"

import from Integer;

--df ==> DoubleFloat;

testfact(imax:Integer):Integer == {

nfact :Integer;

nfact := 1;

for i in 1..imax repeat
{
nfact := nfact*i;
--stdout << "The factorial of " << i << " is " << nfact << newline;
}

return(nfact);

}

n := 200000;
xfact := testfact(n);

stdout << n << " factorial is :" << xfact << newline ;


C. Frangos.
Post by Ralf Hemmecke
That is a shell script concatenated with a .tar.gz file.
Simply say
sh aldor-linux-i386-glibc2.3-1.0.3.bin
Ralf
Bill Page
2007-11-13 22:04:24 UTC
Permalink
Constantine,

What do you see when you type

... ~> gcc --version

The result should be something like:

***@candis-admin:~> gcc --version
gcc (GCC) 4.1.2 20061115 (prerelease) (SUSE Linux)
...

If you do not see this, then maybe you have not installed the
Gnu C (gcc) compiler as required by Aldor.

Regards,
Bill Page.
Post by Constantine Frangos
I installed aldor under suse 10.2 (32 bit) but am getting the following error
aldor -Fx -laldor aldortest.as
sh: gcc32: command not found
#2 (Fatal Error) C compile failed. Command was: unicl
...
Ralf Hemmecke
2007-11-14 10:34:35 UTC
Permalink
Hi Constantine,

What you see is coming from $ALDORROOT/include/aldor.conf.
Since you are using Linux, you have to look into the [linux] section of
that file.

I guess there you see

cc-name = gcc32
link-name = gcc32

Now, although Laurentiu Dragan from Aldor.org claims that Aldor should
work with GCC4, I (personally) don't trust this. Thus, I've installed
gcc-3.3 into /usr/bin/ on my machine and modified aldor.conf to contain
the lines

cc-name = gcc-3.3
link-name = gcc-3.3

instead.

That should do the job.

Ralf
Post by Martin Rubey
Constantine,
What do you see when you type
... ~> gcc --version
gcc (GCC) 4.1.2 20061115 (prerelease) (SUSE Linux)
...
If you do not see this, then maybe you have not installed the
Gnu C (gcc) compiler as required by Aldor.
Regards,
Bill Page.
Post by Constantine Frangos
I installed aldor under suse 10.2 (32 bit) but am getting the following error
aldor -Fx -laldor aldortest.as
sh: gcc32: command not found
#2 (Fatal Error) C compile failed. Command was: unicl
Constantine Frangos
2007-11-14 20:46:12 UTC
Permalink
Hi Ralf,

I changed the [linux] section of aldor.conf to the following (I don't have
gcc3.3):

#++++++++++++++++++++++++++
[linux]
inherit = linuxcore
# these enforce ieee
# ieee-opts = -ffloat-store -mieee-fp
ieee-opts = -ffloat-store
fast-opts = -ffast-math -O2
# cc-name = gcc32
# link-name = gcc32
cc-name = gcc
link-name = gcc

#++++++++++++++++++++++++++

Now there is the following error:

aldor -Fx -laldor aldortest.as
cc1: error: unrecognized command line option "-fwritable-strings"
#2 (Fatal Error) C compile failed. Command was: unicl
-I/home/apps/aldornew/aldor/linux/1.0.3/include -c aldortest.c
"aldortest.as", line 10: nfact :Integer;
^
[L10 C1] #1 (Warning) Suspicious `:'. Do you mean `local' or `default'?

#1 (Warning) Removing file `aldortest.c'.
cfrangos/axiom>
Post by Ralf Hemmecke
Hi Constantine,
What you see is coming from $ALDORROOT/include/aldor.conf.
Since you are using Linux, you have to look into the [linux] section of
that file.
I guess there you see
cc-name = gcc32
link-name = gcc32
Now, although Laurentiu Dragan from Aldor.org claims that Aldor should
work with GCC4, I (personally) don't trust this. Thus, I've installed
gcc-3.3 into /usr/bin/ on my machine and modified aldor.conf to contain
the lines
cc-name = gcc-3.3
link-name = gcc-3.3
instead.
That should do the job.
Ralf
Post by Martin Rubey
Constantine,
What do you see when you type
... ~> gcc --version
gcc (GCC) 4.1.2 20061115 (prerelease) (SUSE Linux)
...
If you do not see this, then maybe you have not installed the
Gnu C (gcc) compiler as required by Aldor.
Regards,
Bill Page.
Post by Constantine Frangos
I installed aldor under suse 10.2 (32 bit) but am getting the following
aldor -Fx -laldor aldortest.as
sh: gcc32: command not found
#2 (Fatal Error) C compile failed. Command was: unicl
--
Constantine Frangos, Pr.Eng.
Professor
Dept. of Mathematics and Statistics
University of Johannesburg
Auckland Park Kingsway Campus
P O Box 524
Auckland Park
Johannesburg 2006
South Africa

Tel: +27-11-559-2452
Fax: +27-11-559-2832
e-mail: ***@uj.ac.za , ***@telkomsa.net
Bill Page
2007-11-15 00:00:28 UTC
Permalink
Constantine,

That is a well known (please check the email list archives, that is
what they are there for) incompatibility between the older version of
Aldor and the newer version of gcc - and the reason why the default
value of this parameter is gcc33. You must either upgrade your version
of Aldor or downgrade your version of gcc (install the older version
with the name gcc33).

Regards,
Bill Page.
Post by Constantine Frangos
Hi Ralf,
I changed the [linux] section of aldor.conf to the following (I don't have
#++++++++++++++++++++++++++
[linux]
inherit = linuxcore
# these enforce ieee
# ieee-opts = -ffloat-store -mieee-fp
ieee-opts = -ffloat-store
fast-opts = -ffast-math -O2
# cc-name = gcc32
# link-name = gcc32
cc-name = gcc
link-name = gcc
#++++++++++++++++++++++++++
aldor -Fx -laldor aldortest.as
cc1: error: unrecognized command line option "-fwritable-strings"
#2 (Fatal Error) C compile failed. Command was: unicl
-I/home/apps/aldornew/aldor/linux/1.0.3/include -c aldortest.c
"aldortest.as", line 10: nfact :Integer;
^
[L10 C1] #1 (Warning) Suspicious `:'. Do you mean `local' or `default'?
#1 (Warning) Removing file `aldortest.c'.
cfrangos/axiom>
Post by Ralf Hemmecke
Hi Constantine,
What you see is coming from $ALDORROOT/include/aldor.conf.
Since you are using Linux, you have to look into the [linux] section of
that file.
I guess there you see
cc-name = gcc32
link-name = gcc32
Now, although Laurentiu Dragan from Aldor.org claims that Aldor should
work with GCC4, I (personally) don't trust this. Thus, I've installed
gcc-3.3 into /usr/bin/ on my machine and modified aldor.conf to contain
the lines
cc-name = gcc-3.3
link-name = gcc-3.3
instead.
That should do the job.
Ralf
Post by Martin Rubey
Constantine,
What do you see when you type
... ~> gcc --version
gcc (GCC) 4.1.2 20061115 (prerelease) (SUSE Linux)
...
If you do not see this, then maybe you have not installed the
Gnu C (gcc) compiler as required by Aldor.
Regards,
Bill Page.
Post by Constantine Frangos
I installed aldor under suse 10.2 (32 bit) but am getting the following
aldor -Fx -laldor aldortest.as
sh: gcc32: command not found
#2 (Fatal Error) C compile failed. Command was: unicl
--
Constantine Frangos, Pr.Eng.
Professor
Dept. of Mathematics and Statistics
University of Johannesburg
Auckland Park Kingsway Campus
P O Box 524
Auckland Park
Johannesburg 2006
South Africa
Tel: +27-11-559-2452
Fax: +27-11-559-2832
Constantine Frangos
2007-11-17 09:16:07 UTC
Permalink
I managed to download aldor version 1.1.0 and installed this on a suse 10.1
64 bit system.

cfrangos/axiom> aldor -v
Aldor version 1.1.0 for LINUX(glibc2.3)
#1 (Warning) No files! Type `aldor -help' for help.

Totals:
Time 0.0 s
Store 592 K pool, 229K alloc - 39K free - 18K gc = 172K final


With this version I am getting the following error:

cfrangos/axiom> aldor -Fx -laldor aldortest.as
"aldortest.as", line 10: nfact :Integer;
^
[L10 C1] #1 (Warning) Suspicious `:'. Do you mean `local' or `default'?

/usr/lib64/gcc/x86_64-suse-linux/4.1.0/../../../../x86_64-suse-linux/bin/ld:
skipping incompatible /home/apps/aldornew/aldor/linux/1.1.0/lib/libaldor.a
when searching for -laldor
/usr/lib64/gcc/x86_64-suse-linux/4.1.0/../../../../x86_64-suse-linux/bin/ld:
cannot find -laldor
collect2: ld returned 1 exit status
#1 (Fatal Error) Linker failed. Command was: unicl aldortest.o aldormain.o
-L. -L/home/apps/aldornew/aldor/linux/1.1.0/share/lib
-L/home/apps/aldornew/aldor/linux/1.1.0/lib -o aldortest -laldor -lfoam
#1 (Warning) Removing file `aldortest.o'.
#2 (Warning) Removing file `aldormain.o'.


I also installed version 1.1.0 on a suse 10.2 32 bit system. It seems to
compile a test program but does give a warning:

cfrangos/axiom> aldor -Fx -laldor aldortest.as
"aldortest.as", line 10: nfact :Integer;
^
[L10 C1] #1 (Warning) Suspicious `:'. Do you mean `local' or `default'?

cfrangos/axiom> ./aldortest
100 factorial is
:93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000
cfrangos/axiom>

You emailed me a url of a website where I recall seeing an aldor example
program containing references to files/libraries (?) axiom.as, algebra.as,
etc. I do not see these files in the aldor version 1.1.0 installation ??

Regards,

C. Frangos.



#include "aldor"
#include "aldorio"

import from Integer;

--df ==> DoubleFloat;

testfact(imax:Integer):Integer == {

nfact :Integer;

nfact := 1;

for i in 1..imax repeat
{
nfact := nfact*i;
--stdout << "The factorial of " << i << " is " << nfact << newline;
}

return(nfact);

}

--n := 200000;
n := 100;
xfact := testfact(n);

stdout << n << " factorial is :" << xfact << newline ;
Post by Martin Rubey
Constantine,
That is a well known (please check the email list archives, that is
what they are there for) incompatibility between the older version of
Aldor and the newer version of gcc - and the reason why the default
value of this parameter is gcc33. You must either upgrade your version
of Aldor or downgrade your version of gcc (install the older version
with the name gcc33).
Regards,
Bill Page.
Post by Constantine Frangos
Hi Ralf,
I changed the [linux] section of aldor.conf to the following (I don't
#++++++++++++++++++++++++++
[linux]
inherit = linuxcore
# these enforce ieee
# ieee-opts = -ffloat-store -mieee-fp
ieee-opts = -ffloat-store
fast-opts = -ffast-math -O2
# cc-name = gcc32
# link-name = gcc32
cc-name = gcc
link-name = gcc
#++++++++++++++++++++++++++
aldor -Fx -laldor aldortest.as
cc1: error: unrecognized command line option "-fwritable-strings"
#2 (Fatal Error) C compile failed. Command was: unicl
-I/home/apps/aldornew/aldor/linux/1.0.3/include -c aldortest.c
"aldortest.as", line 10: nfact :Integer;
^
[L10 C1] #1 (Warning) Suspicious `:'. Do you mean `local' or `default'?
#1 (Warning) Removing file `aldortest.c'.
cfrangos/axiom>
Post by Ralf Hemmecke
Hi Constantine,
What you see is coming from $ALDORROOT/include/aldor.conf.
Since you are using Linux, you have to look into the [linux] section of
that file.
I guess there you see
cc-name = gcc32
link-name = gcc32
Now, although Laurentiu Dragan from Aldor.org claims that Aldor should
work with GCC4, I (personally) don't trust this. Thus, I've installed
gcc-3.3 into /usr/bin/ on my machine and modified aldor.conf to contain
the lines
cc-name = gcc-3.3
link-name = gcc-3.3
instead.
That should do the job.
Ralf
Post by Martin Rubey
Constantine,
What do you see when you type
... ~> gcc --version
gcc (GCC) 4.1.2 20061115 (prerelease) (SUSE Linux)
...
If you do not see this, then maybe you have not installed the
Gnu C (gcc) compiler as required by Aldor.
Regards,
Bill Page.
Post by Constantine Frangos
I installed aldor under suse 10.2 (32 bit) but am getting the
aldor -Fx -laldor aldortest.as
sh: gcc32: command not found
#2 (Fatal Error) C compile failed. Command was: unicl
--
Constantine Frangos, Pr.Eng.
Professor
Dept. of Mathematics and Statistics
University of Johannesburg
Auckland Park Kingsway Campus
P O Box 524
Auckland Park
Johannesburg 2006
South Africa
Tel: +27-11-559-2452
Fax: +27-11-559-2832
--
Constantine Frangos, Pr.Eng.
Professor
Dept. of Mathematics and Statistics
University of Johannesburg
Auckland Park Kingsway Campus
P O Box 524
Auckland Park
Johannesburg 2006
South Africa

Tel: +27-11-559-2452
Fax: +27-11-559-2832
e-mail: ***@uj.ac.za , ***@telkomsa.net
Ralf Hemmecke
2007-11-17 17:21:54 UTC
Permalink
Well, it's a warning...
Post by Constantine Frangos
cfrangos/axiom> aldor -Fx -laldor aldortest.as
"aldortest.as", line 10: nfact :Integer;
^
[L10 C1] #1 (Warning) Suspicious `:'. Do you mean `local' or `default'?
You actually write one of the following.

---BEGIN aldortest.as
#include "aldor"
#include "aldorio"

import from Integer;

testfact(imax:Integer):Integer == {
#if Variant1
default nfact :Integer;
nfact := 1;
#elseif Variant2
local nfact: Integer := 1;
#elseif Variant3
nfact: Integer := 1;
#else
nfact := 1;
#endif
for i in 1..imax repeat nfact := nfact*i;
return(nfact);
}
n := 100;
xfact := testfact(n);

stdout << n << " factorial is :" << xfact << newline ;
---END aldortest.as

Compile with

0~> aldor -fx -laldor aldortest.as
1~> aldor -fx -laldor -DVariant1 aldortest.as
2~> aldor -fx -laldor -DVariant2 aldortest.as
3~> aldor -fx -laldor -DVariant3 aldortest.as

They are all equivalent in *this* instance.
But as you see, you don't need to help the compiler with declaring a
"default" type for the variable. Since only Integer is in scope. The 1
can only be of that type so the compiler can infer the type of nfact
(lhs of "nfact:=1").

All of the variants declare a local variable, since you first assign to
it and that lets the compiler make it local.

As for the other problem... the line
Post by Constantine Frangos
skipping incompatible /home/apps/aldornew/aldor/linux/1.1.0/lib/libaldor.a
when searching for -laldor
says exactly what you should do... namely delete the .a libraries on the
64 bit machine and recompile them yourself. The .a libraries are machine
dependent, so if you use a .a file from another machine, that cannot work.

Ralf
Constantine Frangos
2007-11-24 12:00:33 UTC
Permalink
Thanks for the detailed response.

Its not clear how to recompile the libaldor.a library on the amd64 machine
(running suse 10.1, 64 bit).

TIA

Regards,

C. Frangos.
Post by Ralf Hemmecke
As for the other problem... the line
Post by Constantine Frangos
/usr/lib64/gcc/x86_64-suse-linux/4.1.0/../../../../x86_64-suse-linux/bin/
ld: skipping incompatible
/home/apps/aldornew/aldor/linux/1.1.0/lib/libaldor.a when searching for
-laldor
says exactly what you should do... namely delete the .a libraries on the
64 bit machine and recompile them yourself. The .a libraries are machine
dependent, so if you use a .a file from another machine, that cannot work.
Ralf
Constantine Frangos
2007-11-14 20:20:04 UTC
Permalink
I get the following:

gcc --version
gcc (GCC) 4.1.2 20061115 (prerelease) (SUSE Linux)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Post by Martin Rubey
Constantine,
What do you see when you type
... ~> gcc --version
gcc (GCC) 4.1.2 20061115 (prerelease) (SUSE Linux)
...
If you do not see this, then maybe you have not installed the
Gnu C (gcc) compiler as required by Aldor.
Regards,
Bill Page.
Post by Constantine Frangos
I installed aldor under suse 10.2 (32 bit) but am getting the following
aldor -Fx -laldor aldortest.as
sh: gcc32: command not found
#2 (Fatal Error) C compile failed. Command was: unicl
...
Gabriel Dos Reis
2007-11-15 01:27:52 UTC
Permalink
Constantine Frangos <***@telkomsa.net> writes:

| I get the following:
|
| gcc --version
| gcc (GCC) 4.1.2 20061115 (prerelease) (SUSE Linux)
| Copyright (C) 2006 Free Software Foundation, Inc.
| This is free software; see the source for copying conditions. There is NO
| warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Unless you wouldn't mind screwing your linux system, I would not
recommend you change the system compiler. You're left with the opion of
getting new aldor system.

-- Gaby
Ralf Hemmecke
2007-11-15 11:17:49 UTC
Permalink
By the way, I never said to install GCC 3.3 and call it /usr/bin/gcc,
but rather have /usr/bin/gcc-3.3 additionally and gcc being gcc4. Then
you should change the lines in aldor.conf and everything is fine.

If you want this

http://aldor.org/pipermail/aldor-l_aldor.org/2007-November/000788.html

then go for it...

Ralf
Post by Gabriel Dos Reis
|
| gcc --version
| gcc (GCC) 4.1.2 20061115 (prerelease) (SUSE Linux)
| Copyright (C) 2006 Free Software Foundation, Inc.
| This is free software; see the source for copying conditions. There is NO
| warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Unless you wouldn't mind screwing your linux system, I would not
recommend you change the system compiler. You're left with the opion of
getting new aldor system.
-- Gaby
Bill Page
2007-11-13 14:15:56 UTC
Permalink
Post by Constantine Frangos
Following the recent posting re. aldor and axiom etc, I dowloaded the
aldor system file aldor-linux-i386-glibc2.3-1.0.3.bin (21051230 bytes).
What program in suse linux 10.2, can be used to unpack this file ?
(extension .bin is unfamiliar). I guess that there are instructions on
how to compile, etc.
This is self-extracting script file. All you have to do is run it.
Usually I do the following in a linux terminal:

$ chmod a+x aldor-linux-i386-glibc2.3-1.0.3.bin
$ ./aldor-linux-i386-glibc2.3-1.0.3.bin

Be sure to read the installation instructions. The installation is
not completely automatic.
Post by Constantine Frangos
I know aldor can do numeric computations, but its not clear whether
it can also manipulate symbolic expressions, matrices, plot graphs,
etc like in axiom ?
Yes, certainly it can. (In fact that is it's main design goal!) But
keep in mind that Aldor (like Spad in Axiom) is a *compiler*, not an
interpreter. This means that compiling, testing and running programs
in Aldor is a little more complicated than using the Axiom
interpreter. Also in some respects the libraries available for Aldor
are considerably less extensive than what is available for Axiom.

If you like Aldor and you also would like to continue to use Axiom as
the user interface you might be interested in:

http://axiom-wiki.newsynthesis.org/AldorForAxiom

If you search for "Aldor" in the search box in the top right-hand
corner of the page, you will also find some other examples of using
Aldor in Axiom.

Regards,
Bill Page.
Martin Rubey
2007-11-13 15:23:26 UTC
Permalink
Post by Constantine Frangos
I know aldor can do numeric computations, but its not clear whether it can
also manipulate symbolic expressions, matrices, plot graphs, etc like in
axiom ?
I think you are on the wrong track here: Aldor can (should) be used, just as
SPAD, as extension language for Axiom. It's not a CAS.

Martin
Bill Page
2007-11-10 02:54:36 UTC
Permalink
Post by Constantine Frangos
In the function below, I tried to use the following commands
)display value Acon
print(['Acon = Acon])
to print one or more variable.
However, I get very strange behaviour and error messages, so had to comment
them out. There might be a bug somwhere in my program.
...
What do you mean by "strange behaviour"? Do you mean for example the
error message:

(12) -> print('Aconnull = Aconnull)
There are 3 exposed and 0 unexposed library operations named
equation having 2 argument(s) but none was determined to be
applicable. Use HyperDoc Browse, or issue
)display op equation
to learn more about the available operations. Perhaps
package-calling the operation or using coercions on the arguments
will allow you to apply the operation.

Cannot find a definition or applicable library operation named
equation with argument type(s)
Variable Aconnull
List Vector Expression Integer

Perhaps you should use "@" to indicate the required return type,
or "$" to specify which version of the function you need.

------

This error should be expected since you are trying to produce an
equation (which like everything in Axiom must have a type) between two
things of quite different kind. I cannot think of any equation which
has Variable on one side and List on the other. You might try to
construct something of type:

Equation Polynomial Integer

For example

(1) -> x=1

(1) x= 1
Type: Equation Polynomial Integer

In this equation both sides of this equation can be considered Polynomials.

In this case maybe you want to create an equation of type:

Equation List Vector Expression Integer

Like this:

[['Aconnull]] = Aconnull

Now the lefthand side can be interpreted as a 'List Vector Expression
Integer' so the expression

print([['Aconnull]] = Aconnull)

is ok.

Maybe you should not be trying to create an equation just to print a result?

Probably

output("Aconnull =", Aconnull)

is more like you intended to do.

The command

)display values

is a command. As such it is not intended to be used inside of a
function definition such as

testkinemat1 ==
--)read expandsincos.input
Acon := matrix([[1 , 0 , Lo1*sin(phi) , -sin(phi)*a , 0 , 0 , 0 , 0 , 0],_
[0 , 1 , -Lo1*cos(phi) , a*cos(phi) , 0 , 0 , 0 , 0 , 0],_
...

as you wrote above. Why are you writing?

testkinemat1 ==

This does not make sense to me in your code. Are you intending to use
this name testkinemat1 for some purpose later? This is not the usual
way in which one would use a definition like this. Perhaps you can
explain what you really want to do with this code.

If you forget about trying to define the function testkinemat1, then you can use

)display values

in the normal way in the rest of you code because this is just a
series of expressions and command to be evaluated. This works fine for
me.

Regards,
Bill Page.
Constantine Frangos
2007-11-10 09:59:01 UTC
Permalink
Thanks for the detailed response - much appreciated.

The clarifications on compatible axiom types for lhs/rhs of equations etc are
most helpful.

output("Acon = ", Acon) is more straightforward.

I am using an axiom function definition testkinemat1 ==
in order to add function parameters later.

Regards,

C. Frangos.
Post by Bill Page
Post by Constantine Frangos
In the function below, I tried to use the following commands
)display value Acon
print(['Acon = Acon])
to print one or more variable.
However, I get very strange behaviour and error messages, so had to
comment them out. There might be a bug somwhere in my program.
...
What do you mean by "strange behaviour"? Do you mean for example the
(12) -> print('Aconnull = Aconnull)
There are 3 exposed and 0 unexposed library operations named
equation having 2 argument(s) but none was determined to be
applicable. Use HyperDoc Browse, or issue
)display op equation
to learn more about the available operations. Perhaps
package-calling the operation or using coercions on the arguments
will allow you to apply the operation.
Cannot find a definition or applicable library operation named
equation with argument type(s)
Variable Aconnull
List Vector Expression Integer
or "$" to specify which version of the function you need.
------
This error should be expected since you are trying to produce an
equation (which like everything in Axiom must have a type) between two
things of quite different kind. I cannot think of any equation which
has Variable on one side and List on the other. You might try to
Equation Polynomial Integer
For example
(1) -> x=1
(1) x= 1
Type: Equation Polynomial Integer
In this equation both sides of this equation can be considered Polynomials.
Equation List Vector Expression Integer
[['Aconnull]] = Aconnull
Now the lefthand side can be interpreted as a 'List Vector Expression
Integer' so the expression
print([['Aconnull]] = Aconnull)
is ok.
Maybe you should not be trying to create an equation just to print a result?
Probably
output("Aconnull =", Aconnull)
is more like you intended to do.
The command
)display values
is a command. As such it is not intended to be used inside of a
function definition such as
testkinemat1 ==
--)read expandsincos.input
Acon := matrix([[1 , 0 , Lo1*sin(phi) , -sin(phi)*a , 0 , 0 , 0 , 0 , 0],_
[0 , 1 , -Lo1*cos(phi) , a*cos(phi) , 0 , 0 , 0 , 0 , 0],_
...
as you wrote above. Why are you writing?
testkinemat1 ==
This does not make sense to me in your code. Are you intending to use
this name testkinemat1 for some purpose later? This is not the usual
way in which one would use a definition like this. Perhaps you can
explain what you really want to do with this code.
If you forget about trying to define the function testkinemat1, then you can use
)display values
in the normal way in the rest of you code because this is just a
series of expressions and command to be evaluated. This works fine for
me.
Regards,
Bill Page.
--
Constantine Frangos, Pr.Eng.
Professor
Dept. of Mathematics and Statistics
University of Johannesburg
Auckland Park Kingsway Campus
P O Box 524
Auckland Park
Johannesburg 2006
South Africa

Tel: +27-11-559-2452
Fax: +27-11-559-2832
e-mail: ***@uj.ac.za , ***@telkomsa.net
Loading...