Discussion:
[Axiom-math] Solving symbolic vector equations: How do I do this in Axiom?
Zach
2008-05-13 19:51:03 UTC
Permalink
Please excuse me, I am really quite new to Axiom and much of abstract
algebra terminology. I hope this is the right place for these questions.
If not, could someone point me in the right direction. I am currently
reading the Axiom tome, er.. book, but it is good to have a human to bounce
ideas off of.

Here is a really simple example, we have real number `a' and vectors `v1'
and `v2'. Given:

a*v1=v2

solve(a*v1=v2)
==> [a = v2/v1]

I would like to solve for a. If I put this in, Axiom assumes v1 and v2 to
be things that have a defined division (a field I guess). But really we
have no division by a vector (a ring, perhaps?), so what I would like is for
axiom to solve this by

a * v1 . v1 = v2 . v1
a = (v2 . v1) / (v1 . v1)

I assume that I do this by giving Axiom some type information, like
specifying v1 and v2 as Vector (or Matrix) Fraction Integer or something.
What is the best way of tackling these types of problems?

Thanks,
Zach
Bill Page
2008-05-13 21:48:20 UTC
Permalink
Post by Zach
Please excuse me, I am really quite new to Axiom and much of
abstract algebra terminology.
Welcome.
Post by Zach
I hope this is the right place for these questions. If not,
could someone point me in the right direction.
Yes, it is a good place to ask such questions.
Post by Zach
I am currently reading the Axiom tome, er.. book, but it is good
to have a human to bounce ideas off of.
Another useful place might be:

http://axiom-wiki.newsynthesis.org
Post by Zach
Here is a really simple example, we have real number `a' and
a*v1=v2
solve(a*v1=v2)
==> [a = v2/v1]
I would like to solve for a. If I put this in, Axiom assumes v1 and v2 to
be things that have a defined division (a field I guess). But really we
have no division by a vector (a ring, perhaps?),
You have the right general idea.
Post by Zach
so what I would like is for axiom to solve this by
a * v1 . v1 = v2 . v1
a = (v2 . v1) / (v1 . v1)
??? This is not a solution to the original equation!
Post by Zach
I assume that I do this by giving Axiom some type information,
like specifying v1 and v2 as Vector (or Matrix) Fraction Integer
or something.
Well no, not really. Currently Axiom has no domain for symbolic
computations with vectors. Specifying

v1:Vector Fraction Integer

does not allow symbolic computations with the symbol 'v1', instead it
declares that the *type* of the variable 'v1' is 'Vector Fraction
Integer'.
Zach
2008-05-13 22:32:51 UTC
Permalink
Bill,
Post by Bill Page
Post by Zach
so what I would like is for axiom to solve this by
a * v1 . v1 = v2 . v1
a = (v2 . v1) / (v1 . v1)
??? This is not a solution to the original equation!
Hmm, the problem is that this equation is in danger of having no solution.
I guess there is an implicit assumption that this has a solution for some
nonzero v2, meaning the vectors must be parallel. My boss gave me a problem
something like this and I am walking on shaky legs at the moment as I
haven't tried to solve problems like these before.

I guess the correct thing to do is notice that v1 and v2 must be parallel,
and then deal with the magnitudes, a=|v2|/|v1|. Once you accept this my
solution works too, as with unit vector u in the direction of v1 and v2, v1
= |v1| u and v2 = |v2| u, v1 . v2 = |v1| |v2| u . u = |v1| |v2| and v1 . v1
= |v1|^2. Right? Please feel free to point out any misconceptions I am
fostering.

Anyway, I guess I chose too simple of an example. But never mind that.
(The original problem was to find tuples of reals (n1, n2, m1, m2) such that
n1*a1 + n2*a2 = m1*b1 + m2*b2 (where a1, a2, b1, and b2 are 2D vectors).)
Post by Bill Page
Well no, not really. Currently Axiom has no domain for symbolic
computations with vectors.
I was afraid of that. Over at Maxima they had no facility either.
Post by Bill Page
Post by Zach
What is the best way of tackling these types of problems?
It would be possible (and quite interesting) to create a new domain in
Axiom for symbolic vector calculations.
Hmm, okay. So, it would be a good idea to understand how this is done in
polynomial symbolic manipulation before approaching such a task?

