Maple 15 Questions and Posts

These are Posts and Questions associated with the product, Maple 15
 
While solving a math problem, one has to deal with a system of 25 linear equations with a parameter s (Laplace transform variable). i tried formulating the system in a matrix form using GenerateMatrix and inverting the system using solve with LU or QR method but without success. i attach a minimal working environment for the system of equations at hand. Any help or advice is highly appreciated – thank you!
 

Is there a way to make a library file that automatically has the functions/procedures loaded on startup and after it any new or open ".mw" can use functions/procedures from library with no redefinition?

Dear Users!
First, I define the following polynomial as:

restart; with(LinearAlgebra); nu := 1/2; M1 := 3; M2 := 3; #(any value of M1 and M2)
for k1 from 0 while k1 <= M1-1 do for k2 from 0 while k2 <= M2-1 do
SGP[M2*k1+k2+1] := simplify(sum((-1)^(k1-i1)*GAMMA(k1+i1+2*nu)*GAMMA(nu+1/2)*x^i1*(sum((-1)^(k2-i2)*GAMMA(k2+i2+2*nu)*GAMMA(nu+1/2)*t^i2/(GAMMA(i2+nu+1/2)*factorial(k2-i2)*factorial(i2)*GAMMA(2*nu)), i2 = 0 .. k2))/(GAMMA(i1+nu+1/2)*factorial(k1-i1)*factorial(i1)*GAMMA(2*nu)), i1 = 0 .. k1))
end do end do;
Lambda := `<,>`(seq(SGP[i], i = 1 .. M1*M2));

then, I want to define a square matrix A of order M1M2 by M1M2 after collocating SGP[k](x,y) at x=(i-1)/(M1-1) and y=(j-1)/(M2-1) for i=1,2,3,...M1, j=1,2,3,...M2.

For example, for M1=2 and M3=3 this matrix A is given as:

A:=Matrix(6, 6, {(1, 1) = SGP[1](0, 0), (1, 2) = SGP[2](0, 0), (1, 3) = SGP[3](0, 0), (1, 4) = SGP[4](0, 0), (1, 5) = SGP[5](0, 0), (1, 6) = SGP[6](0, 0), (2, 1) = SGP[1](0, 1), (2, 2) = SGP[2](0, 1), (2, 3) = SGP[3](0, 1), (2, 4) = SGP[4](0, 1), (2, 5) = SGP[5](0, 1), (2, 6) = SGP[6](0, 1), (3, 1) = SGP[1](1/2, 0), (3, 2) = SGP[2](1/2, 0), (3, 3) = SGP[3](1/2, 0), (3, 4) = SGP[4](1/2, 0), (3, 5) = SGP[5](1/2, 0), (3, 6) = SGP[6](1/2, 0), (4, 1) = SGP[1](1/2, 1), (4, 2) = SGP[2](1/2, 1), (4, 3) = SGP[3](1/2, 1), (4, 4) = SGP[4](1/2, 1), (4, 5) = SGP[5](1/2, 1), (4, 6) = SGP[6](1/2, 1), (5, 1) = SGP[1](1, 0), (5, 2) = SGP[2](1, 0), (5, 3) = SGP[3](1, 0), (5, 4) = SGP[4](1, 0), (5, 5) = SGP[5](1, 0), (5, 6) = SGP[6](1, 0), (6, 1) = SGP[1](1, 1), (6, 2) = SGP[2](1, 1), (6, 3) = SGP[3](1, 1), (6, 4) = SGP[4](1, 1), (6, 5) = SGP[5](1, 1), (6, 6) = SGP[6](1, 1)});

for M1=3 and M=2 the matrix A is given as:

A:=Matrix(6, 6, {(1, 1) = SGP[1](0, 0), (1, 2) = SGP[2](0, 0), (1, 3) = SGP[3](0, 0), (1, 4) = SGP[4](0, 0), (1, 5) = SGP[5](0, 0), (1, 6) = SGP[6](0, 0), (2, 1) = SGP[1](0, 1/2), (2, 2) = SGP[2](0, 1/2), (2, 3) = SGP[3](0, 1/2), (2, 4) = SGP[4](0, 1/2), (2, 5) = SGP[5](0, 1/2), (2, 6) = SGP[6](0, 1/2), (3, 1) = SGP[1](0, 1), (3, 2) = SGP[2](0, 1), (3, 3) = SGP[3](0, 1), (3, 4) = SGP[4](0, 1), (3, 5) = SGP[5](0, 1), (3, 6) = SGP[6](0, 1), (4, 1) = SGP[1](1, 0), (4, 2) = SGP[2](1, 0), (4, 3) = SGP[3](1, 0), (4, 4) = SGP[4](1, 0), (4, 5) = SGP[5](1, 0), (4, 6) = SGP[6](1, 0), (5, 1) = SGP[1](1, 1/2), (5, 2) = SGP[2](1, 1/2), (5, 3) = SGP[3](1, 1/2), (5, 4) = SGP[4](1, 1/2), (5, 5) = SGP[5](1, 1/2), (5, 6) = SGP[6](1, 1/2), (6, 1) = SGP[1](1, 1), (6, 2) = SGP[2](1, 1), (6, 3) = SGP[3](1, 1), (6, 4) = SGP[4](1, 1), (6, 5) = SGP[5](1, 1), (6, 6) = SGP[6](1, 1)});

