## 30 Reputation

1 years, 184 days

## how to get homogeneous part of some degr...

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^4*x^2 + 7*x^3*x^3 + 6*x^2*x^4 + 7*xi*xi^5 + 65*xi^3 + 76*xi^2*xi + 56*xi^2*xi, 13*x^6 - 7*x^5*x + 30*x^4*x^2 + 75*x^3*x^3 + 130*x^2*x^4 + 54*xi*xi^5 + 43*xi^6 + xi^2*xi + 76*xi^2*xi + 43*xi*xi^2]);
The homogenuous part of degree 3 is then
Vector[column](2, [65*xi^3 + 76*xi^2*xi + 56*xi^2*xi, xi^2*xi + 76*xi^2*xi + 43*xi*xi^2]).h

Best regards

## How to subs/ collect expressions ?...

Maple

Hi everyone,

I have two expressions given by:

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

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

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

a := q(t) - p(t);
b := sqrt(m(q(t)))*q(t) - sqrt(m(p(t)))*p(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,

## How to solve Matrix equation ?...

Maple

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);

Best regards

Is there

## How to evaluate an expression using the ...

Maple

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/2)*beta(1/2) + int(alpha(x + 1/2)*beta(1/2*x), x = -1/2 .. 1/2) + alpha(1/2)*beta(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,

## How to verify if two vectors (with param...

Maple 2020

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
﻿