Why is Maxima Not Solving My System of Equations?

In summary: I don't know how to get only the solution for xD and yD.In summary, the conversation revolved around solving a system of equations involving 9 unknowns. It was suggested to ask for the values of all 9 unknowns instead of just 2, which would provide the solutions for xD and yD. The speaker was not skilled enough with Maxima to do this, but it was mentioned that using substitution or the eval() function may help reach the desired result.
  • #1
Pejeu
27
1
for:
Code:
solve([k^2=(xa-xd)^2 + (ya-yd)^2,k^2=(xb-xd)^2 + (yb-yd)^2,k^2=(xc-xd)^2 + (yc-yd)^2],[xd,yd]);
the output is simply : []

I want it to solve the system :

k2=(xA-xD)2 + (yA-yD)2
k2=(xB-xD)2 + (yB-yD)2
k2=(xC-xD)2 + (yC-yD)2

for xD and yD.

I already solved it by hand but wanted to test Maxima with it.

What am I doing wrong?
 
Physics news on Phys.org
  • #2
Instead of asking the value of only 2 unknowns, if you instead ask the value of the 9 unknowns you get
Code:
(%i4) solve([k^2=(xa-xd)^2+(ya-yd)^2,k^2=(xb-xd)^2+(yb-yd)^2,k^2=(xc-xd)^2+(yc-yd)^2],[xd,yd,xa,xb,xc,yb,yc,k,ya]);
(%o4) [[xd = %r1, yd = %r2, xa = %r3, xb = %r4, xc = %r5, yb = %r6,
  2  2  2  2
yc = sqrt(%r6  - 2 %r2 %r6 - %r5  + %r1 (2 %r5 - 2 %r4) + %r4  + %r2 ) + %r2,
  2  2  2  2
k = sqrt(%r6  - 2 %r2 %r6 + %r4  - 2 %r1 %r4 + %r2  + %r1 ),
  2  2  2  2
ya = sqrt(%r6  - 2 %r2 %r6 + %r4  + %r1 (2 %r3 - 2 %r4) - %r3  + %r2 ) + %r2],
[xd = %r7, yd = %r8, xa = %r9, xb = %r10, xc = %r11, yb = %r12,
  2  2  2  2
yc = sqrt(%r8  - 2 %r12 %r8 + (2 %r11 - 2 %r10) %r7 + %r12  - %r11  + %r10 )
  2  2  2  2
+ %r8, k = sqrt(%r8  - 2 %r12 %r8 + %r7  - 2 %r10 %r7 + %r12  + %r10 ),
  2  2  2
ya = %r8 - sqrt(- %r9  + %r7 (2 %r9 - 2 %r10) + %r8  - 2 %r12 %r8 + %r12
  2
+ %r10 )], [xd = %r13, yd = %r14, xa = %r15, xb = %r16, xc = %r17, yb = %r18,
  2  2  2  2
yc = sqrt(%r18  - 2 %r14 %r18 - %r17  + %r13 (2 %r17 - 2 %r16) + %r16  + %r14 )
  2  2  2
+ %r14, k = - sqrt(%r18  - 2 %r14 %r18 + %r16  - 2 %r13 %r16 + %r14
  2  2  2
+ %r13 ), you = sqrt(%r18  - 2 %r14 %r18 + %r16  + %r13 (2 %r15 - 2 %r16)
  2  2
- %r15  + %r14 ) + %r14], [xd = %r19, yd = %r20, xa = %r21, xb = %r22,
  2  2
xc = %r23, yb = %r24, yc = sqrt(%r24  - 2 %r20 %r24 - %r23
  2  2
+ %r19 (2 %r23 - 2 %r22) + %r22  + %r20 ) + %r20,
  2  2  2  2
k = - sqrt(%r24  - 2 %r20 %r24 + %r22  - 2 %r19 %r22 + %r20  + %r19 ),
  2  2  2
ya = %r20 - sqrt(%r24  - 2 %r20 %r24 + %r22  + %r19 (2 %r21 - 2 %r22) - %r21
  2
+ %r20 )], [xd = %r25, yd = %r26, xa = %r27, xb = %r28, xc = %r29, yb = %r30,
  2  2  2
yc = %r26 - sqrt(%r30  - 2 %r26 %r30 - %r29  + %r25 (2 %r29 - 2 %r28) + %r28
  2  2  2  2
+ %r26 ), k = sqrt(%r30  - 2 %r26 %r30 + %r28  - 2 %r25 %r28 + %r26
  2  2  2
+ %r25 ), you = sqrt(%r30  - 2 %r26 %r30 + %r28  + %r25 (2 %r27 - 2 %r28)
  2  2
- %r27  + %r26 ) + %r26], [xd = %r31, yd = %r32, xa = %r33, xb = %r34,
  2  2
xc = %r35, yb = %r36, yc = %r32 - sqrt(%r36  - 2 %r32 %r36 - %r35
  2  2
+ %r31 (2 %r35 - 2 %r34) + %r34  + %r32 ),
  2  2  2  2
k = sqrt(%r36  - 2 %r32 %r36 + %r34  - 2 %r31 %r34 + %r32  + %r31 ),
  2  2  2
ya = %r32 - sqrt(%r36  - 2 %r32 %r36 + %r34  + %r31 (2 %r33 - 2 %r34) - %r33
  2
+ %r32 )], [xd = %r37, yd = %r38, xa = %r39, xb = %r40, xc = %r41, yb = %r42,
  2  2  2
yc = %r38 - sqrt(%r42  - 2 %r38 %r42 - %r41  + %r37 (2 %r41 - 2 %r40) + %r40
  2  2  2  2
+ %r38 ), k = - sqrt(%r42  - 2 %r38 %r42 + %r40  - 2 %r37 %r40 + %r38
  2  2  2
+ %r37 ), you = sqrt(%r42  - 2 %r38 %r42 + %r40  + %r37 (2 %r39 - 2 %r40)
  2  2
- %r39  + %r38 ) + %r38], [xd = %r43, yd = %r44, xa = %r45, xb = %r46,
  2  2
xc = %r47, yb = %r48, yc = %r44 - sqrt(%r48  - 2 %r44 %r48 - %r47
  2  2
+ %r43 (2 %r47 - 2 %r46) + %r46  + %r44 ),
  2  2  2  2
k = - sqrt(%r48  - 2 %r44 %r48 + %r46  - 2 %r43 %r46 + %r44  + %r43 ),
  2  2  2
ya = %r44 - sqrt(%r48  - 2 %r44 %r48 + %r46  + %r43 (2 %r45 - 2 %r46) - %r45
  2
+ %r44 )]]
From there I guess you could reach the result you got by hand if you used some substitution or eval() function but I am not skilled enough with Maxima to do it (yet at least).
 
  • #3