and for M1=M2=3 the matrix A should be the following form:

A:=Matrix(9, 9, {(1, 1) = SGP[1](0, 0), (1, 2) = SGP[2](0, 0), (1, 3) = SGP[3](0, 0), (1, 4) = SGP[4](0, 0), (1, 5) = SGP[5](0, 0), (1, 6) = SGP[6](0, 0), (1, 7) = SGP[7](0, 0), (1, 8) = SGP[8](0, 0), (1, 9) = SGP[9](0, 0), (2, 1) = SGP[1](0, 1/2), (2, 2) = SGP[2](0, 1/2), (2, 3) = SGP[3](0, 1/2), (2, 4) = SGP[4](0, 1/2), (2, 5) = SGP[5](0, 1/2), (2, 6) = SGP[6](0, 1/2), (2, 7) = SGP[7](0, 1/2), (2, 8) = SGP[8](0, 1/2), (2, 9) = SGP[9](0, 1/2), (3, 1) = SGP[1](0, 1), (3, 2) = SGP[2](0, 1), (3, 3) = SGP[3](0, 1), (3, 4) = SGP[4](0, 1), (3, 5) = SGP[5](0, 1), (3, 6) = SGP[6](0, 1), (3, 7) = SGP[7](0, 1), (3, 8) = SGP[8](0, 1), (3, 9) = SGP[9](0, 1), (4, 1) = SGP[1](1/2, 0), (4, 2) = SGP[2](1/2, 0), (4, 3) = SGP[3](1/2, 0), (4, 4) = SGP[4](1/2, 0), (4, 5) = SGP[5](1/2, 0), (4, 6) = SGP[6](1/2, 0), (4, 7) = SGP[7](1/2, 0), (4, 8) = SGP[8](1/2, 0), (4, 9) = SGP[9](1/2, 0), (5, 1) = SGP[1](1/2, 1/2), (5, 2) = SGP[2](1/2, 1/2), (5, 3) = SGP[3](1/2, 1/2), (5, 4) = SGP[4](1/2, 1/2), (5, 5) = SGP[5](1/2, 1/2), (5, 6) = SGP[6](1/2, 1/2), (5, 7) = SGP[7](1/2, 1/2), (5, 8) = SGP[8](1/2, 1/2), (5, 9) = SGP[9](1/2, 1/2), (6, 1) = SGP[1](1/2, 1), (6, 2) = SGP[2](1/2, 1), (6, 3) = SGP[3](1/2, 1), (6, 4) = SGP[4](1/2, 1), (6, 5) = SGP[5](1/2, 1), (6, 6) = SGP[6](1/2, 1), (6, 7) = SGP[7](1/2, 1), (6, 8) = SGP[8](1/2, 1), (6, 9) = SGP[9](1/2, 1), (7, 1) = SGP[1](1, 0), (7, 2) = SGP[2](1, 0), (7, 3) = SGP[3](1, 0), (7, 4) = SGP[4](1, 0), (7, 5) = SGP[5](1, 0), (7, 6) = SGP[6](1, 0), (7, 7) = SGP[7](1, 0), (7, 8) = SGP[8](1, 0), (7, 9) = SGP[9](1, 0), (8, 1) = SGP[1](1, 1/2), (8, 2) = SGP[2](1, 1/2), (8, 3) = SGP[3](1, 1/2), (8, 4) = SGP[4](1, 1/2), (8, 5) = SGP[5](1, 1/2), (8, 6) = SGP[6](1, 1/2), (8, 7) = SGP[7](1, 1/2), (8, 8) = SGP[8](1, 1/2), (8, 9) = SGP[9](1, 1/2), (9, 1) = SGP[1](1, 1), (9, 2) = SGP[2](1, 1), (9, 3) = SGP[3](1, 1), (9, 4) = SGP[4](1, 1), (9, 5) = SGP[5](1, 1), (9, 6) = SGP[6](1, 1), (9, 7) = SGP[7](1, 1), (9, 8) = SGP[8](1, 1), (9, 9) = SGP[9](1, 1)});

Please help to define general matrix A for any values of M1 and M2. I will be very grateful for you. 

 

