Jef7823

15 Reputation

3 Badges

1 years, 128 days

MaplePrimes Activity


These are questions asked by Jef7823


Hello everyone, I am working on a Maple code where I am dealing with a matrix X and performing several operations, so I can subsitute a set of lists. However, I feel Im doing some redundant things and I wonder if there are ways to make it more concise and efficient. More specifically,

  1. 'vals' and 'ecs' :
    'vals' gives me a set of lists with the values I'll use in matrix X , e.g., vals := {[-1, 1, 0], [0, -1, -1], [0, -1, 1]}.
    'ecs' creates a set of lists of equations that I can use in 'eval' (or 'subs') function, e.g., ecs := {[[X3_4 = -1, X3_3 = 1, X2_3 = 0]], [[X3_4 = 0, X3_3 = -1, X2_3 = -1]], [[X3_4 = 0, X3_3 = -1, X2_3 = 1]]}.
    But clearly, I'm getting an extra pair of brackets for each list so I will need to use double index in the eval command. Is there a way to avoid this?
  2. In the subsitution step, I've tried with both 'eval' and 'subs' and many modifications to avoid what I did in step 1 but without success. Also I need this extra 'Nelem' to get a list of indices so I can substitute all possible lists of values in 'ecs'.
  3. Finally, I'm wondering if what I'm getting from 'BoolEigs' is actually what I want. My final goal is to check if the eigenvalues of all possible solution matrices I got in 'Xs'  are nonnegative. So I need to avoid numerical computations and perform this step exactly. Is my code correct for this?
     
X := Matrix([[1, -X3_3/2 - 1/2, 0, -X2_3], [-X3_3/2 - 1/2, -2*X3_4 - 1, X2_3, 0], [0, X2_3, X3_3, X3_4], [-X2_3, 0, X3_4, 1]]);
vars := [X3_4, X3_3, X2_3];

w := A^3 - A;
rootz := RootOf(w, A);
Pols := [(-A^2 + 1)/(3*A^2 - 1), (-A^2 - 1)/(3*A^2 - 1), A*(3*A^2 - 1)*1/(3*A^2 - 1)];

vals := {allvalues(eval(Pols, A = rootz))};
ecs := map(x -> convert(vars = x, listofequations), vals);

Nelem := [seq(k, k = 1 .. numelems(vals))];
Xs := map(x -> eval(X, ecs[x][1]), Nelem);#double index for eval
Xz := map(x -> subs(ecs[x][1], X), Nelem);#same for subs

with(LinearAlgebra);
Eigs := map(x -> Eigenvalues(x), Xs);
BoolEigs := map(x -> map(y -> is(Im(y) = 0) and is(0 <= Re(evalf(y))), x), Eigs);
evalf(Eigs);

Hello. I am trying to solve the following polynomial system. Maple solution is empty but when I add the polynomial X4_4-2^(1/2)/10 to the list then maple gives me a set of solutions. What could I be doing wrong?

with(SolveTools):
F:=[
10*X4_4 + Y1_1,
10*X4_4*Y1_1 + 2,
20*X4_4*Y3_1,
2*Y3_1,
10*X4_4*Y1_2,
20*X4_4*Y3_2 + 2,
10*X4_4 + 2*Y3_2,
4*L2 - 7*L1 + 5*L3 - 6*L4 + 5*L5 + 9*L6 - 6*L7 - 1,
L1 + 10*L2*X4_4,
10*L5*X4_4,
2*L4 + 20*L3*X4_4,
2*L7 + 20*L6*X4_4
]:
V:=[X4_4, Y1_1, Y1_2, Y3_1, Y3_2, L1, L2, L3, L4, L5, L6, L7]:

Sols := PolynomialSystem(F, V);

Page 1 of 1