Hello, thank you very much for the insight. That actually never occurred to me. It does churn out stuff if I give it that. However, I can't really make sense of the output. And I can't find the solution I was expecting anywhere in the output. The solution I got was actually pretty neat and elegant.

Only xD and yD are unknowns and I need it to solve the system for them, with the other variables treated as knowns.

What are all those %r's followed by numbers?

I assumed that if I requested it solve the system for xD and yD that it would treat those as knowns and the other variables as unknowns and solve in terms of them.
 
Last edited:
  • #4
Pejeu said:
Hello, thank you very much for the insight. That actually never occurred to me. It does churn out stuff if I give it that. However, I can't really make sense of the output. And I can't find the solution I was expecting anywhere in the output. The solution I got was actually pretty neat and elegant.

Only xD and yD are unknowns and I need it to solve the system for them, with the other variables treated as knowns.

What are all those %r's followed by numbers?

I assumed that if I requested it solve the system for xD and yD that it would treat those as knowns and the other variables as unknowns and solve in terms of them.
I guess Maxima can yield your neat solution if we entered another command(s). Maxima has a mailing list which is like a forum in which you could ask your questions, I'm sure people experienced would reply to you in a few hours at most.
From what I understand in the output, Maxima seems to assign %r1 to xd and other %r_i's to other variables, then perform some calculations and then assign other %r_i's to other variables, etc.
So to get your answer which is xd = %r43, yd = %r44 , you'd have to substitute back what are %r43 and %r44. Surely there must be a way to do this with a simle command, but I am new to Maxima and don't know about it.Edit: I suggest you to post your problem in the mailing list. I've read that when [] is returned it means that Maxima cannot find a solution (so there's great chances that the solution does not exist). I don't understand then how come it returns something when you ask for the 9 variables.
 
Last edited:
  • #5
