Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
Hello, Everyone.
Is it possible to solve M matrix, the above ?
Thanks in advance for your time and help.
Regards.
Solved! Go to Solution.
One can get quite far though:
It's just that the inequality constraint (involving M01 and M03) is not obeyed. Note that I first tried:
But then I got an error message saying it's not allowed inside a solve block.
Luc
At first glance: no
Reason: your system is over-constrained. You have 16 variables to find, you can have only 16 constraints.
The requirement of a magic square (sums of all 4 rows and of all 4 columns and along the 2 main diagonals must be equal) already gives you at least 4+4+2-1=9 constraints. Now you've added 16 more constraints, totalling 25.
Another constraint from the magic square is that all your variables must be different AND in the range 1 through 16.
Success!
Luc
Apart from what Luc already wrote you would have to constraint the matrix elements to be integers - something which Mathcad is not really good at.
So I guess the better option to get a magic square is to write a program following one of the algorithms to build a magic square. There a quite some in print, ususally differing according to the magnitude of the sqare, distinguishing odd or even order and as far as I remember ther is a short algorithm dealing with squares of a mgnitude which is divisable by 4.
What exactly ist the problem you should solve for homework?
WE
One can get quite far though:
It's just that the inequality constraint (involving M01 and M03) is not obeyed. Note that I first tried:
But then I got an error message saying it's not allowed inside a solve block.
Luc
Thanks for your time and help, Werner and Luc.
I have just realized my question at the moment about : Pandiagonal magic square - Wikipedia, the free encyclopedia
Is it possible to solve COMPLETE MAGIC SQUARE, and How many solution in this case ?
Best Regards.
Loi.
How many solution else for COMPLETE MAGIC SQUARE does it have in this case ?
Thanks in advance.
Regards.
Loi.