Let L=[a1,a2,...,an] be a list of positive real numbers. 

My Question:

How to write a procedure to find a minimal interval such as [b,c] 

provided that this interval covers entries of L which are close together. 

Example: 

let L:=[8.1 , 2.03 , 3.5 , 0.05 , 4.1]. Then the output of the procedure is the interval [2.03 , 4.1].

In fact we want to eliminate some entries of L that are not close to other entries of L.

Thanks in advance

Hello everybody,

i am trying to use PDEchangecoords to transform a system of differential equations from Cartesian coordinates to toroidal coordinates. However, when i use a user defined coordinate transform from toroidal to Cartesian, i don't get the initial equations. Please find attached a minimal working environment.

i would highly appreciate your hints and suggestions!

Thank you

Best regards,

F

question.mw
 

NULL

NULL

NULL

restart; with(DEtools); addcoords(invToroidal, [xi, eta, phi], [sinh(xi)*cos(phi)/(cosh(xi)-cos(eta)), sinh(xi)*sin(phi)/(cosh(xi)-cos(eta)), sin(eta)/(cosh(xi)-cos(eta))]); PDEchangecoords(diff(f(x, y, z), z), [x, y, z], toroidal, [xi, eta, phi]); PDEchangecoords(%, [xi, eta, phi], invToroidal, [x, y, z]); print("i would expect here to get", diff(f(x, y, z), z))

"i would expect here to get", diff(f(x, y, z), z)

(1)

NULL


 

Download question.mw

 

I read the article "ONEOptimal: A Maple Package for Generating One-Dimensional Optimal System of Finite Dimensional Lie Algebra", and also searched out in Maplesoft website, but couldn't found. Does anyone have the package?

 

# I solved the differential equation using a fourier series decomposting method. I found with the help of "Dsolve" the different expressions of the fourier constants and now I will apply the boundary conditions to find the expressions of its constants.

#this my boundary conditions

#this my system of equations

I have question how start histogram from 0? I have vector with probablity which start from 0.

I generate samples from my probablity:

pr=values of probablity

X:=RandomVariable(ProbablityTable(pr)):

A=Sample(X,1000):

Q=Histogram(A, binwidth=1,range=0..10):

...

I try to use bindwidth=-1 but it's impossible. 

How start histogram from 0 for vectors in maple15?

Cannot find integration proplem_in_maple.mw

restart

with(LinearAlgebra)

with(orthopoly)

``

with(student)

Digits := 32

32

(1)

interface(rtablesize = 100)

10

(2)

a := 0; b := 1; N := 5; h := (b-a)/N; B[0] := 1; B[1] := x; n := 2; B[2] := x^2+2; alpha := 1/2

0

 

1

 

5

 

1/5

 

1

 

x

 

2

 

x^2+2

 

1/2

(3)

NULL

for j from 3 to N do B[j] := expand(x*B[j-1]-B[j-2]) end do

x^3+x

 

x^4-2

 

x^5-3*x-x^3

(4)

for i from 0 to N do x[i] := h*i+a end do

0

 

1/5

 

2/5

 

3/5

 

4/5

 

1

(5)

y := sum(c[s]*B[s], s = 0 .. N)

c[0]+c[1]*x+c[2]*(x^2+2)+c[3]*(x^3+x)+c[4]*(x^4-2)+c[5]*(x^5-3*x-x^3)

(6)

yt := subs(x = t, y)

c[0]+c[1]*t+c[2]*(t^2+2)+c[3]*(t^3+t)+c[4]*(t^4-2)+c[5]*(t^5-3*t-t^3)

(7)

k := expand(int(yt*sin(t)*x, t = 0 .. x))

x*c[0]+22*x*c[4]-c[1]*cos(x)*x^2-c[2]*cos(x)*x^3+2*c[2]*sin(x)*x^2-c[3]*cos(x)*x^4+3*c[3]*sin(x)*x^3+5*c[3]*cos(x)*x^2-c[4]*cos(x)*x^5+4*c[4]*sin(x)*x^4+12*c[4]*cos(x)*x^3-24*c[4]*sin(x)*x^2-c[5]*cos(x)*x^6+5*c[5]*sin(x)*x^5+21*c[5]*cos(x)*x^4-63*c[5]*sin(x)*x^3-123*c[5]*cos(x)*x^2-x*cos(x)*c[0]-22*x*cos(x)*c[4]+x*c[1]*sin(x)-5*x*c[3]*sin(x)+123*x*c[5]*sin(x)

(8)

k4 := k*y