There is a solution. And it's quite neat and elegant. The solutions for xD and yD are the equations for the coordinates of the centre of the circle circumscribed to the triangle whose tips are defined by points A (xA, yA), B (xB, yB) and C (xC, yC). K is the radius of the circumscribed circle.

Thank you very much for all the help. You've made things much clearer and have been a lot of help.

Unfortunately, I'm not all that interested in spending the time to learn maxima. Especially if it cannot even find the solution to that simple system (there is one) without me doing half or more of the work for it.

But this is what I've come to expect after having tried several CAS software including Mathematica, MathCAD, Reduce and Sage.
 
  • #6
Yes learning a CAS does not seem an easy task. Now that you've described the problem, Maxima will never know that K is not independent of the tips A, B and C. So maybe if you define K in terms of xa, ya, xb, yb, xc and yc then Maxima would return the value that you expect.Edit: The %r_i's are parameters I think. They come from because when I asked the values for 9 variables Maxima tried to solve 3 equations with 9 unknown which yield infinitely many solutions, hence the free parameters.
In the 1st post you asked for 2 values so Maxima solved the system of 3 equations with 2 unknowns which yielded an overdetermined system that leads to no solution and I believe Maxima was correct in returning [].
 
Last edited:
  • #7
News! So you have 3 equations and so you want 3 unknowns!
Let's say that, as you said, want to determine the coordinates of the center of the cicumscribed circle. Now assume that you also want to know the radius of such circle. Then you ask to Maxima:
Code:
(%i1) solve([k^2=(xa-xd)^2 + (ya-yd)^2,k^2=(xb-xd)^2 + (yb-yd)^2,k^2=(xc-xd)^2 + (yc-yd)^2],[xd,yd,k]);
  2  2  2  2  2  2
