Aurel Page on Fri, 06 Jan 2023 15:34:47 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Solve an non-homogeneous system of equations mod Z.


On 06/01/2023 15:15, Hongyi Zhao wrote:
I also tried the following, but still failed:

? mat1 = [ -210, -210, -220; -221, -222, -232; 410, 411, 430 ]
%8 =
[-210 -210 -220]

[-221 -222 -232]

[ 410  411  430]

? vec1 = [ -27, -28, 105/2 ]
%9 = [-27, -28, 105/2]

? matsolvemod(mat1,[1,1,1],vec1~,1)
   ***   at top-level: matsolvemod(mat1,[1,1,1],vec1~,1)
   ***                 ^---------------------------------
   *** matsolvemod: incorrect type in matsolvemod (D) (t_VEC).
   ***   Break loop: type 'break' to go back to GP prompt

   vec1 should be a column, either use

vec1 = [ -27, -28, 105/2 ]~

   or

vec1 = Col([ -27, -28, 105/2 ])
Thank you for your correction.

    (same thing for [1,1,1]). Additionally, vec1 has non integral entries, and
   it is not permissible for matsolvemod.
But in my case, I must tackle non-integral entries, as you've seen. Is
there no way to solve the problem?
Your equation is linear, multiply everything by the denominator!

Best,
Aurel