Yo

25 Reputation

0 Badges

0 years, 140 days

MaplePrimes Activity


These are questions asked by Yo

Hi everyone,
Could you tell me please if I have a polynomial vector of combinations x[i] x[j] (huge), how to recover the homogenuous part of some degree d ? and how to get a vector of coeficients of each combination of that vector please ?
In the following a simple example, 
V:=Vector[column](2, [3*x[1]^4*x[2]^2 + 7*x[1]^3*x[2]^3 + 6*x[1]^2*x[2]^4 + 7*xi[1]*xi[2]^5 + 65*xi[1]^3 + 76*xi[1]^2*xi[2] + 56*xi[1]^2*xi[3], 13*x[1]^6 - 7*x[1]^5*x[2] + 30*x[1]^4*x[2]^2 + 75*x[1]^3*x[2]^3 + 130*x[1]^2*x[2]^4 + 54*xi[1]*xi[2]^5 + 43*xi[2]^6 + xi[2]^2*xi[3] + 76*xi[2]^2*xi[4] + 43*xi[2]*xi[3]^2]); 
The homogenuous part of degree 3 is then 
Vector[column](2, [65*xi[1]^3 + 76*xi[1]^2*xi[2] + 56*xi[1]^2*xi[3], xi[2]^2*xi[3] + 76*xi[2]^2*xi[4] + 43*xi[2]*xi[3]^2]).h

thanks in advance,
Best regards

Hi everyone, 

I have two expressions given by:

A := -sqrt(m(p[1](t))/m(q[1](t)))*p[2](t) - l[1]*q[1](t) + l[1]*p[1](t) + q[2](t);

B := -(-sqrt(m(p[1](t))/m(q[1](t))^3)*C(p[1](t))*m(q[1](t))^(3/2)*p[2](t)^2*m(p[1](t)) + C(p[1](t))*p[2](t)^3*m(q[1](t))^(3/2)*sqrt(m(p[1](t))/m(q[1](t))) - l[1]*p[2](t)^2*C(p[1](t))*(p[1](t) - q[1](t))*m(q[1](t))^(3/2) - sqrt(m(q[1](t)))*l[2]*(p[1](t) - q[1](t))*m(p[1](t))^(3/2) + m(p[1](t))*l[1]*p[2](t)*C(p[1](t))*(p[1](t) - q[1](t))*sqrt(m(q[1](t))) - C(q[1](t))*q[2](t)^2*sqrt(m(p[1](t)))*m(q[1](t))*(q[2](t) - 1))/(sqrt(m(p[1](t)))*m(q[1](t))^(3/2));

I would like to rewrite these two expressions according to a and b (replace in A and B each: q[1](t) - p[1](t)  by a and   sqrt(m(q[1](t)))*q[2](t) - sqrt(m(p[1](t)))*p[2](t) by ), such that : 

a := q[1](t) - p[1](t);
b := sqrt(m(q[1](t)))*q[2](t) - sqrt(m(p[1](t)))*p[2](t);
 
I used subs and collect but doesn’t work.

Could you help me please ? 

I would like to thank you in advance.

Best regards,

Hi everyone,

In some step of my code, I need to solve the following equation: M = Id, where, M is a square matrix of dimension n and each element of this matrix M is an expression with parameters. Id, is the identity matrix.

Could you please tell me how to solve such a matrix equation M = Id, whatever n ?

Example: i would like to solve M=Id, where M is given by:
M:=Matrix(3, 3, [[-1/3*a + b + c - 2*d, -1/4*a + 2/3*c, 1/15*a - 1/4*c + 2/3*d], [e + a - 2*c, 2/3*a, -1/4*a + 2/3*c], [f - 2*a, 0, 2/3*a]]);
Id:=IdentityMatrix(3);

Thanks in advance,
Best regards

Is there 

Hello everybody,

In my code, i would like to create a square matrix M of dimension 'a' (which is a ColumnDimension of an imput matrix A):
Otherwise, i have an expression ('EXPR') on alpha[i](x) and beta[i](x), i=1..b, (where b is a ColumnDimension of an imput matrix B).
The matrix M that i want to get must be M:=(EXPR(alpha[i],beta[j])),i,j=1..a, evaluated for particular alpha[i](x) and beta[j](x) wich are stored in A and B respectively.

Below, is the code that i write: 

Test := proc(A, B,EXPR)
local a, b, M, i, j, k;
a := LinearAlgebra['ColumnDimension'](A);
b := LinearAlgebra['ColumnDimension'](B);
M := Matrix(a);
for i to a do for j to a do
if evalb(i = j) then
M[i, j] := M[i, j] + eval(EXPR, {seq(alpha[k] = (t -> eval(A[k, i], x = t)), k = 1 .. b), seq(beta[k] = (t -> eval(B[j, k], x = t)), k = 1 .. b)}); else
if evalb(i < j) then
M[i, j] := M[i, j] + eval(EXPR, {seq(alpha[k] = (t -> eval(A[k, j], x = t)), k = 1 .. b), seq(beta[k] = (t -> eval(B[i,K], x = t)), k = 1 .. b)}); else
M[i, j] := M[i, j] + eval(EXPR, {seq(alpha[k] = (t -> eval(A[k, j], x = t)), k = 1 .. b), seq(beta[k] = (t -> eval(B[i, k], x = t)), k = 1 .. b)}); end if;
end if;
end do;
end do;
return M;
end proc:

I tested the program for A, B and EXPR given by: 
A := Matrix(2, 3, [[4, x, 1/4*x^2], [2, 3, x]]);
B := Matrix(3, 2, [[3, 5], [x, 2], [1/2*x^2, -x]]);
EXPR := alpha[1](1/2)*beta[1](1/2) + int(alpha[1](x + 1/2)*beta[2](1/2*x), x = -1/2 .. 1/2) + alpha[2](1/2)*beta[2](1/2);

Maple returns the following:  Error, (in anonymous procedure called from Test) bad index into Matrix.
I understood that the problem comes from the k that I wrote in bold in the code.
I would like to evaluate the EXPR for alpha[k]:=A[k, i] and beta[k]:=B[j,k] , but I don't really know how to interpret this for maple.

Could you help me please ?
Do you have an idea ?

Best regards,

Dear all,

In some step of my program, Maple cannot understand that the two following vectors are equal:

V1 := Vector[column](8, [1, 2, 2, 1, 3, A, B, 1/(A + B)^2]);

V2 := Vector[column](8, [1, 2, 2, 1, 3, A, B, 1/(A^2 + 2*A*B + B^2)]);

I tried to use the following two commands:

LinearAlgebra:-Equal(V1[6 .. 8], V2[6 .. 8]);

verify(V1, V2, 'Vector(expand)');

but Maple still returns 'false' instead of 'true'

Could somebody help me please ?
Best regards,

1 2 Page 1 of 2