(%o1) [[xd = - ((yb - ya) yc  + (- yb  + you  - xb  + xa ) yc + you yb
  2  2  2  2  2
 + (- you  + xc  - xa ) yb + (xb  - xc ) ya)
/((2 xb - 2 xa) yc + (2 xa - 2 xc) yb + (2 xc - 2 xb) ya),
  2  2  2  2
yd = ((xb - xa) yc  + (xa - xc) yb  + (xc - xb) you  + (xb - xa) xc
  2  2  2  2
 + (xa  - xb ) xc + xa xb  - xa  xb)/((2 xb - 2 xa) yc + (2 xa - 2 xc) yb
  2  4  4  2  4  2  4
 + (2 xc - 2 xb) ya), k = - sqrt(yb  yc  - 2 you yb yc  + you  yc  + xb  yc
  4  2  4  3  3  2  3  2  3
 - 2 xa xb yc  + xa  yc  - 2 yb  yc  + 2 you yb  yc  + 2 you  yb yc
  2  3  3  2  3  3  3  2  3
 - 2 xb  yb yc  + 4 xa xb yb yc  - 2 xa  yb yc  - 2 you  yc  - 2 xb  you yc
  3  2  3  4  2  3  2  2  2  2
 + 4 xa xb you yc  - 2 xa  you yc  + yb  yc  + 2 you yb  yc  - 6 you  yb  yc
  2  2  2  2  2  2  2  2  2  2
 + 2 xc  yb  yc  - 2 xb xc yb  yc  - 2 xa xc yb  yc  + 2 xb  yb  yc
  2  2  2  2  2  3  2  2  2
 - 2 xa xb yb  yc  + 2 xa  yb  yc  + 2 you  yb yc  - 4 xc  you yb yc
  2  2  2  2  2
 + 4 xb xc you yb yc  + 4 xa xc you yb yc  + 2 xb  you yb yc  - 8 xa xb you yb yc
  2  2  4  2  2  2  2  2  2
 + 2 xa  you yb yc  + you  yc  + 2 xc  you  yc  - 2 xb xc you  yc
  2  2  2  2  2  2  2  2  2  2
 - 2 xa xc you  yc  + 2 xb  you  yc  - 2 xa xb you  yc  + 2 xa  you  yc
  2  2  2  2  2  2  2  2  3  2
 + 2 xb  xc  yc  - 4 xa xb xc  yc  + 2 xa  xc  yc  - 2 xb  xc yc
  2  2  2  2  3  2  4  2  3  2
 + 2 xa xb  xc yc  + 2 xa  xb xc yc  - 2 xa  xc yc  + xb  yc  - 2 xa xb  yc
  2  2  2  3  2  4  2  4  2  3
 + 2 xa  xb  yc  - 2 xa  xb yc  + xa  yc  - 2 you yb  yc + 2 you  yb  yc
  2  3  3  2  3  3  2
 - 2 xc  yb  yc + 4 xa xc yb  yc - 2 xa  yb  yc + 2 you  yb  yc
  2  2  2  2  2  2
 + 2 xc  you yb  yc + 4 xb xc you yb  yc - 8 xa xc you yb  yc - 4 xb  you yb  yc
  2  2  2  4  2  2
 + 4 xa xb you yb  yc + 2 xa  you yb  yc - 2 you  yb yc + 2 xc  you  yb yc
  2  2  2  2  2
 - 8 xb xc you  yb yc + 4 xa xc you  yb yc + 2 xb  you  yb yc + 4 xa xb you  yb yc
  2  2  2  2  2  2  2
 - 4 xa  you  yb yc - 2 xb  xc  yb yc + 4 xa xb xc  yb yc - 2 xa  xc  yb yc
  2  2  3  2  2
 + 4 xa xb  xc yb yc - 8 xa  xb xc yb yc + 4 xa  xc yb yc - 2 xa  xb  yb yc
  3  4  2  3  3  2  3
 + 4 xa  xb yb yc - 2 xa  yb yc - 2 xc  you  yc + 4 xb xc you  yc - 2 xb  you  yc
  2  2  2  2  2  3
 - 2 xb  xc  you yc + 4 xa xb xc  you yc - 2 xa  xc  you yc + 4 xb  xc you yc
  2  2  4  3
 - 8 xa xb  xc you yc + 4 xa  xb xc you yc - 2 xb  you yc + 4 xa xb  you yc
  2  2  2  4  2  4  4  2  4  3  3
 - 2 xa  xb  you yc + you  yb  + xc  yb  - 2 xa xc yb  + xa  yb  - 2 you  yb
  2  3  3  2  3  4  2  2  2  2
 - 2 xc  you yb  + 4 xa xc you yb  - 2 xa  you yb  + you  yb  + 2 xc  you  yb
  2  2  2  2  2  2  2  2  2
 - 2 xb xc you  yb  - 2 xa xc you  yb  + 2 xb  you  yb  - 2 xa xb you  yb
  2  2  2  4  2  3  2  3  2  2  2  2
 + 2 xa  you  yb  + xc  yb  - 2 xb xc  yb  - 2 xa xc  yb  + 2 xb  xc  yb
  2  2  2  2  2  2  2  2  2
 + 2 xa xb xc  yb  + 2 xa  xc  yb  - 4 xa xb  xc yb  + 2 xa  xb xc yb
  3  2  2  2  2  3  2  4  2  2  3
 - 2 xa  xc yb  + 2 xa  xb  yb  - 2 xa  xb yb  + xa  yb  - 2 xc  you  yb
  3  2  3  4  3
 + 4 xb xc you  yb - 2 xb  you  yb - 2 xc  you yb + 4 xb xc  you yb
  3  2  2  2  2  2
 + 4 xa xc  you yb - 2 xb  xc  you yb - 8 xa xb xc  you yb - 2 xa  xc  you yb
  2  2  2  2  2  4
 + 4 xa xb  xc you yb + 4 xa  xb xc you yb - 2 xa  xb  you yb + xc  ya
  4  2  4  4  2  3  2  3  2
 - 2 xb xc you  + xb  you  + xc  you  - 2 xb xc  you  - 2 xa xc  ya
  2  2  2  2  2  2  2  2  3  2
 + 2 xb  xc  you  + 2 xa xb xc  you  + 2 xa  xc  you  - 2 xb  xc ya
  2  2  2  2  4  2  3  2  2  2  2
 + 2 xa xb  xc you  - 4 xa  xb xc you  + xb  you  - 2 xa xb  you  + 2 xa  xb  ya
  2  4  4  2  4  3  3  2  3  2  3
 + xb  xc  - 2 xa xb xc  + xa  xc  - 2 xb  xc  + 2 xa xb  xc  + 2 xa  xb xc
  3  3  4  2  3  2  2  2  2  3  2  4  2
 - 2 xa  xc  + xb  xc  + 2 xa xb  xc  - 6 xa  xb  xc  + 2 xa  xb xc  + xa  xc
  4  2  3  3  2  4  2  4
 - 2 xa xb  xc + 2 xa  xb  xc + 2 xa  xb  xc - 2 xa  xb xc + xa  xb
  3  3  4  2
 - 2 xa  xb  + xa  xb )/((2 xb - 2 xa) yc + (2 xa - 2 xc) yb
  2  2  2  2  2
 + (2 xc - 2 xb) ya)], [xd = - ((yb - ya) yc  + (- yb  + you  - xb  + xa ) yc
  2  2  2  2  2  2
 + you yb  + (- you  + xc  - xa ) yb + (xb  - xc ) ya)
/((2 xb - 2 xa) yc + (2 xa - 2 xc) yb + (2 xc - 2 xb) ya),
  2  2  2  2
yd = ((xb - xa) yc  + (xa - xc) yb  + (xc - xb) you  + (xb - xa) xc
  2  2  2  2
 + (xa  - xb ) xc + xa xb  - xa  xb)/((2 xb - 2 xa) yc + (2 xa - 2 xc) yb
  2  4  4  2  4  2  4
 + (2 xc - 2 xb) ya), k = sqrt(yb  yc  - 2 you yb yc  + you  yc  + xb  yc
  4  2  4  3  3  2  3  2  3
 - 2 xa xb yc  + xa  yc  - 2 yb  yc  + 2 you yb  yc  + 2 you  yb yc
  2  3  3  2  3  3  3  2  3
 - 2 xb  yb yc  + 4 xa xb yb yc  - 2 xa  yb yc  - 2 you  yc  - 2 xb  you yc
  3  2  3  4  2  3  2  2  2  2
 + 4 xa xb you yc  - 2 xa  you yc  + yb  yc  + 2 you yb  yc  - 6 you  yb  yc
  2  2  2  2  2  2  2  2  2  2
 + 2 xc  yb  yc  - 2 xb xc yb  yc  - 2 xa xc yb  yc  + 2 xb  yb  yc
  2  2  2  2  2  3  2  2  2
 - 2 xa xb yb  yc  + 2 xa  yb  yc  + 2 you  yb yc  - 4 xc  you yb yc
  2  2  2  2  2
 + 4 xb xc you yb yc  + 4 xa xc you yb yc  + 2 xb  you yb yc  - 8 xa xb you yb yc
  2  2  4  2  2  2  2  2  2
 + 2 xa  you yb yc  + you  yc  + 2 xc  you  yc  - 2 xb xc you  yc
  2  2  2  2  2  2  2  2  2  2
 - 2 xa xc you  yc  + 2 xb  you  yc  - 2 xa xb you  yc  + 2 xa  you  yc
  2  2  2  2  2  2  2  2  3  2
 + 2 xb  xc  yc  - 4 xa xb xc  yc  + 2 xa  xc  yc  - 2 xb  xc yc
  2  2  2  2  3  2  4  2  3  2
 + 2 xa xb  xc yc  + 2 xa  xb xc yc  - 2 xa  xc yc  + xb  yc  - 2 xa xb  yc
  2  2  2  3  2  4  2  4  2  3
 + 2 xa  xb  yc  - 2 xa  xb yc  + xa  yc  - 2 you yb  yc + 2 you  yb  yc
  2  3  3  2  3  3  2
 - 2 xc  yb  yc + 4 xa xc yb  yc - 2 xa  yb  yc + 2 you  yb  yc
  2  2  2  2  2  2
 + 2 xc  you yb  yc + 4 xb xc you yb  yc - 8 xa xc you yb  yc - 4 xb  you yb  yc
  2  2  2  4  2  2
 + 4 xa xb you yb  yc + 2 xa  you yb  yc - 2 you  yb yc + 2 xc  you  yb yc
  2  2  2  2  2
 - 8 xb xc you  yb yc + 4 xa xc you  yb yc + 2 xb  you  yb yc + 4 xa xb you  yb yc
  2  2  2  2  2  2  2
 - 4 xa  you  yb yc - 2 xb  xc  yb yc + 4 xa xb xc  yb yc - 2 xa  xc  yb yc
  2  2  3  2  2
 + 4 xa xb  xc yb yc - 8 xa  xb xc yb yc + 4 xa  xc yb yc - 2 xa  xb  yb yc
  3  4  2  3  3  2  3
 + 4 xa  xb yb yc - 2 xa  yb yc - 2 xc  you  yc + 4 xb xc you  yc - 2 xb  you  yc
  2  2  2  2  2  3
 - 2 xb  xc  you yc + 4 xa xb xc  you yc - 2 xa  xc  you yc + 4 xb  xc you yc
  2  2  4  3
 - 8 xa xb  xc you yc + 4 xa  xb xc you yc - 2 xb  you yc + 4 xa xb  you yc
  2  2  2  4  2  4  4  2  4  3  3
 - 2 xa  xb  you yc + you  yb  + xc  yb  - 2 xa xc yb  + xa  yb  - 2 you  yb
  2  3  3  2  3  4  2  2  2  2
 - 2 xc  you yb  + 4 xa xc you yb  - 2 xa  you yb  + you  yb  + 2 xc  you  yb
  2  2  2  2  2  2  2  2  2
 - 2 xb xc you  yb  - 2 xa xc you  yb  + 2 xb  you  yb  - 2 xa xb you  yb
  2  2  2  4  2  3  2  3  2  2  2  2
 + 2 xa  you  yb  + xc  yb  - 2 xb xc  yb  - 2 xa xc  yb  + 2 xb  xc  yb
  2  2  2  2  2  2  2  2  2
 + 2 xa xb xc  yb  + 2 xa  xc  yb  - 4 xa xb  xc yb  + 2 xa  xb xc yb
  3  2  2  2  2  3  2  4  2  2  3
 - 2 xa  xc yb  + 2 xa  xb  yb  - 2 xa  xb yb  + xa  yb  - 2 xc  you  yb
  3  2  3  4  3
 + 4 xb xc you  yb - 2 xb  you  yb - 2 xc  you yb + 4 xb xc  you yb
  3  2  2  2  2  2
 + 4 xa xc  you yb - 2 xb  xc  you yb - 8 xa xb xc  you yb - 2 xa  xc  you yb
  2  2  2  2  2  4
 + 4 xa xb  xc you yb + 4 xa  xb xc you yb - 2 xa  xb  you yb + xc  ya
  4  2  4  4  2  3  2  3  2
 - 2 xb xc you  + xb  you  + xc  you  - 2 xb xc  you  - 2 xa xc  ya
  2  2  2  2  2  2  2  2  3  2
 + 2 xb  xc  you  + 2 xa xb xc  you  + 2 xa  xc  you  - 2 xb  xc ya
  2  2  2  2  4  2  3  2  2  2  2
 + 2 xa xb  xc you  - 4 xa  xb xc you  + xb  you  - 2 xa xb  you  + 2 xa  xb  ya
  2  4  4  2  4  3  3  2  3  2  3
 + xb  xc  - 2 xa xb xc  + xa  xc  - 2 xb  xc  + 2 xa xb  xc  + 2 xa  xb xc
  3  3  4  2  3  2  2  2  2  3  2  4  2
 - 2 xa  xc  + xb  xc  + 2 xa xb  xc  - 6 xa  xb  xc  + 2 xa  xb xc  + xa  xc
  4  2  3  3  2  4  2  4
 - 2 xa xb  xc + 2 xa  xb  xc + 2 xa  xb  xc - 2 xa  xb xc + xa  xb
  3  3  4  2
 - 2 xa  xb  + xa  xb )/((2 xb - 2 xa) yc + (2 xa - 2 xc) yb
 + (2 xc - 2 xb) ya)]]