(x*c[0]+22*x*c[4]-c[1]*cos(x)*x^2-c[2]*cos(x)*x^3+2*c[2]*sin(x)*x^2-c[3]*cos(x)*x^4+3*c[3]*sin(x)*x^3+5*c[3]*cos(x)*x^2-c[4]*cos(x)*x^5+4*c[4]*sin(x)*x^4+12*c[4]*cos(x)*x^3-24*c[4]*sin(x)*x^2-c[5]*cos(x)*x^6+5*c[5]*sin(x)*x^5+21*c[5]*cos(x)*x^4-63*c[5]*sin(x)*x^3-123*c[5]*cos(x)*x^2-x*cos(x)*c[0]-22*x*cos(x)*c[4]+x*c[1]*sin(x)-5*x*c[3]*sin(x)+123*x*c[5]*sin(x))*(c[0]+c[1]*x+c[2]*(x^2+2)+c[3]*(x^3+x)+c[4]*(x^4-2)+c[5]*(x^5-3*x-x^3))

(9)

f := (8*x^3*(1/3)-2*x^(1/2))*y/GAMMA(1/2)+(1/1260)*x+k4

((8/3)*x^3-2*x^(1/2))*(c[0]+c[1]*x+c[2]*(x^2+2)+c[3]*(x^3+x)+c[4]*(x^4-2)+c[5]*(x^5-3*x-x^3))/Pi^(1/2)+(1/1260)*x+(x*c[0]+22*x*c[4]-c[1]*cos(x)*x^2-c[2]*cos(x)*x^3+2*c[2]*sin(x)*x^2-c[3]*cos(x)*x^4+3*c[3]*sin(x)*x^3+5*c[3]*cos(x)*x^2-c[4]*cos(x)*x^5+4*c[4]*sin(x)*x^4+12*c[4]*cos(x)*x^3-24*c[4]*sin(x)*x^2-c[5]*cos(x)*x^6+5*c[5]*sin(x)*x^5+21*c[5]*cos(x)*x^4-63*c[5]*sin(x)*x^3-123*c[5]*cos(x)*x^2-x*cos(x)*c[0]-22*x*cos(x)*c[4]+x*c[1]*sin(x)-5*x*c[3]*sin(x)+123*x*c[5]*sin(x))*(c[0]+c[1]*x+c[2]*(x^2+2)+c[3]*(x^3+x)+c[4]*(x^4-2)+c[5]*(x^5-3*x-x^3))

(10)

"f(x):=((8/3 x^3-2 sqrt(x)) (c[0]+c[1] x+c[2] (x^2+2)+c[3] (x^3+x)+c[4] (x^4-2)+c[5] (x^5-3 x-x^3)))/(sqrt(Pi))+1/1260 x+(x c[0]+22 x c[4]+x c[1] sin(x)-5 x c[3] sin(x)+123 x c[5] sin(x)-x cos(x) c[0]-22 x cos(x) c[4]-c[1] cos(x) x^2-c[2] cos(x) x^3+2 c[2] sin(x) x^2-c[3] cos(x) x^4+3 c[3] sin(x) x^3+5 c[3] cos(x) x^2-c[4] cos(x) x^5+4 c[4] sin(x) x^4+12 c[4] cos(x) x^3-24 c[4] sin(x) x^2-c[5] cos(x) x^6+5 c[5] sin(x) x^5+21 c[5] cos(x) x^4-63 c[5] sin(x) x^3-123 c[5] cos(x) x^2) (c[0]+c[1] x+c[2] (x^2+2)+c[3] (x^3+x)+c[4] (x^4-2)+c[5] (x^5-3 x-x^3))"

proc (x) options operator, arrow; ((8/3)*x^3-2*sqrt(x))*(c[0]+Typesetting:-delayDotProduct(c[1], x, true)+c[2]*(x^2+2)+c[3]*(x^3+x)+c[4]*(x^4-2)+c[5]*(x^5-3*x-x^3))/sqrt(Pi)+Typesetting:-delayDotProduct(1/1260, x, true)+(Typesetting:-delayDotProduct(x, c[0], true)+22*x*c[4]+Typesetting:-delayDotProduct(x, c[1], true)*sin(x)-5*x*c[3]*sin(x)+123*x*c[5]*sin(x)-Typesetting:-delayDotProduct(x, cos(x), true)*c[0]-22*x*cos(x)*c[4]-c[1]*cos(x)*x^2-c[2]*cos(x)*x^3+2*c[2]*sin(x)*x^2-c[3]*cos(x)*x^4+3*c[3]*sin(x)*x^3+5*c[3]*cos(x)*x^2-c[4]*cos(x)*x^5+4*c[4]*sin(x)*x^4+12*c[4]*cos(x)*x^3-24*c[4]*sin(x)*x^2-c[5]*cos(x)*x^6+5*c[5]*sin(x)*x^5+21*c[5]*cos(x)*x^4-63*c[5]*sin(x)*x^3-123*c[5]*cos(x)*x^2)*(c[0]+Typesetting:-delayDotProduct(c[1], x, true)+c[2]*(x^2+2)+c[3]*(x^3+x)+c[4]*(x^4-2)+c[5]*(x^5-3*x-x^3)) end proc

