## Prevent rearranging of term...

Dear Maple community,

I've added a label to one of my plot similar to . How can I prevent Maple from rearranging it to ? I think it might have something to do with typeset..?

Thank you very much for your support!

Claudio

## ordering of monomials...

Dear people in Mapleprimes,

I have a question about the ordering of monomials in a polynomial.

I hope you will help me understand how Maple works about it.

I inputed the polynomial as is written in black below.

Then, the outcome was blue, which ordering I could understand well: total degree ordering where at first

those who have the order of 6 are collected which are 14 x^3*y^3, 6x*y^5, and then the following was those which

have the order of 5: 21*x^5, -35 x^4*y, 9*x^3*y^2,-15*x^2*y^3, ... and so on.

And, among those who have the same order, lexical ordering was done, that is among 14 x^3*y^3, 6x*y^5, one which

came first was the one with the larger degree about x, and among 21*x^5, -35 x^4*y, 9*x^3*y^2,-15*x^2*y^3,

the first was 21*x^5, the second was -35*x^4*y, and so one, which was the ordering following the exponent about x.

And, then, I calculated Factor(polynomial) mod 7, which meaning I know.

Then, the result was 2*(x*y+2)*(3*y^3+x^2+3x*y)y.

I can understand the ordering among x*y and 2 in x*y+2, and that among 3y^3, x^2 and 3x*y in 3y^3+x^2*3x*y.

But, I can't understand why (x*y+2) comes at the first term, with 3 y^3+x^2+3x*y following it, and with y coming last.

This might be a trivial question. But, I hope you will teach me about this.

Best wishes.

taro

 (1)

 (2)

## how to find whether divisible with ordering for mu...

my code can only do for one variable,

how to make divisible checking for multivariable cases with the ordering such as plex

IsDivisible(LP(h, t), LP(g[i], t), x)

it is not only x when multivariable

f:=LP(y^2*x,plex(x, y))[2];
g:=LP(y*x-y,plex(x, y))[2];
Remainder(f, g, gcd(f,g));
degree(Remainder(f, g, x),x);
degree(g, x);

remainder has error expect its 3rd argument x, to be of type or but received y*x

how to do if have ordering

do it need to check whether both f and g have variable x using indets and then apply remainder?

do it need to check each variable starting from the first variable in the ordering?

how about if f has variable x but g do not have variable x, or f do not have variable x and g have variable x

if so, i try to replace below code in the bottom code, it has error

Error, (in FindDivisble) cannot determine if this expression is true or false: 0 < Search(x, {x, y})

FindDivisble := proc(g, h, t)
with(ListTools):
result := 0;
for i from 1 to nops(g) do
mainvariable := 0;
for j from 1 to nops(t) do
mainvariable := op(j, t);
if mainvariable <> 0 then
if Search(mainvariable, indets(h)) > 0 and Search(mainvariable, indets(g[i])) > 0 then
if IsDivisible(LP(h,t), LP(g[i],t), mainvariable) = 0 then
return i;
else
result := 0;
end if:
end if:
end if:
od:
od:
return result;
end proc:

with(Groebner):
LP := proc(f, t)
end proc:
IsDivisible := proc(f, g, x)
with(Algebraic):
if Remainder(f, g, x) = 0 or degree(Remainder(f, g, x),x) < degree(g, x) then
return 0;
else
return 1;
end if:
end proc:
FindDivisble := proc(g, h, t)
result := 0;
for i from 1 to nops(g) do
if IsDivisible(LP(h, t), LP(g[i], t), x) = 0 then
return i;
else
result := 0;
end if:
od:
return result;
end proc:
MD := proc(f, g, t)
r := 0;
u := Matrix(nops(g), 1);
for j from 1 to nops(g) do
u[j] := 0;
od:
h := f;
while h <> 0 do
i := FindDivisble(g, h, t);
if i > 0 then
u[i] := u[i] + LeadingTerm(h, t)/LeadingTerm(f[i], t);
h := h - LeadingTerm(h, t)/LeadingTerm(f[i], t)*f[i];
else
r := r + LeadingTerm(h, t);
h := h - LeadingTerm(h, t);
end if:
od:
end proc:
f:=y^2*x;
f1 := y*x-y;
f2 := y^2-x;
MD(f,[f1,f2],plex(x, y));

## Minimization Process...

Hi all

I have the following segment of maple program which belongs to time delay systems dynamic. here C=X-X0-G.Z-X.Dtau.P+X.Dtau.Z-U.P, is a matrix(vector) which comes from reordering the system terms and my goal is to minimizing J:=X.E.Transpose(X)+U.E.Transpose(U), subject to constraint C=0, but i don't know how to do so.

I will be so grateful if anyone can guide me

best wishes

Ph.D Candidate