Now I'm not sure how to simplify this. I'd appreciate if you could provide your answer by hand. Thanks.
 
  • #8
Sure thing. Here it is :

https://drive.google.com/open?id=0BwJaCsyXIqEeME5FTF9pNXVKS1E&authuser=0

Tested it empirically and it seems to be correct. If Maxima or some other CAS were able to do this for me it would spare both the initial work and the need for empirical testing.

later edit:

I can get the equation for the radius of the circumscribed circle by performing a Euclidean distance calculation from xD, yD to either one of A, B or C.

If Maxima can't cut this it's pretty much useless for my purposes, unfortunately. So no point in learning it.

But it doesn't mean it's bad compared to other CASes I tried (MathCAD, Mathematica, Sage, Reduce).

They all pretty much suck, unfortunately. At least for my needs.

But to be fair, the tests I had MathCAD, Mathematica, Sage do were more complex than this.

even later edit:

I gave them all the same test and they all ran out of memory, which leads me to believe they use similar algorithms or at least approaches.
 
Last edited:
  • #9
Well in my last post Maxima gave the correct (and short) answer which is equivalent to the one you provided.
The command to get it was
Code:
solve([k^2=(xa-xd)^2 + (ya-yd)^2,k^2=(xb-xd)^2 + (yb-yd)^2,k^2=(xc-xd)^2 + (yc-yd)^2],[xd,yd,k]);
When you use solve() and ask for n variables (in this case n=3), maxima assumes that there are n unknowns and that you want them expressed in terms of the other variables supposedly known. Initially you had a system of 3 equations and you explictly asked for only 2 unknowns so that mathematically you had a system of 3 equations with 2 unknown which is an overdetermined system that has no solution and Maxima was correct returning the empty list [].
To overcome this problem I just asked to Maxima the values of the 3 unknowns xd, yd and k. Maxima was strong enough to return the correct result.