(11)

NULL

"H(f,alpha,x):=Int((x-s)^(alpha-1)*f(s)/GAMMA(alpha), s = 0 .. x)"

proc (f, alpha, x) options operator, arrow; Int((x-s)^(alpha-1)*f(s)/GAMMA(alpha), s = 0 .. x) end proc

(12)

`assuming`([value(%)], [x > 0])

proc (f, alpha, x) options operator, arrow; Int((x-s)^(alpha-1)*f(s)/GAMMA(alpha), s = 0 .. x) end proc

(13)

H(f, alpha, x)

Int((((8/3)*s^3-2*s^(1/2))*(c[0]+c[1]*s+c[2]*(s^2+2)+c[3]*(s^3+s)+c[4]*(s^4-2)+c[5]*(s^5-3*s-s^3))/Pi^(1/2)+(1/1260)*s+(s*c[0]+22*s*c[4]+c[1]*s*sin(s)-5*s*c[3]*sin(s)+123*s*c[5]*sin(s)-s*cos(s)*c[0]-22*s*cos(s)*c[4]-c[1]*cos(s)*s^2-c[2]*cos(s)*s^3+2*c[2]*sin(s)*s^2-c[3]*cos(s)*s^4+3*c[3]*sin(s)*s^3+5*c[3]*cos(s)*s^2-c[4]*cos(s)*s^5+4*c[4]*sin(s)*s^4+12*c[4]*cos(s)*s^3-24*c[4]*sin(s)*s^2-c[5]*cos(s)*s^6+5*c[5]*sin(s)*s^5+21*c[5]*cos(s)*s^4-63*c[5]*sin(s)*s^3-123*c[5]*cos(s)*s^2)*(c[0]+c[1]*s+c[2]*(s^2+2)+c[3]*(s^3+s)+c[4]*(s^4-2)+c[5]*(s^5-3*s-s^3)))/((x-s)^(1/2)*Pi^(1/2)), s = 0 .. x)

(14)

z := value(%)

int((((8/3)*s^3-2*s^(1/2))*(c[0]+c[1]*s+c[2]*(s^2+2)+c[3]*(s^3+s)+c[4]*(s^4-2)+c[5]*(s^5-3*s-s^3))/Pi^(1/2)+(1/1260)*s+(s*c[0]+22*s*c[4]+c[1]*s*sin(s)-5*s*c[3]*sin(s)+123*s*c[5]*sin(s)-s*cos(s)*c[0]-22*s*cos(s)*c[4]-c[1]*cos(s)*s^2-c[2]*cos(s)*s^3+2*c[2]*sin(s)*s^2-c[3]*cos(s)*s^4+3*c[3]*sin(s)*s^3+5*c[3]*cos(s)*s^2-c[4]*cos(s)*s^5+4*c[4]*sin(s)*s^4+12*c[4]*cos(s)*s^3-24*c[4]*sin(s)*s^2-c[5]*cos(s)*s^6+5*c[5]*sin(s)*s^5+21*c[5]*cos(s)*s^4-63*c[5]*sin(s)*s^3-123*c[5]*cos(s)*s^2)*(c[0]+c[1]*s+c[2]*(s^2+2)+c[3]*(s^3+s)+c[4]*(s^4-2)+c[5]*(s^5-3*s-s^3)))/((x-s)^(1/2)*Pi^(1/2)), s = 0 .. x)

(15)

`assuming`([value(%)], [x > 0])

int((((8/3)*s^3-2*s^(1/2))*(c[0]+c[1]*s+c[2]*(s^2+2)+c[3]*(s^3+s)+c[4]*(s^4-2)+c[5]*(s^5-3*s-s^3))/Pi^(1/2)+(1/1260)*s+(s*c[0]+22*s*c[4]+c[1]*s*sin(s)-5*s*c[3]*sin(s)+123*s*c[5]*sin(s)-s*cos(s)*c[0]-22*s*cos(s)*c[4]-c[1]*cos(s)*s^2-c[2]*cos(s)*s^3+2*c[2]*sin(s)*s^2-c[3]*cos(s)*s^4+3*c[3]*sin(s)*s^3+5*c[3]*cos(s)*s^2-c[4]*cos(s)*s^5+4*c[4]*sin(s)*s^4+12*c[4]*cos(s)*s^3-24*c[4]*sin(s)*s^2-c[5]*cos(s)*s^6+5*c[5]*sin(s)*s^5+21*c[5]*cos(s)*s^4-63*c[5]*sin(s)*s^3-123*c[5]*cos(s)*s^2)*(c[0]+c[1]*s+c[2]*(s^2+2)+c[3]*(s^3+s)+c[4]*(s^4-2)+c[5]*(s^5-3*s-s^3)))/((x-s)^(1/2)*Pi^(1/2)), s = 0 .. x)

