227 Reputation

7 years, 305 days

NormalForm command...

@Carl Love  In the following procedeure F is a list of polynomials, f is a polynomial, R is a monomial ordering on parameters, T is a monomial ordering on variables and N is null set.

Since, F and f are homogeneous and linear and also F is a Grobner basis we can use from NormalForm command for checking linearly dependent.

ExtPolyLinear := proc (F, f, R, T, N)

local nf, nfp, L, nf1;

nf1 := Groebner:-NormalForm(f, F, T, 'Q');

nf := numer(nf1);

nfp := Groebner:-NormalForm(nf, N, R, 'K');

L := subs(seq(N[i] = 0, i = 1 .. nops(N)), Q);

if nfp = 0 then

RETURN(true, L)

else

RETURN(false, [])

end if

end proc;

Example:

ExtPolyLinear([a*A1+b*A3, c*A2+d*A3], e*A1+h*A2,plex(a,b,c,d,e,h), plex(A1,A2,A3, A4, A5), [h, e]);
true, [0, 0]

ExtPolyLinear([a*A1+b*A3, c*A2+d*A3], e*A1+h*A2, plex(a, b, c, d, e, h), plex(A1, A2, A3, A4, A5), []);
false, []
ExtPolyLinear([a*A1+b*A3,c*A2+d*A3],e*A1+h*A2,plex(a,b,c,d,e,h),plex(A1, A2, A3, A4, A5), [e*c*b+h*d*a]);

@Carl Love now I am presenting an i...

@Carl Love now I am presenting an implementation for the answer my question without using eliminate command and then posted it!

An example...

@Carl Love Please consider the following example:

The null set is {h, b*d} and the notnull set is {a,c,e}. Therefore F=[cA4,caA2] and f=eA2 w.r.t. these two sets where shows that f is linearly dependent of F, But the output of your implementation is false. What is your idea?

@Carl Love Thank you for this draft. Wha...

@Carl Love Thank you for this draft. What is your idea about adding "W[i]-1" to the set  {coeffs(expand(`+`((C*~F)[]) - f), V)} to effectively utilize the NotNull conditions? Since, the elements of W are nonzero we can set all of them equal 1. What is your idea?

@Carl Love Now I want to test linearly dependence by additional condition for linear parametric polynomial (linear for variables not parameters).

For example let

and

(a,b,c,d,e,h are parameters and A1,A2,A3 are variables).

If I use PolyLinearCombo(F,f,{A1,A2,A3}) then its output is false,[].

Now we let to condition sets for parameters as the following:

N:=[ebc+ahd]

W:=[a,c]

The elements of N must be zero means that ebc+ahd=0

and the elements of W are non-zero that is a<>0 and c <>0.

Let a=b=c=d=h=1 and e=-1. This specialization satisfy in the above condition sets. By this specialization we have:

and

Now if I use PolyLinearCombo(F,f,{A1,A2,A3}) then its output is true,[-1,1].

By this additional two condition sets I have to check that whether f is linearly independent of F or not. How can I do this without specialization? In fact I want an algorithm that its input is (null condition, not-null condition, list of polynomials F, a polynomial f, the set of variables) and its output is true and coefficients if f is linearly dependent of F w.r.t. null and not-null conditions, else its output is false.

If the name of new procedure is ExtPolyLinearCombo and

N:=[ebc+ahd]

W:=[a,c]

I want the output of

ExtPolyLinearCombo(N,W,F,f,{A1,A2,A3}) be true,[coefficients]

Thank you very much in advance.

@Dmitry Lyakhov  You can use double...

You can use double sequences for your purpose. This is faster from loop for. See the following example:

> A := [1, 2, 3]; B := [a, b, c];

> seq(seq({A[i], B[j]}, j = 1 .. nops(B)), i = 1 .. nops(A));

{1, a}, {1, b}, {1, c}, {2, a}, {2, b}, {2, c}, {3, a}, {3, b}, {3, c}

@Carl Love Yes it is good for some examp...

@Carl Love Yes it is good for some example so far.

@Carl Love I think it is better that in ...

@Carl Love I think it is better that in Homogenize procedure you remove V from its input and set V=[op(T)] at inside the procedure. What is your idea?

@Carl Love I need both f and F in m...

@Carl Love I need both f and F in my main procedure. It is possible that the monomials appears in F are different by monomial in f. In fact the input of this algorithm are (f , F , a monomial ordering) and its output is homogeneous ff and FF.

@MDD Consider the following example: it...

@MDD Consider the following example:

its output is:

Also we know that its output can be "true,[a,0,0]". This example shows that in your implementation the coefficients are not uniqe. I think this happened since the polynomials

are linearly dependent. I deduce that when the list of polynomials be linearly independent then the coefficients are uniqe. What is your idea about this example and my statements?

@Carl Love This is complete now. Thank y...

@Carl Love This is complete now. Thank you so much for your implementation.

@Carl Love Consider the following exampl...

@Carl Love Consider the following examples, too:

In the above examples \$a\$ is a nonzero parameter and the outputs must be true but both outputs are false.

@Carl Love I think that there is a minor...

@Carl Love I think that there is a minor error in your procedure, Please run the following example:

Could you please remove this error? If the polynomial is zero then it is not a problem. Please set the output true with zero coefficients.

@Carl Love This is very complete and I h...

@Carl Love This is very complete and I have to say thank you so much. I know implementation of some computer algebra algorithms but your implementation is very professional.

@Carl Love Thank you so much. I know the...

@Carl Love Thank you so much. I know these command! I want to know in general the way of your implementation. Thank you so much.

 5 6 7 8 9 Page 7 of 9
﻿