The fact that one does not know well a CAS because it is hard to know does not mean that the CAS sucks, in my opinion. I am sure Maxima (as well as Maxima and others) are extremely powerful tools when one knows how to use them properly.

By the way for a nicer looking output I use wxMaxima (maybe you use it too?).
And here I post some commands if you want to check that both answers (yours and Maxima's) are equivalent:
Your position for xd:
Code:
xd(xa,xb,xc,ya,yb,yc):=(ya*(xc^2-xb^2+yc^2-yb^2)+yb*(xa^2-xc^2+ya^2-yc^2)+yc*(xb^2-xa^2+yb^2-ya^2))/(2*(xa*(yb-yc)+xb*(yc-ya)+xc*(ya-yb)));
Maxima's position for xd :
Code:
ome(xa,xb,xc,ya,yb,yc):=-((yb-ya)*yc^2+(-yb^2+ya^2-xb^2+xa^2)*yc+ya*yb^2+(-ya^2+xc^2-xa^2)*yb+(xb^2-xc^2)*ya)/((2*xb-2*xa)*yc+(2*xa-2*xc)*yb+(2*xc-2*xb)*ya);

Checking some values :
Code:
xd(1,2,3,4,6,7);
$$\frac{13}{2}$$
Maxima's:
Code:
ome(1,2,3,4,6,7);
$$\frac{13}{2}$$
I also tested for other values and they both match.
 
  • Like
Likes Pejeu
  • #10
Wow. I don't know what to say. Except thanks! A lot! :smile:
 
  • Like
Likes fluidistic
  • #11
No problem. I learned in the process :)
 
  • Like
Likes Pejeu

1. What is Maxima and what is its purpose?

Maxima is a free and open-source computer algebra system (CAS) that is widely used in scientific research and education. Its main purpose is to provide a comprehensive platform for symbolic mathematical calculations, including algebra, calculus, statistics, and more.

2. How does Maxima compare to other CAS software?

Maxima is often compared to other popular CAS software like Maple, Mathematica, and MATLAB. While all of these systems have their own strengths and limitations, Maxima stands out for its open-source nature, large library of built-in functions, and its ability to handle complex symbolic expressions and equations.

3. Can Maxima be used for other types of calculations besides mathematics?

Yes, Maxima can be used for a variety of scientific and engineering tasks besides mathematics. It has built-in functions and packages for physics, chemistry, economics, and many other fields. It can also be extended with user-defined functions and scripts to handle specialized tasks.

4. Is Maxima difficult to learn and use?

Like any complex computer software, there is a learning curve when first using Maxima. However, its user-friendly interface and extensive documentation make it easier for beginners to get started. With practice, users can become proficient in the use of Maxima for their specific needs.

5. Can Maxima handle large datasets and complex calculations?

Yes, Maxima is designed to handle large datasets and complex calculations. It is capable of working with matrices, arrays, and other data structures, making it suitable for data analysis and manipulation. It also has powerful algorithms for symbolic computation, making it useful for solving intricate equations and performing advanced mathematical operations.

Similar threads

Replies
8
Views
5K
  • Programming and Computer Science
Replies
8
Views
1K
Replies
7
Views
649
  • Calculus and Beyond Homework Help
Replies
5
Views
5K
  • Introductory Physics Homework Help
Replies
3
Views
6K
  • Atomic and Condensed Matter
Replies
3
Views
877
  • Advanced Physics Homework Help
Replies
6
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
4K
  • Introductory Physics Homework Help
Replies
7
Views
1K
  • Advanced Physics Homework Help
Replies
2
Views
2K
Back
Top