Applied Mathematics Department

 > restart: with(Optimization): with(LinearAlgebra): macro(LA= LinearAlgebra): L:=1:  r:=2:  tau:= 1: interface(rtablesize= 2*r+1): Z:= Matrix(      2*r+1, 2*r+1,      [tau,       seq(evalf((L/(2*(iz-1)*Pi))*sin(2*(iz-1)*Pi*tau/L)), iz= 2..r+1),       seq(evalf((L/(2*(iz-1-r)*Pi))*(1-cos(2*(iz-1-r)*Pi*tau/L))), iz= r+2..2*r+1)       ],      scan= columns,      datatype= float[8] );                          Dtau00:= < 1 >: Dtau01:= Vector[row](r): Dtau02:= Vector[row](r): Dtau10:= Vector(r): Dtau20:= Vector(r): Dtau1:= LA:-DiagonalMatrix([seq(evalf(cos(2*i*Pi*tau/L)), i= 1..r)]): Dtau2:= LA:-DiagonalMatrix([seq(evalf(sin(2*i*Pi*tau/L)), i= 1..r)]): Dtau3:= -Dtau2: Dtau4:= copy(Dtau1): Dtau:= < < Dtau00 | Dtau01 | Dtau02 >,          < Dtau10 | Dtau1  | Dtau2  >,          < Dtau20 | Dtau3  | Dtau4  > >;   P00:= < L/2 >: P01:= Vector[row](r): P02:= Vector[row](r, j-> evalf(-L/j/Pi), datatype= float[8]): P10:= Vector(r): P20:= Vector(r, i-> evalf(L/2/i/Pi)): P1:= Matrix(r,r): P2:= LA:-DiagonalMatrix(P20): P3:= LA:-DiagonalMatrix(-P20): P4:= Matrix(r,r): P:= < < P00 | P01 | P02 >,       < P10 | P1  | P2  >,       < P20 | P3  | P4  > >; interface(rtablesize=2*r+1):    # optionally J:=Vector([L, L/2 \$ 2*r]):      # Matrix([[...]]) would also work here E:=DiagonalMatrix(J); X:=  Vector[row](2*r+1,symbol=a); U:=Vector[row](2*r+1,symbol=b); X0:= Vector[row](2*r+1,[1]); G:=Vector[row](2*r+1,[1]); C:=simplify(X-X0-G.Z-X.Dtau.P+X.Dtau.Z-U.P);
 (1)
 > J:=X.E.Transpose(X)+U.E.Transpose(U);
 (2)
 > Minimize(J,{C=0});
 Error, (in Optimization:-NLPSolve) invalid arguments
 > #XP:=-.015+X[1]+add(X[l+1]*f1(l)+X[r+l+1]*f2(l), l= 1..r): #plot([XP,T1], t= 0..1);#,legend= "Solution Of x(t) with r=50"):
 >
 >
 >
 >

## How to respect Fortran column-major ordering with ...

Hello!

I am trying to create a Fortran routine that creates and populates a large 2D array, using Maple's codegen or CodeGeneration capabilities. I would like Maple to create the Fortran code so that the column-major ordering is respected: I would like Maple to populate mat(1,1), mat(2,1), mat(n,1) before moving on to mat(1,2)... Unfortunately, codegen and CodeGeneration seem to only produce row-major code.

Any idea on how to proceed, or an option of the code generation that I would have missed?

Thanks for your help!

Etienne

## Mapleprimes wish list

Stop ordering posts by votes! ... For two reasons.

1 - Someone who comes up with the idea first should be ordered as such.

2 - Conversations can get mixed up

**edit change** I have changed the title from Stop ordering posts by votes to Mapleprimes wish list.

## powerset ordering...

Hello! I am running the same piece of maple code on different machines, and I have noticed that the powerset function returns the sets in a different order. For example,

Maple 11 (X86 64 LINUX)

> powerset(3);
{{}, {1, 2, 3}, {2, 3}, {3}, {1, 3}, {1}, {2}, {1, 2}}

Maple 14

> powerset(3);
{{}, {1}, {2},...

## Ordering of Eigenvalues...

I have a 6x6 matrix that depends on 8 parameters, M(F) (F is an 8-dim array, say...), and I want to compute the eigenvalues of this matrix both at a fixed point F_0 and at some other arbitrary point F'. The problem is that I need to make sure the ordering of the Eigenvalues remains the same at these two points, so that if I'd go continuously from F_0 to F' the eigenvalues would go continuously from Eigenvalues(M(F_0)) to Eigenvalues(M(F')), without any flip in the order of the entries.

## My problem with "set"...

Hi,

I have those questions:

1) set

When I write these inputs,

x:={1,3,2}; y:={b,a,d,c}; z:={a[1],a[1,1],b[0],d[0],c[0],a[0],2};

the results are x := {1, 2, 3}, y := {a, b, c, d}, z := {2, a[0], a[1], a[1,1], b[0], c[0], d[0]}

Is there a way to get what I input

2) This problem in ordering numbers and words is verry important and hard when solving a large system of equations with:

restart:with(SolveTools): eqns:=[a[0...

## session dependent results

by: Maple

Perhaps you have heard the terms "ordering difference" or "session dependent" applied to results of some Maple computation. It used to get heard more often back before Maple 12, when elements of sets in Maple were ordered according to address.

## set ordering change

by: Maple

The following type of difference in behaviour, due to deterministic ordering of sets as introduced in Maple 12, may affect implementations of some algorithms.

```    |\^/|     Maple 11 (X86 64 LINUX)
._|\|   |/|_. Copyright (c) Maplesoft, a division of Waterloo Maple Inc. 2007