I am unable to verify that my vector expressions are equivalent. I want it to say true or false.

 Remove["Global`*"]

$Assumptions = e ∈ Vectors[3, Reals]
$Assumptions = a ∈ Vectors[3, Reals]
$Assumptions = p ∈ Vectors[3, Reals]
p = a - (a.e) e
TensorExpand[p.p] == (a.a - a.((a.e) e) - ((a.e) e).a + ((a.e) e).((a.e) e))
(a.a - a.((a.e) e) - ((a.e) e).a + ((a.e) e).((a.e) e)) == ((a - \
(a.e) e).(a - (a.e) e))
TensorExpand[p.p] == Norm[a]^2 - (a.e)^2 (*e has length 1*)

What I ultimately want is to find (using mathematica) is the angle between vectors a and b. I'm given the lengths of a and b as 156 and Dot[a,e]== Dot[b,e]==90. vectors p and q are the projections of a and b onto a plane. Angle between p and q is 120. Now I have this code that is no good.

   $Assumptions = (a | e) \[Element] Vectors[3, Reals] && e.e == 1 && 
   a.e == b.e == 90  && Sqrt[a.a] == 156 == Sqrt[b.b]; 
   p = a - (a.e) e;
   q = b - Dot[b, e] e;
   Simplify[TensorExpand[a.b], Sqrt[a.a] == 156 == Sqrt[b.b]]

You can prove using TensorExpand

TensorExpand[p.p] == (a.a - a.((a.e) e) - ((a.e) e).a + ((a.e) e).((a.e) e))
(* True *)
  • why is p vector's colour black while a and e are blue? How can I get the absolute value of a vector as Abs[] function is for reals or complex not vector? – Megamatics Nov 7 at 12:13

You need to define $Assumptions just once, instead of 3 different times. In your code, the only assumption Mathematica uses is p ∈ Vectors[3, Reals]. Also, use a.a instead of Norm[a]^2. Finally, you also need to include your condition that e.e == 1. So:

$Assumptions = (a | e) ∈ Vectors[3, Reals];
p = a - (a.e) e;
Simplify[
    TensorExpand[p.p == a.a - (a.e)^2],
    e.e == 1
]

True

Addendum

To address the OP question about assumptions, you can combine assumptions using And (&&):

$Assumptions = (a | e) ∈ Vectors[3,Reals] && e.e == 1;
p = a-(a.e) e;
Simplify @ TensorExpand[p.p==a.a-(a.e)^2]

True

TensorExpand will not use the e.e == 1 assumption, so you will need to include Simplify to take account of that assumption.

As for an angle assumption, do you have an example?

  • Is it possible to combine within the same $Assumption statement the attributes that a is a 3-D vector with its Euclidean length? I don't know how to specify that a vector has a particular length other than through its dot product in Mathematica. Can the known angle between two vectors in the same plane also be given as a general assumption? – Megamatics Nov 9 at 12:35
  • Vectors p,q in the same plane are projections of vectors a and b resp.The angle between p and p is 120 degrees. p and q in terms of a and b are:-p=a-(a.e)e; q=b-(b.e) e. Can this information be used as assumptions to calculate the dot product of a with b? – Megamatics Nov 10 at 14:37
  • Vectors a and b have the same length of 156 and same dot product with unit normal vector e Dot[a,e] =Dot[b,e].=90. – Megamatics Nov 10 at 14:49
  • By calculating Dot[a,b] in terms of vectors p and q, ultimately I wish to find the angle between vector a and vector b. – Megamatics Nov 10 at 15:37

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.