(16)

``


Download proplem_in_maple.mw
 

Dear Friends

I would like to know how I can show a simple arrow on a curve in a plot. For example for the simple sample y=x^2, for x>0, I want to show with an arrow in the figure that the trajectory begins from the point (0,0) and tends to come to the point (3,9). Or any other examples you want.

Thanks a lot

Dear Helpers

I have a RootOf such as below. My question is how can I obtain a simple answer for it, or how can I simplify it? Also, what's the difference between the case "index=1" and the cases "index=2" and "index=3"?

" RootOf(6*_Z^3+(27+3*RootOf(_Z^2*l^2+3*_Z^4-3)^2*sqrt(9-3*RootOf(_Z^2*l^2+3*_Z^4-3)^2*l^2))*_Z^2+(3*sqrt(9-3*RootOf(_Z^2*l^2+3*_Z^4-3)^2*l^2)*l^4*RootOf(_Z^2*l^2+3*_Z^4-3)^2-9*sqrt(9-3*RootOf(_Z^2*l^2+3*_Z^4-3)^2*l^2)*l^2+90*RootOf(_Z^2*l^2+3*_Z^4-3)^2*l^2-18*l^4+6*l^6*RootOf(_Z^2*l^2+3*_Z^4-3)^2-81+45*RootOf(_Z^2*l^2+3*_Z^4-3)^2*sqrt(9-3*RootOf(_Z^2*l^2+3*_Z^4-3)^2*l^2))*_Z-324-3*l^8+l^10*RootOf(_Z^2*l^2+3*_Z^4-3)^2+108*RootOf(_Z^2*l^2+3*_Z^4-3)^2*sqrt(9-3*RootOf(_Z^2*l^2+3*_Z^4-3)^2*l^2)-3*sqrt(9-3*RootOf(_Z^2*l^2+3*_Z^4-3)^2*l^2)*l^6+sqrt(9-3*RootOf(_Z^2*l^2+3*_Z^4-3)^2*l^2)*l^8*RootOf(_Z^2*l^2+3*_Z^4-3)^2-63*sqrt(9-3*RootOf(_Z^2*l^2+3*_Z^4-3)^2*l^2)*l^2+30*sqrt(9-3*RootOf(_Z^2*l^2+3*_Z^4-3)^2*l^2)*l^4*RootOf(_Z^2*l^2+3*_Z^4-3)^2+45*l^6*RootOf(_Z^2*l^2+3*_Z^4-3)^2+351*RootOf(_Z^2*l^2+3*_Z^4-3)^2*l^2-108*l^4, index = 1) "

Thank you so much!

 

Dear Users! I solved a PDE by using the following code. 
restart;a := 1:b:= 2:l:= 1:alpha[1]:= 1:alpha[2]:= 3:
  syspde:= [diff(u(x, t), t)-a+u(x, t)-u(x, t)^2*v(x, t)-alpha[1]*(diff(u(x, t), x$2)) = 0, diff(v(x, t), t)-b+u(x, t)^2*v(x, t)-alpha[2]*(diff(v(x, t), x$2)) = 0];
Bcs:= [u(x,0)=1,v(x,0)=1,D[1](u)(-l, t) = 0,D[1](u)(l, t) = 0,D[1](v)(-l, t) = 0,D[1](v)(l, t) = 0];
  sol:=pdsolve(syspde, Bcs, numeric);
  p1:=sol:-plot3d( u(x,t), t=0..1, x=-1..1, color=red);
  p2:=sol:-plot3d( v(x,t), t=0..1, x=-1..1, color=blue);
Now I want to see the value of u(x, t)+diff(u(x, t), x)+diff(u(x, t), t) when x=0 and t=1. Please help me to fix the problem. Thanks in advance. 

Dear Guys

How can I plot a fieldplot with a boundary. For example I can plot

> fieldplot([y, -sin(x)-(1/10)*y], x = -1 .. 1, y = 0 .. 1);

but I want to see the field plot only in the region x^2+y^2<=1.

Thanks a lot 

Let A be an nrxnr binary matrix. Suppose that the nxn binary matrix is obtained from the matrix A using the following code:

n := upperbound(A)[1]/r; 
B := Matrix(n, n, 0); 
for i to n do
 for j to n do 
  B[i, j] := SubMatrix(A, [(i-1)*r+1 .. i*r], [(j-1)*r+1 .. j*r])
 end do;
end do;

