Group Abstract Group Abstract

Message Boards Message Boards

0
|
3.5K Views
|
4 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Solving system of equations takes too long

Posted 2 years ago
Attachment

Attachments:
POSTED BY: Val Semenov
4 Replies
Posted 2 years ago

Obviously the task is solvable, and I managed to make it work rewriting the code according to your recommendations:

Thanks for the help, I would still like to know what went wrong in my initial example and how to correctly define temporary variables in order to make my code more readable next time.

POSTED BY: Val Semenov

Your system reduced to the essentials

p1 = {x2 - x1, y2 - y1, z2 - z1};
p2 = {x2 - x3, y2 - y3, z2 - z3};
p3 = {x4 - x3, y4 - y3, z4 - z3};
p4 = {x1 - x4, y1 - y4, z1 - z4};
list = {(p1 - p2) . {a2, b2, c2} == 0, 
  p1 . ({a2, b2, c2}*p2) == 0,
  a2*x2 + b2*y2 + c2*z2 + d2 == 0,
  (p2 - p3) . {a3, b3, c3} == 0,
  p2 . ({a3, b3, c3}*p3) == 0,
  a3*x3 + b3*y3 + c3*z3 + d3 == 0,
  (p3 - p4) . {a4, b4, c4} == 0,
  p3 . ({a4, b4, c4}*p4) == 0,
  a4*x4 + b4*y4 + c4*z4 + d4 == 0, 
  (p1 - p4) . {a1, b1, c1} == 0,
  p1 . ({a1, b1, c1}*p4) == 0,
  a1*x1 + b1*y1 + c1*z1 + d1 == 0}

seems to be not solvable. GroeberBasis yields {1.} that is, there is a solution if 1==0

The equalities for the angles imply equations of the fourth order since

a^2 b^2 Cos[a,b]^2 == (a.b)^2 == c^2 d^2 Cos[c,d]^2 == (c.d)^2

POSTED BY: Roland Franzius
Posted 2 years ago

Yep. Initially I wanted to solve for p1, but it gave out an error. Now it shows no errors, so I assumed the code is okay. Should I define p1...p4 outside of the system of equations?

POSTED BY: Val Semenov
Posted 2 years ago

I don't understand how it's running at all. The p1, p2, et al are not declared as variables to solve for. Are you perhaps trying to use them as temporary variables to avoid duplicating all of the expressions involving x*, y*, z*?

POSTED BY: Eric Rimbey
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard