Possible bug in the cross product and vector simplfication ?
Subject: Possible bug in the cross product and vector simplfication ?
From: Sergey Ten
Date: Mon, 30 May 2005 21:28:31 +0200
I'm trying to use cross product
and getting wrong result:
DECLARE([PR0, PR1, PR2, PR3], NONSCALAR);
(%o1) DONE
(%i2) load("vect");
(%o2) C:/PROGRA~1/MAXIMA~1.1/share/maxima/5.9.1/share/vector/vect.mac
(%i3) DECLARE([ax0, ay0, ax1, ay1, ax2, ay2, ax3, ay3], SCALAR);
(%o3) DONE
(%i4) DECLARE([PRN0, PRN1, PRN2, PRN3], NONSCALAR);
(%o4) DONE
(%i5) DECLARE([XN, YN, ZN, X, Y, Z], NONSCALAR);
(%o5) DONE
(%i6) PRN0 : PR0 + ax0*X + ay0*Y;
(%o6) ay0 Y + ax0 X + PR0
(%i7) PRN3 : PR3 + ax3*X + ay3*Y;
(%o7) ay3 Y + ax3 X + PR3
(%i8) EXPANDCROSSCROSS :TRUE;
(%o8) TRUE
(%i9) EXPANDCROSSPLUS :TRUE;
(%o9) TRUE
(%i10) VECTORSIMP(PRN0 ~ PRN3);
WARNING: DECLARE VECTOR INDETERMINANTS
NONSCALAR TO AVOID ERRORS & TO GET FULL SIMPLIFICATION
(%o10) ay3 PR0 ~ Y + ax3 PR0 ~ X + PR0 ~ PR3 + ay0 ~ (- PR3 ~ Y)
that is very strange result
the problem seems in the
EXPANDCROSSCROSS :TRUE;
which is
"EXPANDCROSSCROSS refers to replacing p~(q~r) with (p.r)*q-(p.q)*r"
if I do
(%i11) EXPANDCROSSCROSS :FALSE;
I'm getting
(%o9) TRUE
(%i10) VECTORSIMP(PRN0 ~ PRN3);
WARNING: DECLARE VECTOR INDETERMINANTS
NONSCALAR TO AVOID ERRORS & TO GET FULL SIMPLIFICATION
(%o10) ay3 PR0 ~ Y + ax3 PR0 ~ X + PR0 ~ PR3 + ay0 ~ (- PR3 ~ Y)
(%i11) EXPANDCROSSCROSS :FALSE;
(%o11) FALSE
(%i12) VECTORSIMP(PRN0 ~ PRN3);
WARNING: DECLARE VECTOR INDETERMINANTS
NONSCALAR TO AVOID ERRORS & TO GET FULL SIMPLIFICATION
(%o12) ay3 PR0 ~ Y + ax3 PR0 ~ X + PR0 ~ PR3 + 1 ~ X ~ Y ax0 ay3
+ ay0 ~ (- PR3 ~ Y) - 1 ~ X ~ Y ax3 ay0 - 1 ~ PR3 ~ X ax0
- it is better, but still - why scalars cross producted to vector ? It
seems scalar treated as vector, - instead of ax0 it's treated as
ax0*Vector_1
Any advice how I should work with cross product to get correct results ?
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.322 / Virus Database: 267.2.0 - Release Date: 5/27/2005