In other words, the matrix B is a decomposition of matrix A by rxr binary matrices. In the rest, we want to compute all determinants of the submatrices of B in module 2 as follows: 

u := 1; 
for k to n do
 P := choose(n, k); 
 for i to nops(P) do
  for j to nops(P) do
   W := []; 
   for ii in P[i] do 
    for jj in P[j] do
     W := [op(W), B[ii, jj]] 
    end do 
   end do;
   x := `mod`(Det(convert(blockmatrix(k, k, W), Matrix)), 2); 
  if x = 0 then 
    u := 0;
    i := nops(P)+1;
    j := nops(P)+1;
    k := n+1 
   end if 
  end do 
 end do; 
 unassign('i, j, ii, jj, W, x, P') 
end do

In the last step, we check that if the value of all sub determinants of B in module 2, are non zero, then we announce that the block matrix B is an MDS matrix

if u = 1 then print(MDS) else print(NoMDS) end if

Based on the above description I wrote the following procedure:

restart

with(LinearAlgebra); 
with(linalg, blockmatrix);
with(combinat)

MDS:=proc(A::Matrix,r::integer) 
   local n,B,i,j,u,ii,jj,k,P,W,x; 
   n:=upperbound(A)[1]/r;
   B:=Matrix(n,n,0); 
   for i to n do 
       for j to n do 
	        B[i,j]:=LinearAlgebra:-SubMatrix(A,[(i - 1)*r+1..i*r],[(j - 1)*r+1..j*r]) 
		end do 
	end do; 
	unassign('i,j');
	u:=1; 
	for k to n do
    	P:=combinat:-choose(n,k); 
		for i to nops(P) do
     		for j to nops(P) do
    			W:=[]; 
				for ii in P[i] do
    				for jj in P[j] do 
					    W:=[op(W),B[ii,jj]] 
					end do 
				end do; 
				x:=mod(Det(convert(linalg:-blockmatrix(k,k,W),Matrix)),2);
				if x=0 then 
				   u:=0;
				   i:=nops(P)+1;
				   j:=nops(P)+1;
				   k:=n+1
				end if 
			end do 
		end do; 
		unassign('i,j,ii,jj,W,x,P') 
	end do; 
	if u=1 then print(MDS) else print(NoMDS) end if 
end proc

 

My problem is that if A is a 64x64 binary matrix and also r=8, then the procedure MDS(A,8) takes 453 seconds to run in my computer (Maple 15 on windows 7 32bit with 4G RAM).

Is it possible to optimize the procedure such that MDS(A,8) takes less than 1 minutes.

Thanks for any help

Let A=[V1, V2 ,..., Vn ] be a list of binary vectors such that the length of Vi for i=1...n is the positive integer number m. For instance, in the following example we have n=6 and m=5.

A := [[1, 1, 1, 0, 0], [0, 1, 0, 1, 1], [1, 0, 1, 1, 1], [0, 1, 1, 1, 0], [1, 1, 0, 1, 0], [0, 1, 1, 1, 1]]

Suppose that ej with j=1...m are vectors of size m such that all entries of ej 's are zero except the jth entry where is equal to 1. Now set S=[e1,e2,...,em]. For example by m=5 we get 

S:=[[1, 0, 0, 0, 0], [0, 1, 0, 0, 0], [0, 0, 1, 0, 0], [0, 0, 0, 1, 0], [0, 0, 0, 0, 1]]

First, we choose i,j in [1...m] such that i<>j and then we update S as follows S=[e1,e2,...,em,ei+ej mod 2]. For example, it follows from i=1 and j=2 that 

S:=[[1, 0, 0, 0, 0], [0, 1, 0, 0, 0], [0, 0, 1, 0, 0], [0, 0, 0, 1, 0], [0, 0, 0, 0, 1], [1, 1, 0, 0, 0]]

Now consider the kth entry of A which is called Ak. Then we check that what is the minimum number of entries of S so that the summation of these entries mod 2 is equal to Ak. For example, for  S=[e1,e2,...,em,e1+e2 mod 2] we get [2, 3, 4, 3, 2, 4] which means the minimum number of entries of the S that are required to be added in order to obtain A1 is 2 and so on. Therefore, for the given example we get 

E:=[[1, 2, [2, 3, 4, 3, 2, 4], 18, 7.615773106],
[1, 3, [2, 3, 3, 3, 3, 4], 18, 7.483314774],
[1, 4, [3, 3, 3, 3, 2, 4], 18, 7.483314774],
[1, 5, [3, 3, 3, 3, 3, 4], 19, 7.810249676],
[2, 3, [2, 3, 4, 2, 3, 3], 17, 7.141428429],
[2, 4, [3, 2, 4, 2, 2, 3], 16, 6.782329983],
[2, 5, [3, 2, 4, 3, 3, 3], 18, 7.483314774], 
[3, 4, [3, 3, 3, 2, 3, 3], 17, 7.], 
[3, 5, [3, 3, 3, 3, 3, 3], 18, 7.348469229],
[4, 5, [3, 2, 3, 3, 3, 3], 17, 7.]];