Thanks,
Zach
Billinghurst, David (RTATECH)
2008-05-13 23:43:34 UTC
Permalink
From: Zach
(The original problem was to find tuples of reals (n1, n2, m1, m2)
such that n1*a1 + n2*a2 = m1*b1 + m2*b2 (where a1, a2, b1, and b2 are
2D vectors).)

Firstly, the solution is not unique. If (n1, n2, m1, m2) is a solution
then
so is (k*n1, k*n2, k*m1, k*m2).

Now write this as a matrix equation, where a1 = (a1x, a1y) and so on

[ a1x a2x -b1x -b2x ] [ n1 ] [ 0 ]
[ a1y a2y -b1y -b2y ] [ n2 ] = [ 0 ]
[ m1 ]
[ m2 ]

and solve as an underdetermined linear system. The nature of the
solution will depend
on the rank of the coefficient matrix.


NOTICE
This e-mail and any attachments are private and confidential and may contain privileged information. If you are not an authorised recipient, the copying or distribution of this e-mail and any attachments is prohibited and you must not read, print or act in reliance on this e-mail or attachments.
This notice should not be removed.
Bill Page
2008-05-14 16:45:39 UTC
Permalink
Post by Zach
Post by Bill Page
Post by Zach
so what I would like is for axiom to solve this by
a * v1 . v1 = v2 . v1
a = (v2 . v1) / (v1 . v1)
??? This is not a solution to the original equation!
Hmm, the problem is that this equation is in danger of having no solution.
I guess there is an implicit assumption that this has a solution for some
nonzero v2, meaning the vectors must be parallel. My boss gave me a
problem something like this and I am walking on shaky legs at the
moment as I haven't tried to solve problems like these before.
Ok, I like this problem. Of course I agree that *if* this equation has
a solution then what you wrote is the solution. The situation is not
so different in a lot of other cases of symbolic "solutions".
Post by Zach
I guess the correct thing to do is notice that v1 and v2 must be parallel,
and then deal with the magnitudes, a=|v2|/|v1|. Once you accept this
my solution works too, as with unit vector u in the direction of v1 and
v2, v1 = |v1| u and v2 = |v2| u, v1 . v2 = |v1| |v2| u . u = |v1| |v2| and
v1 . v1 = |v1|^2. Right?
Right. Thanks for explaining your point of view.
Post by Zach
Please feel free to point out any misconceptions I am fostering.
Something similar has been discussed by Tim Daly and Gabriel Dos Reis
in the thread "Provisos":

http://lists.gnu.org/archive/html/axiom-developer/2008-05/msg00067.html
Post by Zach
Anyway, I guess I chose too simple of an example.
No, it is a good example. I think your example is interesting because
it illustrates a kind of proviso that is not naturally represented as
an interval on some domain.
Post by Zach
But never mind that. (The original problem was to find tuples of reals
(n1, n2, m1, m2) such that n1*a1 + n2*a2 = m1*b1 + m2*b2
(where a1, a2, b1, and b2 are 2D vectors).)
Post by Bill Page
Well no, not really. Currently Axiom has no domain for symbolic
computations with vectors.
I was afraid of that. Over at Maxima they had no facility either.
The only work of this kind that I know about is:

Component-Free Vector Algebra in Aldor
Songxin Liang, David J. Jeffrey and Stephen M. Watt
Proc. Transgressive Computing 2006:

An implementation of a component-free symbolic vector algebra in Aldor
is presented. This package provides two powerful functions:
simplification of vector expressions and the proof of vector
identities. The implementation bene¯ts greatly from Aldor's strong
typing, which allows several simplification problems that have
defeated previous implementations to be solved.

http://www.csd.uwo.ca/~watt/pub/reprints/2006-tc-vectalg.pdf
Post by Zach
Post by Bill Page
Post by Zach
What is the best way of tackling these types of problems?
It would be possible (and quite interesting) to create a new domain in
Axiom for symbolic vector calculations.
Aldor can be used as a library compiler for Axiom. I received a copy
of the source code for this package from Songxin Liang. It is written
for "stand alone" use, i.e. without Axiom. I have been intended to
convert it for use within Axiom but have not had sufficient time.
Perhaps you are interested? If so, please let me know.
Post by Zach
Hmm, okay. So, it would be a good idea to understand how this is done
in polynomial symbolic manipulation before approaching such a task?
Yes. Axiom has a fairly high learning curve but (of course!) I think
it is worth the effort. If you continue with some activity in Axiom
along these lines please feel free to discuss it here.

Regards,
Bill Page.

Loading...