For instance, the interpretation of [3, 5, [3, 3, 3, 3, 3, 3], 18, 7.348469229] is that if S be [e1,e2,e3,e4,e5,e3+e5 mod 2] then we get [3, 3, 3, 3, 3, 3] where 18 is the summation of [3, 3, 3, 3, 3, 3] and also the number 7.348469229 is obtained from the following command: 

MatrixNorm(convert([3, 3, 3, 3, 3, 3], Matrix), Frobenius);

Now we choose Ek for k in [1..nops(E)] such that Ek[4] be minimum over all Ek[4]'s. For example we choose [2, 4, [3, 2, 4, 2, 2, 3], 16, 6.782329983] since 16 is minimum between Ek[4]'s.

There are two points: First one is that if we have Ei and Ej such that Ei[4]=Ej[4] then we choose Ei if  Ei[5]>Ej[5] . The second point is that if Ei[4]=Ej[4] and also Ei[5]=Ej[5] then we choose one of them such as the first one. Finally we update the set S from the first two entries of Ek that we have obtained. For instance, the updated S in our example is:

S=[e[1],e[2],e[3],e[4],e[5],S[E[6][1]]+S[E[6][2]] mod 2]=[e[1],e[2],e[3],e[4],e[5],e[2]+e[4] mod 2]

Now we repeat this procedure for the updated S until that in one of the entries of E such as Ek we get Ek[3]=[1,1,..,1].

I have written a procedure in Maple for the mentioned question. But my procedure takes long time to compute when I run it over a list such as A with parameters n=m=64.

I want to kindly request you please modify the following code or suggest another fast procedure for this question.

 
 restart;

 with(LinearAlgebra):
 with(ListTools): 
 with(combinat):
 
 BP := proc (A::list)
    local n, m, r, S, U, tt, P, E, t, Q, Z, R, k, T, j, PP, i, QQ; 
    n := nops(A); 
    m := nops(A[1]);
    r := [seq(0, i = 1 .. m)]; 
    r[1] := 1; 
    S := [seq(Rotate(r, m-i+1), i = 1 .. m)]; 
    unassign('r'); 
    U := []; 
    tt := 1;
 while 0 < tt do
     P := choose(nops(S), 2);
     E := [];
     for t to nops(P) do
          Q := P[t];
          Z := []; 
          R := [S[], `mod`(S[Q[1]]+S[Q[2]], 2)];
          for k to n do
               T := A[k];
               for j to nops(R) do 
                    PP := choose(nops(R), j);
                    for i to nops(PP) do 
                         QQ := PP[i]; r := `mod`(add(R[QQ[i]], i = 1 .. nops(QQ)), 2);
                         if Occurrences(0, r-T) = m then
                            Z := [op(Z), j];
                            i := nops(PP)+1; 
                            j := nops(R)+1 
                         end if; 
                      end do; 
                      unassign('i, QQ, r, PP'): 
                  end do;
              end do;
              E := [op(E), [Q[], Z, add(Z[i], i = 1 .. nops(Z)), evalf(MatrixNorm(convert(Z, Matrix), Frobenius))]]; 
              unassign('k, Z, Q, R'): 
          end do;
          r := FindMinimalElement([seq(E[i][4], i = 1 .. nops(E))]);
          R := []; 
         for i to nops(E) do 
             if E[i][4] = r then R := [op(R), E[i]] end if 
         end do;
         T := [FindMaximalElement([seq(R[i][5], i = 1 .. nops(R))], position)];
         S := [S[], `mod`(S[R[T[2]][1]]+S[R[T[2]][2]], 2)]; 
         U := [op(U), [R[T[2]][1], R[T[2]][2]]];
         if Occurrences(1, R[T[2]][3]) = n then tt := 0 end if;
         unassign('r, i, R, T, E')
     end do;
     return U;
 end proc:
 
 A := [[1, 1, 1, 0, 0], [0, 1, 0, 1, 1], [1, 0, 1, 1, 1], [0, 1, 1, 1, 0], [1, 1, 0, 1, 0], [0, 1, 1, 1, 1]];

 BP(A);
      [[2, 4], [3, 6], [5, 7], [1, 2], [1, 6], [3, 8], [3, 9], [8, 9]]
 

For more information please see Section 2.1 of the following paper: https://eprint.iacr.org/2019/856.pdf

Thanks in advance for your consideration of this request.

1 2 3 4 5 6 7 Last Page 1 of 47