MaplePrimes Questions

How we can calculate solution of this ODE by give assumption to the equation , we have otehr case too, like lambda>0&mu<0

I have a lot of questions about using evalf/Int with Monte-Carlo like methods.
They are red written in the attached file and concern several different points.
I would like you to answer each of them and not to focus on a specific one.
Thanks in advance.

method=_MonteCarlo uses the Fortran procedure d01gbc (maybe Maple rewritten?): the original NAG procedure is described here d01gbc

restart

kernelopts(version)

`Maple 2015.2, APPLE UNIVERSAL OSX, Dec 20 2015, Build ID 1097895`

(1)

domain := 0.8..3.;
f := x -> 1/(1 + sinh(2*x)*log(x)^2);

.8 .. 3.

 

proc (x) options operator, arrow; 1/(1+sinh(2*x)*log(x)^2) end proc

(2)

infolevel[`evalf/int`] := 4:

# I understand _CubaSuave used a random sample of size 134000 of the (x, y) integration domain.
# Am I right?
 
evalf(Int(f(x), [x=domain, y=0..1], method=_CubaSuave, epsilon=1e-4));
printf("\n%s\n", cat("-"$100));

# Did _CubaDivonne used a random sample of size 3256 ?
 
evalf(Int(f(x), [x=domain, y=0..1], 'method=_CubaDivonne', epsilon=1e-4));
printf("\n%s\n", cat("-"$100));

# What is the true number of points _MonteCarlo used?
 
evalf(Int(f(x), [x=domain, y=0..1], method=_MonteCarlo, epsilon=1e-4));

Control_multi: integrating on [.8, 0] .. [3., 1] the integrand

 

1/(1+sinh(2*x)*ln(x)^2)

 

cuba: transformed original integrand

 

1/(1+sinh(2*x)*ln(x)^2)

 

cuba: with lower bounds [.8, 0.] and upper bounds [3., 1.], to the following integrand to be integrated over the unit n-cube:

 

2.2/(1+sinh(4.4*x+1.6)*ln(2.2*x+.8)^2)

 

cuba: integration completed successfully
cuba: # of integrand evaluations: 134000
cuba: estimated (absolute) error: 6.73167e-05
cuba: chi-square probability that the error is not reliable: 1
cuba: number of regions that the domain was divided into: 134

 

HFloat(0.6770776956970137)

 


----------------------------------------------------------------------------------------------------
Control_multi: integrating on [.8, 0] .. [3., 1] the integrand

 

1/(1+sinh(2*x)*ln(x)^2)

 

cuba: transformed original integrand

 

1/(1+sinh(2*x)*ln(x)^2)

 

cuba: with lower bounds [.8, 0.] and upper bounds [3., 1.], to the following integrand to be integrated over the unit n-cube:

 

2.2/(1+sinh(4.4*x+1.6)*ln(2.2*x+.8)^2)

 

cuba: integration completed successfully
cuba: # of integrand evaluations: 3256
cuba: estimated (absolute) error: 6.37672e-05
cuba: chi-square probability that the error is not reliable: 0
cuba: number of regions that the domain was divided into: 22

 

HFloat(0.6768372810943345)

 


----------------------------------------------------------------------------------------------------
Control_multi: integrating on [.8, 0] .. [3., 1] the integrand

 

1/(1+sinh(2*x)*ln(x)^2)

 

trying d01gbc (nag_multi_quad_monte_carlo)
d01gbc: epsrel=.1e-3; minpts=0; maxpts=500000000; method=2; cont=0
d01gbc: procedure for evaluation is:
proc (X) 1/(1.+sinh(2.*X[1])*ln(X[1])^2) end proc

d01gbc: result=.676840185506968228
d01gbc: relerr=.103631215397982221e-4; usedpts=1044
result=.676840185506968228

 

.6768401855

(3)

# By the way, why is infolevel[`evalf/int`] output discarded?

evalf(Int(f(x), [x=domain, y=0..1], method=_CubaSuave, epsilon=1e-4));
printf("\n%s\n", cat("-"$100));
evalf(Int(f(x), [x=domain, y=0..1], method=_MonteCarlo, epsilon=1e-4));

HFloat(0.6770776956970137)

 


----------------------------------------------------------------------------------------------------

 

.6768401855

(4)

# Let us suppose I don(t care of the accuracy of the result as I am capable to assess it
# by some other way:
#      How can I use a Monte-Carlo integration method with a given number of points?
#      Why there is no estimation of the integral returned?

infolevel[`evalf/int`] := 0:
infolevel[`evalf/int`] := 4:
evalf(
  Int(
    f(x), [x=domain, y=0..1]
    , method=_CubaVegas
    , methodoptions=[minimalpoints = 10^3, maximalpoints = 10^3]
  )
);

Control_multi: integrating on [.8, 0] .. [3., 1] the integrand

 

1/(1+sinh(2*x)*ln(x)^2)

 

cuba: transformed original integrand

 

1/(1+sinh(2*x)*ln(x)^2)

 

cuba: with lower bounds [.8, 0.] and upper bounds [3., 1.], to the following integrand to be integrated over the unit n-cube:

 

2.2/(1+sinh(4.4*x+1.6)*ln(2.2*x+.8)^2)

 

cuba: could not attain requested accuracy
cuba: # of integrand evaluations: 1000
cuba: estimated (absolute) error: 0.025423
cuba: chi-square probability that the error is not reliable: -999
evalf/int: error from Control_multi was:
"could not attain requested accuracy; try increasing epsilon or absepsilon or maximalpoints"

 

Int(Int(1/(1.+sinh(2.*x)*ln(x)^2), x = .8 .. 3.), y = 0. .. 1.)

(5)

infolevel[`evalf/int`] := 0:
infolevel[`evalf/int`] := 4:
evalf(
  Int(
    f(x), [x=domain, y=0..1]
    , method=_CubaSuave
    , methodoptions=[minimalpoints = 10^3, maximalpoints = 10^3]
  )
);

Control_multi: integrating on [.8, 0] .. [3., 1] the integrand

 

1/(1+sinh(2*x)*ln(x)^2)

 

cuba: transformed original integrand

 

1/(1+sinh(2*x)*ln(x)^2)

 

cuba: with lower bounds [.8, 0.] and upper bounds [3., 1.], to the following integrand to be integrated over the unit n-cube:

 

2.2/(1+sinh(4.4*x+1.6)*ln(2.2*x+.8)^2)

 

cuba: could not attain requested accuracy
cuba: # of integrand evaluations: 1000
cuba: estimated (absolute) error: 0.025423
cuba: chi-square probability that the error is not reliable: -999
cuba: number of regions that the domain was divided into: 1
evalf/int: error from Control_multi was:
"could not attain requested accuracy; try increasing epsilon or absepsilon or maximalpoints"

 

Int(Int(1/(1.+sinh(2.*x)*ln(x)^2), x = .8 .. 3.), y = 0. .. 1.)

(6)

infolevel[`evalf/int`] := 0:
infolevel[`evalf/int`] := 4:
evalf(
  Int(
    f(x), [x=domain, y=0..1]
    , method=_MonteCarlo
    , methodoptions=[minimalpoints = 10^3, maximalpoints = 10^3]
  )
);

Control_multi: integrating on [.8, 0] .. [3., 1] the integrand

 

1/(1+sinh(2*x)*ln(x)^2)

 

evalf/int: error from Control_multi was:
"NAG d01gbc expects epsilon >= 0.5e-4, but received %1", .5000000000e-9

 

Int(Int(1/(1.+sinh(2.*x)*ln(x)^2), x = .8 .. 3.), y = 0. .. 1.)

(7)

# Example 8 of the reference given in the question text

evalf(Int(4*x1*x3^2*exp(2*x1*x3)/(1+x2+x4)^2, [seq(x||i=0..1, i=1..4)], method=_MonteCarlo, epsilon=1e-2))

.5753724460

(8)

# Why is not the seeed updated ?

for j from 1 to 3 do
  Threads:-Sleep(10):
  evalf(Int(4*x1*x3^2*exp(2*x1*x3)/(1+x2+x4)^2, [seq(x||i=0..1, i=1..4)], method=_MonteCarlo, epsilon=1e-2))
end do;

.5753724460

 

.5753724460

 

.5753724460

(9)

# Here a new seed is forced at each iteration but the estimations of the integral are always the same.
# This is impossible as these estimationsare the realizations of a random variable: so they cannot be identical.
#
# So, does evalf/Int always use the same internal seed?
# More importantly: does it really use a random generator?
for j from 1 to 3 do
  seed := randomize(rand()());
  J := evalf(Int(4*x1*x3^2*exp(2*x1*x3)/(1+x2+x4)^2, [seq(x||i=0..1, i=1..4)], method=_MonteCarlo, epsilon=1e-2)):
  print('seed' = seed,  'J' = J);
end do:

Control_multi: integrating on [0, 0, 0, 0] .. [1, 1, 1, 1] the integrand

 

4*x1*x3^2*exp(2*x1*x3)/(1+x2+x4)^2

 

trying d01gbc (nag_multi_quad_monte_carlo)
d01gbc: epsrel=.1e-1; minpts=0; maxpts=500000000; method=2; cont=0
d01gbc: procedure for evaluation is:
proc (X) 4.*X[1]*X[3]^2*exp(2.*X[1]*X[3])/(1.+X[2]+X[4])^2 end proc
d01gbc: result=.574090186993690188
d01gbc: relerr=.675204841605886539e-2; usedpts=8064
result=.574090186993690188

 

seed = 233366062458, J = .5740901870

 

seed = 887991988815, J = .5740901870

 

seed = 416683078956, J = .5740901870

(10)

# This is what one expects from Monte-Carlo integration

use Statistics in
  for i from 1 to 10 do
    seed := randomize(rand()());
    S := Sample(Uniform(op(domain)), 100):
    print('seed' = seed,  'J' = Mean(f~(S)) * (- `-`(op(domain))) );
  end do:
end use:

seed = 36995932795, J = HFloat(0.6280945376385327)

 

seed = 976943479321, J = HFloat(0.7320842356827296)

 

seed = 542869221880, J = HFloat(0.6519958887669823)

 

seed = 303692769322, J = HFloat(0.6134976803250747)

 

seed = 443233702046, J = HFloat(0.6304929479488379)

 

seed = 881136125112, J = HFloat(0.6528328283998008)

 

seed = 708639694457, J = HFloat(0.6601745158455014)

 

seed = 675811574035, J = HFloat(0.7640187396123023)

 

seed = 164464632871, J = HFloat(0.7949627835070758)

 

seed = 604897894346, J = HFloat(0.5922357495886873)

(11)
 

 

Download Numerical_integration_Using_MC_methods.mw

On considère un cercle fixe O et un point fixe A extérieur. Une sécante variable BC à ce cercle passe par un point fixe J.
Démontrer que le cercle ABC passe par un second point fixe P.
restart;
Proc := proc(m)
local xA, yA, xB, yB, xC, yC, xJ, yJ, tx, dr, Oo, c1, r, eqBJ, eq1, sol;
_EnvHorizontalName := 'x'; _EnvVerticalName := 'y';
xJ := 5; yJ := 1; geometry:-point(A, 2, 4); geometry:-point(J, xJ, yJ); geometry:-point(Oo, 0, 0);
r := 3; c1 := plottools[geometry:-circle]([0, 0], r, color = blue);
eqBJ := y = m*(x - xJ) + yJ; geometry:-line(BJ, eqBJ, [x, y]);
eq1 := x^2 + y^2 = r^2; sol := solve({eqBJ, eq1}, {x, y}, explicit);
xB := subs(sol[1], x); yB := subs(sol[1], y);
geometry:-point(B, xB, yB); xC := subs(sol[2], x); yC := subs(sol[2], y);
geometry:-point(C, xC, yC); geometry:-circle(c2, [A, B, C]); geometry:-line(AB, [A, B]); geometry:-line(AC, [A, C]);
eqBJ := y = m*(x - xJ) + yJ; geometry:-line(BJ, eqBJ, [x, y]);
eq1 := x^2 + y^2 = r^2; sol := solve({eqBJ, eq1}, {x, y},explicit);
xB := subs(sol[1], x); yB := subs(sol[1], y); geometry:-point(B, xB, yB);
xC := subs(sol[2], x); yC := subs(sol[2], y); geometry:-point(C, xC, yC);
geometry:-circle(c2, [A, B, C]); geometry:-line(AB, [A, B]); geometry:-line(AC, [A, C]);
tx := plots:-textplot([[geometry:-coordinates(A)[], "A"], [geometry:-coordinates(B)[], "B"], [geometry:-coordinates(C)[], "C"], [geometry:-coordinates(J)[], "J"]], font = [times, bold, 16], align = [above, right]);
dr := geometry:-draw([AB(color = black), c2(color = magenta), A(color = blue, symbol = solidcircle, symbolsize = 16),
B(color = red, symbol = solidcircle, symbolsize = 16), C(color = red, symbol = solidcircle, symbolsize = 16),
J(color = red, symbol = solidcircle, symbolsize = 16)]); plots:-display([dr, c1, tx], axes = normal, view = [-5 .. 6, -4 .. 6], scaling = constrained);
end proc;
plots:-animate(Proc, [m], m = -0.9 .. 0.2*Pi, frames = 50);
Error, (in plots/animate) two lists or Vectors of numerical values expected
NULL;
I am trying to find out point P; Thank you for your help.

From time to time Maple output containts brackets that are nor needed. Example:

int(f(x),x=a..c)-int(f(x),x=a..b);
simplify(%) assuming c>b

Why is that? Is there a way not to have these brackets printed?

Is there a way to force Maple to use basic linear algebra results?
Here is a result you can find in any linear algebra book (this one comes from Harville's Matrix Algebra From a Statistician's Perspective)
I'm using Maple to check my work and it would be helpful if some basic linear algebra results would be injected in Maple's algorithm.

kernelopts(version); interface(version)

`Maple 2024.2, X86 64 WINDOWS, Oct 29 2024, Build ID 1872373`

 

`Standard Worksheet Interface, Maple 2024.2, Windows 11, October 29 2024 Build ID 1872373`

(1)

restart; with(LinearAlgebra)

alias(`&bigotimes;` = LinearAlgebra:-KroneckerProduct)

`&bigotimes;`

(2)

for dim from 2 to 5 do A := Matrix(dim, dim, shape = symmetric, symbol = a); print(dim, Equal(1/`&bigotimes;`(A, A), `&bigotimes;`(1/A, 1/A)), simplify(1/`&bigotimes;`(A, A)-`&bigotimes;`(1/A, 1/A), symbolic)) end do; for dim from 2 to 5 do A := Matrix(dim, dim, shape = symmetric, symbol = a); print(dim, Equal(simplify(1/`&bigotimes;`(A, A)), simplify(`&bigotimes;`(1/A, 1/A))), simplify(1/`&bigotimes;`(A, A)-`&bigotimes;`(1/A, 1/A), symbolic)) end do

2, true, [`?`]

 

3, false, [`?`]

 

4, false, Matrix(16, 16, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (1, 6) = 0, (1, 7) = 0, (1, 8) = 0, (1, 9) = 0, (1, 10) = 0, (1, 11) = 0, (1, 12) = 0, (1, 13) = 0, (1, 14) = 0, (1, 15) = 0, (1, 16) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (2, 6) = 0, (2, 7) = 0, (2, 8) = 0, (2, 9) = 0, (2, 10) = 0, (2, 11) = 0, (2, 12) = 0, (2, 13) = 0, (2, 14) = 0, (2, 15) = 0, (2, 16) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 0, (3, 4) = 0, (3, 5) = 0, (3, 6) = 0, (3, 7) = 0, (3, 8) = 0, (3, 9) = 0, (3, 10) = 0, (3, 11) = 0, (3, 12) = 0, (3, 13) = 0, (3, 14) = 0, (3, 15) = 0, (3, 16) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 0, (4, 5) = 0, (4, 6) = 0, (4, 7) = 0, (4, 8) = 0, (4, 9) = 0, (4, 10) = 0, (4, 11) = 0, (4, 12) = 0, (4, 13) = 0, (4, 14) = 0, (4, 15) = 0, (4, 16) = 0, (5, 1) = 0, (5, 2) = 0, (5, 3) = 0, (5, 4) = 0, (5, 5) = 0, (5, 6) = 0, (5, 7) = 0, (5, 8) = 0, (5, 9) = 0, (5, 10) = 0, (5, 11) = 0, (5, 12) = 0, (5, 13) = 0, (5, 14) = 0, (5, 15) = 0, (5, 16) = 0, (6, 1) = 0, (6, 2) = 0, (6, 3) = 0, (6, 4) = 0, (6, 5) = 0, (6, 6) = 0, (6, 7) = 0, (6, 8) = 0, (6, 9) = 0, (6, 10) = 0, (6, 11) = 0, (6, 12) = 0, (6, 13) = 0, (6, 14) = 0, (6, 15) = 0, (6, 16) = 0, (7, 1) = 0, (7, 2) = 0, (7, 3) = 0, (7, 4) = 0, (7, 5) = 0, (7, 6) = 0, (7, 7) = 0, (7, 8) = 0, (7, 9) = 0, (7, 10) = 0, (7, 11) = 0, (7, 12) = 0, (7, 13) = 0, (7, 14) = 0, (7, 15) = 0, (7, 16) = 0, (8, 1) = 0, (8, 2) = 0, (8, 3) = 0, (8, 4) = 0, (8, 5) = 0, (8, 6) = 0, (8, 7) = 0, (8, 8) = 0, (8, 9) = 0, (8, 10) = 0, (8, 11) = 0, (8, 12) = 0, (8, 13) = 0, (8, 14) = 0, (8, 15) = 0, (8, 16) = 0, (9, 1) = 0, (9, 2) = 0, (9, 3) = 0, (9, 4) = 0, (9, 5) = 0, (9, 6) = 0, (9, 7) = 0, (9, 8) = 0, (9, 9) = 0, (9, 10) = 0, (9, 11) = 0, (9, 12) = 0, (9, 13) = 0, (9, 14) = 0, (9, 15) = 0, (9, 16) = 0, (10, 1) = 0, (10, 2) = 0, (10, 3) = 0, (10, 4) = 0, (10, 5) = 0, (10, 6) = 0, (10, 7) = 0, (10, 8) = 0, (10, 9) = 0, (10, 10) = 0, (10, 11) = 0, (10, 12) = 0, (10, 13) = 0, (10, 14) = 0, (10, 15) = 0, (10, 16) = 0, (11, 1) = 0, (11, 2) = 0, (11, 3) = 0, (11, 4) = 0, (11, 5) = 0, (11, 6) = 0, (11, 7) = 0, (11, 8) = 0, (11, 9) = 0, (11, 10) = 0, (11, 11) = 0, (11, 12) = 0, (11, 13) = 0, (11, 14) = 0, (11, 15) = 0, (11, 16) = 0, (12, 1) = 0, (12, 2) = 0, (12, 3) = 0, (12, 4) = 0, (12, 5) = 0, (12, 6) = 0, (12, 7) = 0, (12, 8) = 0, (12, 9) = 0, (12, 10) = 0, (12, 11) = 0, (12, 12) = 0, (12, 13) = 0, (12, 14) = 0, (12, 15) = 0, (12, 16) = 0, (13, 1) = 0, (13, 2) = 0, (13, 3) = 0, (13, 4) = 0, (13, 5) = 0, (13, 6) = 0, (13, 7) = 0, (13, 8) = 0, (13, 9) = 0, (13, 10) = 0, (13, 11) = 0, (13, 12) = 0, (13, 13) = 0, (13, 14) = 0, (13, 15) = 0, (13, 16) = 0, (14, 1) = 0, (14, 2) = 0, (14, 3) = 0, (14, 4) = 0, (14, 5) = 0, (14, 6) = 0, (14, 7) = 0, (14, 8) = 0, (14, 9) = 0, (14, 10) = 0, (14, 11) = 0, (14, 12) = 0, (14, 13) = 0, (14, 14) = 0, (14, 15) = 0, (14, 16) = 0, (15, 1) = 0, (15, 2) = 0, (15, 3) = 0, (15, 4) = 0, (15, 5) = 0, (15, 6) = 0, (15, 7) = 0, (15, 8) = 0, (15, 9) = 0, (15, 10) = 0, (15, 11) = 0, (15, 12) = 0, (15, 13) = 0, (15, 14) = 0, (15, 15) = 0, (15, 16) = 0, (16, 1) = 0, (16, 2) = 0, (16, 3) = 0, (16, 4) = 0, (16, 5) = 0, (16, 6) = 0, (16, 7) = 0, (16, 8) = 0, (16, 9) = 0, (16, 10) = 0, (16, 11) = 0, (16, 12) = 0, (16, 13) = 0, (16, 14) = 0, (16, 15) = 0, (16, 16) = 0})

 

5, false, Matrix(25, 25, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (1, 6) = 0, (1, 7) = 0, (1, 8) = 0, (1, 9) = 0, (1, 10) = 0, (1, 11) = 0, (1, 12) = 0, (1, 13) = 0, (1, 14) = 0, (1, 15) = 0, (1, 16) = 0, (1, 17) = 0, (1, 18) = 0, (1, 19) = 0, (1, 20) = 0, (1, 21) = 0, (1, 22) = 0, (1, 23) = 0, (1, 24) = 0, (1, 25) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (2, 6) = 0, (2, 7) = 0, (2, 8) = 0, (2, 9) = 0, (2, 10) = 0, (2, 11) = 0, (2, 12) = 0, (2, 13) = 0, (2, 14) = 0, (2, 15) = 0, (2, 16) = 0, (2, 17) = 0, (2, 18) = 0, (2, 19) = 0, (2, 20) = 0, (2, 21) = 0, (2, 22) = 0, (2, 23) = 0, (2, 24) = 0, (2, 25) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 0, (3, 4) = 0, (3, 5) = 0, (3, 6) = 0, (3, 7) = 0, (3, 8) = 0, (3, 9) = 0, (3, 10) = 0, (3, 11) = 0, (3, 12) = 0, (3, 13) = 0, (3, 14) = 0, (3, 15) = 0, (3, 16) = 0, (3, 17) = 0, (3, 18) = 0, (3, 19) = 0, (3, 20) = 0, (3, 21) = 0, (3, 22) = 0, (3, 23) = 0, (3, 24) = 0, (3, 25) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 0, (4, 5) = 0, (4, 6) = 0, (4, 7) = 0, (4, 8) = 0, (4, 9) = 0, (4, 10) = 0, (4, 11) = 0, (4, 12) = 0, (4, 13) = 0, (4, 14) = 0, (4, 15) = 0, (4, 16) = 0, (4, 17) = 0, (4, 18) = 0, (4, 19) = 0, (4, 20) = 0, (4, 21) = 0, (4, 22) = 0, (4, 23) = 0, (4, 24) = 0, (4, 25) = 0, (5, 1) = 0, (5, 2) = 0, (5, 3) = 0, (5, 4) = 0, (5, 5) = 0, (5, 6) = 0, (5, 7) = 0, (5, 8) = 0, (5, 9) = 0, (5, 10) = 0, (5, 11) = 0, (5, 12) = 0, (5, 13) = 0, (5, 14) = 0, (5, 15) = 0, (5, 16) = 0, (5, 17) = 0, (5, 18) = 0, (5, 19) = 0, (5, 20) = 0, (5, 21) = 0, (5, 22) = 0, (5, 23) = 0, (5, 24) = 0, (5, 25) = 0, (6, 1) = 0, (6, 2) = 0, (6, 3) = 0, (6, 4) = 0, (6, 5) = 0, (6, 6) = 0, (6, 7) = 0, (6, 8) = 0, (6, 9) = 0, (6, 10) = 0, (6, 11) = 0, (6, 12) = 0, (6, 13) = 0, (6, 14) = 0, (6, 15) = 0, (6, 16) = 0, (6, 17) = 0, (6, 18) = 0, (6, 19) = 0, (6, 20) = 0, (6, 21) = 0, (6, 22) = 0, (6, 23) = 0, (6, 24) = 0, (6, 25) = 0, (7, 1) = 0, (7, 2) = 0, (7, 3) = 0, (7, 4) = 0, (7, 5) = 0, (7, 6) = 0, (7, 7) = 0, (7, 8) = 0, (7, 9) = 0, (7, 10) = 0, (7, 11) = 0, (7, 12) = 0, (7, 13) = 0, (7, 14) = 0, (7, 15) = 0, (7, 16) = 0, (7, 17) = 0, (7, 18) = 0, (7, 19) = 0, (7, 20) = 0, (7, 21) = 0, (7, 22) = 0, (7, 23) = 0, (7, 24) = 0, (7, 25) = 0, (8, 1) = 0, (8, 2) = 0, (8, 3) = 0, (8, 4) = 0, (8, 5) = 0, (8, 6) = 0, (8, 7) = 0, (8, 8) = 0, (8, 9) = 0, (8, 10) = 0, (8, 11) = 0, (8, 12) = 0, (8, 13) = 0, (8, 14) = 0, (8, 15) = 0, (8, 16) = 0, (8, 17) = 0, (8, 18) = 0, (8, 19) = 0, (8, 20) = 0, (8, 21) = 0, (8, 22) = 0, (8, 23) = 0, (8, 24) = 0, (8, 25) = 0, (9, 1) = 0, (9, 2) = 0, (9, 3) = 0, (9, 4) = 0, (9, 5) = 0, (9, 6) = 0, (9, 7) = 0, (9, 8) = 0, (9, 9) = 0, (9, 10) = 0, (9, 11) = 0, (9, 12) = 0, (9, 13) = 0, (9, 14) = 0, (9, 15) = 0, (9, 16) = 0, (9, 17) = 0, (9, 18) = 0, (9, 19) = 0, (9, 20) = 0, (9, 21) = 0, (9, 22) = 0, (9, 23) = 0, (9, 24) = 0, (9, 25) = 0, (10, 1) = 0, (10, 2) = 0, (10, 3) = 0, (10, 4) = 0, (10, 5) = 0, (10, 6) = 0, (10, 7) = 0, (10, 8) = 0, (10, 9) = 0, (10, 10) = 0, (10, 11) = 0, (10, 12) = 0, (10, 13) = 0, (10, 14) = 0, (10, 15) = 0, (10, 16) = 0, (10, 17) = 0, (10, 18) = 0, (10, 19) = 0, (10, 20) = 0, (10, 21) = 0, (10, 22) = 0, (10, 23) = 0, (10, 24) = 0, (10, 25) = 0, (11, 1) = 0, (11, 2) = 0, (11, 3) = 0, (11, 4) = 0, (11, 5) = 0, (11, 6) = 0, (11, 7) = 0, (11, 8) = 0, (11, 9) = 0, (11, 10) = 0, (11, 11) = 0, (11, 12) = 0, (11, 13) = 0, (11, 14) = 0, (11, 15) = 0, (11, 16) = 0, (11, 17) = 0, (11, 18) = 0, (11, 19) = 0, (11, 20) = 0, (11, 21) = 0, (11, 22) = 0, (11, 23) = 0, (11, 24) = 0, (11, 25) = 0, (12, 1) = 0, (12, 2) = 0, (12, 3) = 0, (12, 4) = 0, (12, 5) = 0, (12, 6) = 0, (12, 7) = 0, (12, 8) = 0, (12, 9) = 0, (12, 10) = 0, (12, 11) = 0, (12, 12) = 0, (12, 13) = 0, (12, 14) = 0, (12, 15) = 0, (12, 16) = 0, (12, 17) = 0, (12, 18) = 0, (12, 19) = 0, (12, 20) = 0, (12, 21) = 0, (12, 22) = 0, (12, 23) = 0, (12, 24) = 0, (12, 25) = 0, (13, 1) = 0, (13, 2) = 0, (13, 3) = 0, (13, 4) = 0, (13, 5) = 0, (13, 6) = 0, (13, 7) = 0, (13, 8) = 0, (13, 9) = 0, (13, 10) = 0, (13, 11) = 0, (13, 12) = 0, (13, 13) = 0, (13, 14) = 0, (13, 15) = 0, (13, 16) = 0, (13, 17) = 0, (13, 18) = 0, (13, 19) = 0, (13, 20) = 0, (13, 21) = 0, (13, 22) = 0, (13, 23) = 0, (13, 24) = 0, (13, 25) = 0, (14, 1) = 0, (14, 2) = 0, (14, 3) = 0, (14, 4) = 0, (14, 5) = 0, (14, 6) = 0, (14, 7) = 0, (14, 8) = 0, (14, 9) = 0, (14, 10) = 0, (14, 11) = 0, (14, 12) = 0, (14, 13) = 0, (14, 14) = 0, (14, 15) = 0, (14, 16) = 0, (14, 17) = 0, (14, 18) = 0, (14, 19) = 0, (14, 20) = 0, (14, 21) = 0, (14, 22) = 0, (14, 23) = 0, (14, 24) = 0, (14, 25) = 0, (15, 1) = 0, (15, 2) = 0, (15, 3) = 0, (15, 4) = 0, (15, 5) = 0, (15, 6) = 0, (15, 7) = 0, (15, 8) = 0, (15, 9) = 0, (15, 10) = 0, (15, 11) = 0, (15, 12) = 0, (15, 13) = 0, (15, 14) = 0, (15, 15) = 0, (15, 16) = 0, (15, 17) = 0, (15, 18) = 0, (15, 19) = 0, (15, 20) = 0, (15, 21) = 0, (15, 22) = 0, (15, 23) = 0, (15, 24) = 0, (15, 25) = 0, (16, 1) = 0, (16, 2) = 0, (16, 3) = 0, (16, 4) = 0, (16, 5) = 0, (16, 6) = 0, (16, 7) = 0, (16, 8) = 0, (16, 9) = 0, (16, 10) = 0, (16, 11) = 0, (16, 12) = 0, (16, 13) = 0, (16, 14) = 0, (16, 15) = 0, (16, 16) = 0, (16, 17) = 0, (16, 18) = 0, (16, 19) = 0, (16, 20) = 0, (16, 21) = 0, (16, 22) = 0, (16, 23) = 0, (16, 24) = 0, (16, 25) = 0, (17, 1) = 0, (17, 2) = 0, (17, 3) = 0, (17, 4) = 0, (17, 5) = 0, (17, 6) = 0, (17, 7) = 0, (17, 8) = 0, (17, 9) = 0, (17, 10) = 0, (17, 11) = 0, (17, 12) = 0, (17, 13) = 0, (17, 14) = 0, (17, 15) = 0, (17, 16) = 0, (17, 17) = 0, (17, 18) = 0, (17, 19) = 0, (17, 20) = 0, (17, 21) = 0, (17, 22) = 0, (17, 23) = 0, (17, 24) = 0, (17, 25) = 0, (18, 1) = 0, (18, 2) = 0, (18, 3) = 0, (18, 4) = 0, (18, 5) = 0, (18, 6) = 0, (18, 7) = 0, (18, 8) = 0, (18, 9) = 0, (18, 10) = 0, (18, 11) = 0, (18, 12) = 0, (18, 13) = 0, (18, 14) = 0, (18, 15) = 0, (18, 16) = 0, (18, 17) = 0, (18, 18) = 0, (18, 19) = 0, (18, 20) = 0, (18, 21) = 0, (18, 22) = 0, (18, 23) = 0, (18, 24) = 0, (18, 25) = 0, (19, 1) = 0, (19, 2) = 0, (19, 3) = 0, (19, 4) = 0, (19, 5) = 0, (19, 6) = 0, (19, 7) = 0, (19, 8) = 0, (19, 9) = 0, (19, 10) = 0, (19, 11) = 0, (19, 12) = 0, (19, 13) = 0, (19, 14) = 0, (19, 15) = 0, (19, 16) = 0, (19, 17) = 0, (19, 18) = 0, (19, 19) = 0, (19, 20) = 0, (19, 21) = 0, (19, 22) = 0, (19, 23) = 0, (19, 24) = 0, (19, 25) = 0, (20, 1) = 0, (20, 2) = 0, (20, 3) = 0, (20, 4) = 0, (20, 5) = 0, (20, 6) = 0, (20, 7) = 0, (20, 8) = 0, (20, 9) = 0, (20, 10) = 0, (20, 11) = 0, (20, 12) = 0, (20, 13) = 0, (20, 14) = 0, (20, 15) = 0, (20, 16) = 0, (20, 17) = 0, (20, 18) = 0, (20, 19) = 0, (20, 20) = 0, (20, 21) = 0, (20, 22) = 0, (20, 23) = 0, (20, 24) = 0, (20, 25) = 0, (21, 1) = 0, (21, 2) = 0, (21, 3) = 0, (21, 4) = 0, (21, 5) = 0, (21, 6) = 0, (21, 7) = 0, (21, 8) = 0, (21, 9) = 0, (21, 10) = 0, (21, 11) = 0, (21, 12) = 0, (21, 13) = 0, (21, 14) = 0, (21, 15) = 0, (21, 16) = 0, (21, 17) = 0, (21, 18) = 0, (21, 19) = 0, (21, 20) = 0, (21, 21) = 0, (21, 22) = 0, (21, 23) = 0, (21, 24) = 0, (21, 25) = 0, (22, 1) = 0, (22, 2) = 0, (22, 3) = 0, (22, 4) = 0, (22, 5) = 0, (22, 6) = 0, (22, 7) = 0, (22, 8) = 0, (22, 9) = 0, (22, 10) = 0, (22, 11) = 0, (22, 12) = 0, (22, 13) = 0, (22, 14) = 0, (22, 15) = 0, (22, 16) = 0, (22, 17) = 0, (22, 18) = 0, (22, 19) = 0, (22, 20) = 0, (22, 21) = 0, (22, 22) = 0, (22, 23) = 0, (22, 24) = 0, (22, 25) = 0, (23, 1) = 0, (23, 2) = 0, (23, 3) = 0, (23, 4) = 0, (23, 5) = 0, (23, 6) = 0, (23, 7) = 0, (23, 8) = 0, (23, 9) = 0, (23, 10) = 0, (23, 11) = 0, (23, 12) = 0, (23, 13) = 0, (23, 14) = 0, (23, 15) = 0, (23, 16) = 0, (23, 17) = 0, (23, 18) = 0, (23, 19) = 0, (23, 20) = 0, (23, 21) = 0, (23, 22) = 0, (23, 23) = 0, (23, 24) = 0, (23, 25) = 0, (24, 1) = 0, (24, 2) = 0, (24, 3) = 0, (24, 4) = 0, (24, 5) = 0, (24, 6) = 0, (24, 7) = 0, (24, 8) = 0, (24, 9) = 0, (24, 10) = 0, (24, 11) = 0, (24, 12) = 0, (24, 13) = 0, (24, 14) = 0, (24, 15) = 0, (24, 16) = 0, (24, 17) = 0, (24, 18) = 0, (24, 19) = 0, (24, 20) = 0, (24, 21) = 0, (24, 22) = 0, (24, 23) = 0, (24, 24) = 0, (24, 25) = 0, (25, 1) = 0, (25, 2) = 0, (25, 3) = 0, (25, 4) = 0, (25, 5) = 0, (25, 6) = 0, (25, 7) = 0, (25, 8) = 0, (25, 9) = 0, (25, 10) = 0, (25, 11) = 0, (25, 12) = 0, (25, 13) = 0, (25, 14) = 0, (25, 15) = 0, (25, 16) = 0, (25, 17) = 0, (25, 18) = 0, (25, 19) = 0, (25, 20) = 0, (25, 21) = 0, (25, 22) = 0, (25, 23) = 0, (25, 24) = 0, (25, 25) = 0})

 

2, true, [`?`]

 

3, true, [`?`]

 

4, false, Matrix(16, 16, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (1, 6) = 0, (1, 7) = 0, (1, 8) = 0, (1, 9) = 0, (1, 10) = 0, (1, 11) = 0, (1, 12) = 0, (1, 13) = 0, (1, 14) = 0, (1, 15) = 0, (1, 16) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (2, 6) = 0, (2, 7) = 0, (2, 8) = 0, (2, 9) = 0, (2, 10) = 0, (2, 11) = 0, (2, 12) = 0, (2, 13) = 0, (2, 14) = 0, (2, 15) = 0, (2, 16) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 0, (3, 4) = 0, (3, 5) = 0, (3, 6) = 0, (3, 7) = 0, (3, 8) = 0, (3, 9) = 0, (3, 10) = 0, (3, 11) = 0, (3, 12) = 0, (3, 13) = 0, (3, 14) = 0, (3, 15) = 0, (3, 16) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 0, (4, 5) = 0, (4, 6) = 0, (4, 7) = 0, (4, 8) = 0, (4, 9) = 0, (4, 10) = 0, (4, 11) = 0, (4, 12) = 0, (4, 13) = 0, (4, 14) = 0, (4, 15) = 0, (4, 16) = 0, (5, 1) = 0, (5, 2) = 0, (5, 3) = 0, (5, 4) = 0, (5, 5) = 0, (5, 6) = 0, (5, 7) = 0, (5, 8) = 0, (5, 9) = 0, (5, 10) = 0, (5, 11) = 0, (5, 12) = 0, (5, 13) = 0, (5, 14) = 0, (5, 15) = 0, (5, 16) = 0, (6, 1) = 0, (6, 2) = 0, (6, 3) = 0, (6, 4) = 0, (6, 5) = 0, (6, 6) = 0, (6, 7) = 0, (6, 8) = 0, (6, 9) = 0, (6, 10) = 0, (6, 11) = 0, (6, 12) = 0, (6, 13) = 0, (6, 14) = 0, (6, 15) = 0, (6, 16) = 0, (7, 1) = 0, (7, 2) = 0, (7, 3) = 0, (7, 4) = 0, (7, 5) = 0, (7, 6) = 0, (7, 7) = 0, (7, 8) = 0, (7, 9) = 0, (7, 10) = 0, (7, 11) = 0, (7, 12) = 0, (7, 13) = 0, (7, 14) = 0, (7, 15) = 0, (7, 16) = 0, (8, 1) = 0, (8, 2) = 0, (8, 3) = 0, (8, 4) = 0, (8, 5) = 0, (8, 6) = 0, (8, 7) = 0, (8, 8) = 0, (8, 9) = 0, (8, 10) = 0, (8, 11) = 0, (8, 12) = 0, (8, 13) = 0, (8, 14) = 0, (8, 15) = 0, (8, 16) = 0, (9, 1) = 0, (9, 2) = 0, (9, 3) = 0, (9, 4) = 0, (9, 5) = 0, (9, 6) = 0, (9, 7) = 0, (9, 8) = 0, (9, 9) = 0, (9, 10) = 0, (9, 11) = 0, (9, 12) = 0, (9, 13) = 0, (9, 14) = 0, (9, 15) = 0, (9, 16) = 0, (10, 1) = 0, (10, 2) = 0, (10, 3) = 0, (10, 4) = 0, (10, 5) = 0, (10, 6) = 0, (10, 7) = 0, (10, 8) = 0, (10, 9) = 0, (10, 10) = 0, (10, 11) = 0, (10, 12) = 0, (10, 13) = 0, (10, 14) = 0, (10, 15) = 0, (10, 16) = 0, (11, 1) = 0, (11, 2) = 0, (11, 3) = 0, (11, 4) = 0, (11, 5) = 0, (11, 6) = 0, (11, 7) = 0, (11, 8) = 0, (11, 9) = 0, (11, 10) = 0, (11, 11) = 0, (11, 12) = 0, (11, 13) = 0, (11, 14) = 0, (11, 15) = 0, (11, 16) = 0, (12, 1) = 0, (12, 2) = 0, (12, 3) = 0, (12, 4) = 0, (12, 5) = 0, (12, 6) = 0, (12, 7) = 0, (12, 8) = 0, (12, 9) = 0, (12, 10) = 0, (12, 11) = 0, (12, 12) = 0, (12, 13) = 0, (12, 14) = 0, (12, 15) = 0, (12, 16) = 0, (13, 1) = 0, (13, 2) = 0, (13, 3) = 0, (13, 4) = 0, (13, 5) = 0, (13, 6) = 0, (13, 7) = 0, (13, 8) = 0, (13, 9) = 0, (13, 10) = 0, (13, 11) = 0, (13, 12) = 0, (13, 13) = 0, (13, 14) = 0, (13, 15) = 0, (13, 16) = 0, (14, 1) = 0, (14, 2) = 0, (14, 3) = 0, (14, 4) = 0, (14, 5) = 0, (14, 6) = 0, (14, 7) = 0, (14, 8) = 0, (14, 9) = 0, (14, 10) = 0, (14, 11) = 0, (14, 12) = 0, (14, 13) = 0, (14, 14) = 0, (14, 15) = 0, (14, 16) = 0, (15, 1) = 0, (15, 2) = 0, (15, 3) = 0, (15, 4) = 0, (15, 5) = 0, (15, 6) = 0, (15, 7) = 0, (15, 8) = 0, (15, 9) = 0, (15, 10) = 0, (15, 11) = 0, (15, 12) = 0, (15, 13) = 0, (15, 14) = 0, (15, 15) = 0, (15, 16) = 0, (16, 1) = 0, (16, 2) = 0, (16, 3) = 0, (16, 4) = 0, (16, 5) = 0, (16, 6) = 0, (16, 7) = 0, (16, 8) = 0, (16, 9) = 0, (16, 10) = 0, (16, 11) = 0, (16, 12) = 0, (16, 13) = 0, (16, 14) = 0, (16, 15) = 0, (16, 16) = 0})

 

5, false, Matrix(25, 25, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (1, 6) = 0, (1, 7) = 0, (1, 8) = 0, (1, 9) = 0, (1, 10) = 0, (1, 11) = 0, (1, 12) = 0, (1, 13) = 0, (1, 14) = 0, (1, 15) = 0, (1, 16) = 0, (1, 17) = 0, (1, 18) = 0, (1, 19) = 0, (1, 20) = 0, (1, 21) = 0, (1, 22) = 0, (1, 23) = 0, (1, 24) = 0, (1, 25) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (2, 6) = 0, (2, 7) = 0, (2, 8) = 0, (2, 9) = 0, (2, 10) = 0, (2, 11) = 0, (2, 12) = 0, (2, 13) = 0, (2, 14) = 0, (2, 15) = 0, (2, 16) = 0, (2, 17) = 0, (2, 18) = 0, (2, 19) = 0, (2, 20) = 0, (2, 21) = 0, (2, 22) = 0, (2, 23) = 0, (2, 24) = 0, (2, 25) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 0, (3, 4) = 0, (3, 5) = 0, (3, 6) = 0, (3, 7) = 0, (3, 8) = 0, (3, 9) = 0, (3, 10) = 0, (3, 11) = 0, (3, 12) = 0, (3, 13) = 0, (3, 14) = 0, (3, 15) = 0, (3, 16) = 0, (3, 17) = 0, (3, 18) = 0, (3, 19) = 0, (3, 20) = 0, (3, 21) = 0, (3, 22) = 0, (3, 23) = 0, (3, 24) = 0, (3, 25) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 0, (4, 5) = 0, (4, 6) = 0, (4, 7) = 0, (4, 8) = 0, (4, 9) = 0, (4, 10) = 0, (4, 11) = 0, (4, 12) = 0, (4, 13) = 0, (4, 14) = 0, (4, 15) = 0, (4, 16) = 0, (4, 17) = 0, (4, 18) = 0, (4, 19) = 0, (4, 20) = 0, (4, 21) = 0, (4, 22) = 0, (4, 23) = 0, (4, 24) = 0, (4, 25) = 0, (5, 1) = 0, (5, 2) = 0, (5, 3) = 0, (5, 4) = 0, (5, 5) = 0, (5, 6) = 0, (5, 7) = 0, (5, 8) = 0, (5, 9) = 0, (5, 10) = 0, (5, 11) = 0, (5, 12) = 0, (5, 13) = 0, (5, 14) = 0, (5, 15) = 0, (5, 16) = 0, (5, 17) = 0, (5, 18) = 0, (5, 19) = 0, (5, 20) = 0, (5, 21) = 0, (5, 22) = 0, (5, 23) = 0, (5, 24) = 0, (5, 25) = 0, (6, 1) = 0, (6, 2) = 0, (6, 3) = 0, (6, 4) = 0, (6, 5) = 0, (6, 6) = 0, (6, 7) = 0, (6, 8) = 0, (6, 9) = 0, (6, 10) = 0, (6, 11) = 0, (6, 12) = 0, (6, 13) = 0, (6, 14) = 0, (6, 15) = 0, (6, 16) = 0, (6, 17) = 0, (6, 18) = 0, (6, 19) = 0, (6, 20) = 0, (6, 21) = 0, (6, 22) = 0, (6, 23) = 0, (6, 24) = 0, (6, 25) = 0, (7, 1) = 0, (7, 2) = 0, (7, 3) = 0, (7, 4) = 0, (7, 5) = 0, (7, 6) = 0, (7, 7) = 0, (7, 8) = 0, (7, 9) = 0, (7, 10) = 0, (7, 11) = 0, (7, 12) = 0, (7, 13) = 0, (7, 14) = 0, (7, 15) = 0, (7, 16) = 0, (7, 17) = 0, (7, 18) = 0, (7, 19) = 0, (7, 20) = 0, (7, 21) = 0, (7, 22) = 0, (7, 23) = 0, (7, 24) = 0, (7, 25) = 0, (8, 1) = 0, (8, 2) = 0, (8, 3) = 0, (8, 4) = 0, (8, 5) = 0, (8, 6) = 0, (8, 7) = 0, (8, 8) = 0, (8, 9) = 0, (8, 10) = 0, (8, 11) = 0, (8, 12) = 0, (8, 13) = 0, (8, 14) = 0, (8, 15) = 0, (8, 16) = 0, (8, 17) = 0, (8, 18) = 0, (8, 19) = 0, (8, 20) = 0, (8, 21) = 0, (8, 22) = 0, (8, 23) = 0, (8, 24) = 0, (8, 25) = 0, (9, 1) = 0, (9, 2) = 0, (9, 3) = 0, (9, 4) = 0, (9, 5) = 0, (9, 6) = 0, (9, 7) = 0, (9, 8) = 0, (9, 9) = 0, (9, 10) = 0, (9, 11) = 0, (9, 12) = 0, (9, 13) = 0, (9, 14) = 0, (9, 15) = 0, (9, 16) = 0, (9, 17) = 0, (9, 18) = 0, (9, 19) = 0, (9, 20) = 0, (9, 21) = 0, (9, 22) = 0, (9, 23) = 0, (9, 24) = 0, (9, 25) = 0, (10, 1) = 0, (10, 2) = 0, (10, 3) = 0, (10, 4) = 0, (10, 5) = 0, (10, 6) = 0, (10, 7) = 0, (10, 8) = 0, (10, 9) = 0, (10, 10) = 0, (10, 11) = 0, (10, 12) = 0, (10, 13) = 0, (10, 14) = 0, (10, 15) = 0, (10, 16) = 0, (10, 17) = 0, (10, 18) = 0, (10, 19) = 0, (10, 20) = 0, (10, 21) = 0, (10, 22) = 0, (10, 23) = 0, (10, 24) = 0, (10, 25) = 0, (11, 1) = 0, (11, 2) = 0, (11, 3) = 0, (11, 4) = 0, (11, 5) = 0, (11, 6) = 0, (11, 7) = 0, (11, 8) = 0, (11, 9) = 0, (11, 10) = 0, (11, 11) = 0, (11, 12) = 0, (11, 13) = 0, (11, 14) = 0, (11, 15) = 0, (11, 16) = 0, (11, 17) = 0, (11, 18) = 0, (11, 19) = 0, (11, 20) = 0, (11, 21) = 0, (11, 22) = 0, (11, 23) = 0, (11, 24) = 0, (11, 25) = 0, (12, 1) = 0, (12, 2) = 0, (12, 3) = 0, (12, 4) = 0, (12, 5) = 0, (12, 6) = 0, (12, 7) = 0, (12, 8) = 0, (12, 9) = 0, (12, 10) = 0, (12, 11) = 0, (12, 12) = 0, (12, 13) = 0, (12, 14) = 0, (12, 15) = 0, (12, 16) = 0, (12, 17) = 0, (12, 18) = 0, (12, 19) = 0, (12, 20) = 0, (12, 21) = 0, (12, 22) = 0, (12, 23) = 0, (12, 24) = 0, (12, 25) = 0, (13, 1) = 0, (13, 2) = 0, (13, 3) = 0, (13, 4) = 0, (13, 5) = 0, (13, 6) = 0, (13, 7) = 0, (13, 8) = 0, (13, 9) = 0, (13, 10) = 0, (13, 11) = 0, (13, 12) = 0, (13, 13) = 0, (13, 14) = 0, (13, 15) = 0, (13, 16) = 0, (13, 17) = 0, (13, 18) = 0, (13, 19) = 0, (13, 20) = 0, (13, 21) = 0, (13, 22) = 0, (13, 23) = 0, (13, 24) = 0, (13, 25) = 0, (14, 1) = 0, (14, 2) = 0, (14, 3) = 0, (14, 4) = 0, (14, 5) = 0, (14, 6) = 0, (14, 7) = 0, (14, 8) = 0, (14, 9) = 0, (14, 10) = 0, (14, 11) = 0, (14, 12) = 0, (14, 13) = 0, (14, 14) = 0, (14, 15) = 0, (14, 16) = 0, (14, 17) = 0, (14, 18) = 0, (14, 19) = 0, (14, 20) = 0, (14, 21) = 0, (14, 22) = 0, (14, 23) = 0, (14, 24) = 0, (14, 25) = 0, (15, 1) = 0, (15, 2) = 0, (15, 3) = 0, (15, 4) = 0, (15, 5) = 0, (15, 6) = 0, (15, 7) = 0, (15, 8) = 0, (15, 9) = 0, (15, 10) = 0, (15, 11) = 0, (15, 12) = 0, (15, 13) = 0, (15, 14) = 0, (15, 15) = 0, (15, 16) = 0, (15, 17) = 0, (15, 18) = 0, (15, 19) = 0, (15, 20) = 0, (15, 21) = 0, (15, 22) = 0, (15, 23) = 0, (15, 24) = 0, (15, 25) = 0, (16, 1) = 0, (16, 2) = 0, (16, 3) = 0, (16, 4) = 0, (16, 5) = 0, (16, 6) = 0, (16, 7) = 0, (16, 8) = 0, (16, 9) = 0, (16, 10) = 0, (16, 11) = 0, (16, 12) = 0, (16, 13) = 0, (16, 14) = 0, (16, 15) = 0, (16, 16) = 0, (16, 17) = 0, (16, 18) = 0, (16, 19) = 0, (16, 20) = 0, (16, 21) = 0, (16, 22) = 0, (16, 23) = 0, (16, 24) = 0, (16, 25) = 0, (17, 1) = 0, (17, 2) = 0, (17, 3) = 0, (17, 4) = 0, (17, 5) = 0, (17, 6) = 0, (17, 7) = 0, (17, 8) = 0, (17, 9) = 0, (17, 10) = 0, (17, 11) = 0, (17, 12) = 0, (17, 13) = 0, (17, 14) = 0, (17, 15) = 0, (17, 16) = 0, (17, 17) = 0, (17, 18) = 0, (17, 19) = 0, (17, 20) = 0, (17, 21) = 0, (17, 22) = 0, (17, 23) = 0, (17, 24) = 0, (17, 25) = 0, (18, 1) = 0, (18, 2) = 0, (18, 3) = 0, (18, 4) = 0, (18, 5) = 0, (18, 6) = 0, (18, 7) = 0, (18, 8) = 0, (18, 9) = 0, (18, 10) = 0, (18, 11) = 0, (18, 12) = 0, (18, 13) = 0, (18, 14) = 0, (18, 15) = 0, (18, 16) = 0, (18, 17) = 0, (18, 18) = 0, (18, 19) = 0, (18, 20) = 0, (18, 21) = 0, (18, 22) = 0, (18, 23) = 0, (18, 24) = 0, (18, 25) = 0, (19, 1) = 0, (19, 2) = 0, (19, 3) = 0, (19, 4) = 0, (19, 5) = 0, (19, 6) = 0, (19, 7) = 0, (19, 8) = 0, (19, 9) = 0, (19, 10) = 0, (19, 11) = 0, (19, 12) = 0, (19, 13) = 0, (19, 14) = 0, (19, 15) = 0, (19, 16) = 0, (19, 17) = 0, (19, 18) = 0, (19, 19) = 0, (19, 20) = 0, (19, 21) = 0, (19, 22) = 0, (19, 23) = 0, (19, 24) = 0, (19, 25) = 0, (20, 1) = 0, (20, 2) = 0, (20, 3) = 0, (20, 4) = 0, (20, 5) = 0, (20, 6) = 0, (20, 7) = 0, (20, 8) = 0, (20, 9) = 0, (20, 10) = 0, (20, 11) = 0, (20, 12) = 0, (20, 13) = 0, (20, 14) = 0, (20, 15) = 0, (20, 16) = 0, (20, 17) = 0, (20, 18) = 0, (20, 19) = 0, (20, 20) = 0, (20, 21) = 0, (20, 22) = 0, (20, 23) = 0, (20, 24) = 0, (20, 25) = 0, (21, 1) = 0, (21, 2) = 0, (21, 3) = 0, (21, 4) = 0, (21, 5) = 0, (21, 6) = 0, (21, 7) = 0, (21, 8) = 0, (21, 9) = 0, (21, 10) = 0, (21, 11) = 0, (21, 12) = 0, (21, 13) = 0, (21, 14) = 0, (21, 15) = 0, (21, 16) = 0, (21, 17) = 0, (21, 18) = 0, (21, 19) = 0, (21, 20) = 0, (21, 21) = 0, (21, 22) = 0, (21, 23) = 0, (21, 24) = 0, (21, 25) = 0, (22, 1) = 0, (22, 2) = 0, (22, 3) = 0, (22, 4) = 0, (22, 5) = 0, (22, 6) = 0, (22, 7) = 0, (22, 8) = 0, (22, 9) = 0, (22, 10) = 0, (22, 11) = 0, (22, 12) = 0, (22, 13) = 0, (22, 14) = 0, (22, 15) = 0, (22, 16) = 0, (22, 17) = 0, (22, 18) = 0, (22, 19) = 0, (22, 20) = 0, (22, 21) = 0, (22, 22) = 0, (22, 23) = 0, (22, 24) = 0, (22, 25) = 0, (23, 1) = 0, (23, 2) = 0, (23, 3) = 0, (23, 4) = 0, (23, 5) = 0, (23, 6) = 0, (23, 7) = 0, (23, 8) = 0, (23, 9) = 0, (23, 10) = 0, (23, 11) = 0, (23, 12) = 0, (23, 13) = 0, (23, 14) = 0, (23, 15) = 0, (23, 16) = 0, (23, 17) = 0, (23, 18) = 0, (23, 19) = 0, (23, 20) = 0, (23, 21) = 0, (23, 22) = 0, (23, 23) = 0, (23, 24) = 0, (23, 25) = 0, (24, 1) = 0, (24, 2) = 0, (24, 3) = 0, (24, 4) = 0, (24, 5) = 0, (24, 6) = 0, (24, 7) = 0, (24, 8) = 0, (24, 9) = 0, (24, 10) = 0, (24, 11) = 0, (24, 12) = 0, (24, 13) = 0, (24, 14) = 0, (24, 15) = 0, (24, 16) = 0, (24, 17) = 0, (24, 18) = 0, (24, 19) = 0, (24, 20) = 0, (24, 21) = 0, (24, 22) = 0, (24, 23) = 0, (24, 24) = 0, (24, 25) = 0, (25, 1) = 0, (25, 2) = 0, (25, 3) = 0, (25, 4) = 0, (25, 5) = 0, (25, 6) = 0, (25, 7) = 0, (25, 8) = 0, (25, 9) = 0, (25, 10) = 0, (25, 11) = 0, (25, 12) = 0, (25, 13) = 0, (25, 14) = 0, (25, 15) = 0, (25, 16) = 0, (25, 17) = 0, (25, 18) = 0, (25, 19) = 0, (25, 20) = 0, (25, 21) = 0, (25, 22) = 0, (25, 23) = 0, (25, 24) = 0, (25, 25) = 0})

(3)

Download Using_basic_linear_algebra.mw

Hello! I need to write some text (a string) and some data in a file on the hard drive. Something like

"Hello, it is me"

3.1415

These two things written in two different consecutives lines in a file called /home/PNL/test_file.txt

I have tried WriteString, WriteFile but I failed miserably. Thank you very much!

How to specify the number of digits shown in the output of CrossProduct?  I've tried specifying the number of digits with Digits:=5: but CrossProduct seems to ignore that. I thought maybe setting the CrossProduct datatype to float might help, but it didn't.

What do I need to do?

I don't know if this is a false memory, but I think that I saw once a command in Maple that make a list of all the assumptions that have been done i the output space. A command that could be named "ListAssumption()" and you would get that list. In fact, I was wondering if this list could be shown in the palettes "Variables." There could be, below the variables, another table with the first row the name of the letter that you made an assume on, and the second row (the value) would show the assumption.  Like this maybe:

Just to get an idea.  Do you think it would be a great idea?

Hello Everyone,

I am wondring if I can  find the StandardRepresentation of a subalgebra of simple Lie algebra?

For example I have this code:

with(DifferentialGeometry);
with(LieAlgebras);
with(Library);
with(LinearAlgebra);

G := SimpleLieAlgebraData("sl(6)", sl6);
DGsetup(G);
StandardRepresentation(sl6);
M3 := MinimalSubalgebra([e30, e35, e20]);
B3 := LieAlgebraData(M3, p62);
Query("Jacobi");
DGsetup(B3);
StandardRepresentation(p62);
Error, (in DifferentialGeometry:-LieAlgebras:-StandardRepresentation) expected a Lie algebra constructed by the procedure SimpleLieAlgebraData
 

For the first StandardRepresentation(sl6); it works becouse of the definition. Now what I want the same idea for the subalgebra. How can I do that?

 

Any idea why Maple returns empty string when asked for the latex of the Laplace of x(t)?  Am I doing anything wrong here? I do not see it

interface(version);

`Standard Worksheet Interface, Maple 2024.2, Windows 10, October 29 2024 Build ID 1872373`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1828 and is the same as the version installed in this computer, created 2024, November 18, 7:25 hours Pacific Time.`

libname;

"C:\Users\Owner\maple\toolbox\2024\Physics Updates\lib", "C:\Program Files\Maple 2024\lib"

restart;

e:=inttrans:-laplace(x(t),t,s)

laplace(x(t), t, s)

latex(e,'output'='string')

""

 

 

Download latex_of_laplace_nov_21_2024.mw

I was expecting something like this using another software

Did Maple always behave this way for Laplace? I do not have earlier version now to check.  Any workaround?

Is this a known error when using PDEtools:-Solve? I get no error using solve on same input, so thought to ask, just in case it should not happen.

For now, I will change my code to use solve for this.

I am basically solving two equations in Laplace domain for Y1(s) and Y2(s). But since there are initial conditions x(0) and y(0) in the equations, and Laplace has L(x(t),t,s)  then PDEtools:-Solve is not happy, as it sees x(t) and x(0) in same input.

But solve has no problem with this. Who is correct? solve or Solve?

interface(version);

`Standard Worksheet Interface, Maple 2024.2, Windows 10, October 29 2024 Build ID 1872373`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1828 and is the same as the version installed in this computer, created 2024, November 18, 7:25 hours Pacific Time.`

libname;

"C:\Users\Owner\maple\toolbox\2024\Physics Updates\lib", "C:\Program Files\Maple 2024\lib"

restart;

sys:=[s*laplace(x(t),t,s)-x(0) = -3*laplace(x(t),t,s)+4*laplace(y(t),t,s)+1/(s^2+1), s*laplace(y(t),t,s)-y(0) = -2*laplace(x(t),t,s)+3*laplace(y(t),t,s)+1/s^2];
Ys:=[laplace(x(t),t,s), laplace(y(t),t,s)];

[s*laplace(x(t), t, s)-x(0) = -3*laplace(x(t), t, s)+4*laplace(y(t), t, s)+1/(s^2+1), s*laplace(y(t), t, s)-y(0) = -2*laplace(x(t), t, s)+3*laplace(y(t), t, s)+1/s^2]

[laplace(x(t), t, s), laplace(y(t), t, s)]

solve(sys,Ys);

[[laplace(x(t), t, s) = (x(0)*s^5+4*y(0)*s^4-3*x(0)*s^4+x(0)*s^3+4*y(0)*s^2-3*x(0)*s^2+s^3+s^2+4)/((s^4-1)*s^2), laplace(y(t), t, s) = (y(0)*s^5+3*y(0)*s^4-2*x(0)*s^4+y(0)*s^3+3*y(0)*s^2-2*x(0)*s^2+s^3+s^2+s+3)/((s^4-1)*s^2)]]

PDEtools:-Solve(sys,Ys)

Error, (in PDEtools:-Solve) found functions with same name but depending on different arguments in the given DE system: x(0), x(t). Specification of the dependent variables is required

 

 

Download differenece_between_solve_and_Solve_nov_20_2024.mw

I have an irreducible polynomial f (over the rationals) with degree n. When I ask for the roots (using solve(f=0)), Maple outputs a sequence of roots, and somehow distinguishes between them. How does it do this? I had assumed that, when working with a RootOf, Maple would just figure out it was supposed to work in Q[x]/< f >, the quotient of the polynomials with rational coefficients by the principle ideal generated by f. In this field, it doesn't matter which of the n roots of f is represented by x + < f >, since all the roots satisfy the same algebraic relations (from this field).

Given this, I'm really interested to know how Maple can somehow distinguish between the roots, enough to be able to use them to recover distinct solutions to a polynomial system (by substituting in the different roots of f). Does it somehow "choose" an embedding of Q[x]/< f > into the complex numbers?

Thanks in advance!

Any reason why the display of a fairly large plot in Maple 2024 (only show a print screen here)


be worst then the display of the same plot in Maple 2020

In 2024, it seams to be rasterized, while in 2020 it is still in vector form. Also the plot does not resize as well in 2024 compare to 2020. Any hint would help!

Maybe large plot are displayed in raster image, there is probably a setting somewhere in the documentation. When I export both are in vector format...

Thanks!

I am experimenting using the this format of  Vector( [Vector] ) to make projective vectors a different data type to Vectors. I don't want to use 1 x 3 or 3 x 1 matrices. The format holds some promise.
I would like to be able to copy the Maple format of Vector or Vector[column]    and Vector[row] for my varaition. 

ProjVectoC and ProjVectorR    so ProjVector or ProjVector[column]   and ProjVector[row]
A secondary question  is on type checking (see previous question How to setup special type check in a procedure? - MaplePrimes  ). Would it be possible to have the type check return ProjVector[column] or ProjVector[row]?
The attached worksheet contains a procedure for factor reducing the vectors to to a minimal format of <x,y,z>. Also   Cross product and Dot product procedures to suit.

I am open to any efficiency improvements.

restart

interface(rtablesize=50)

[10, 10]

(1)

with(LinearAlgebra):

 

FactReduce:=overload([
     proc(v::{list,Vector})
          option overload;
          description " removes linear factor from",
                      " a list, vector, matrix or expression";
          uses LinearAlgebra;
          local i, num,tgdc,dnm, V1;
          num:=`ifelse`(type(v,Vector),numelems(v),nops(v));
          dnm:=frontend(lcm, [seq(denom(v[i]),i=1..num)]);
          V1:=radnormal(v*~dnm);
          tgdc:=V1[1];

          for i from 2 to num do
               tgdc:=frontend(gcd, [tgdc, V1[i]]);
          end do;

          return  simplify(V1/~tgdc);
     end proc,

     proc(M::{Matrix})
          option overload;
          uses LinearAlgebra;
          local i, num,r,c, tgdc,dnm, V1, Ml;
          r,c:=Dimension(M);
          num:=r*c;
          V1:=convert(M,list);
          dnm:=frontend(lcm, [seq(denom(V1[i]),i=1..num)]);
          Ml:=radnormal(dnm*~M);
          V1:=convert(Ml,list);#print((dnm,V1));
          tgdc:=V1[1];#print("xx")

          for i from 2 to num do
               tgdc:=frontend(gcd, [tgdc, V1[i]])
          end do;

          return  simplify(Ml/~tgdc);   
     end proc,

     proc(l::{`+`,`*`,`=`, `symbol`,procedure},  {vars::list:=[:-x,:-y]})
          option overload;
          uses LinearAlgebra;
          local i, num,f1,f1a,lv,lr, tgdc,dnm, V1,Vs;
          f1 := `if`(l::procedure, l(vars[]), l);
               f1a:=`if`(f1::`=`,lhs(f1)-rhs(f1),f1)  ; # Remequal(f1);
          lr:=primpart(f1a,vars);
          return lr
end proc

]):

ProjVectorC := proc(a, b, c)
local cfs, vectr;
description " A Projective Column (Line) Vector in Reduced format";
cfs := FactReduce([a, b, c]);
vectr := <[<cfs>]>;
end proc:

 

ProjVectorR := proc(a, b, c)
local cfs, vectr;
description " A Projective Row (Point) Vector";
cfs := sign(c)*FactReduce([a, b, c]);
vectr := <[<cfs>^%T]>^%T;
end proc:

 

`&otimes;` := proc(A, B)
local cp;
description "Cross Product of Projective Vectors in Reduced format";
cp :=sign(c)* FactReduce(LinearAlgebra:-`&x`(A[1], B[1]))^%T;
cp := ifelse(cp[3] <> 0, <[sign(cp[3]) *~ cp]>, cp); #makes sure format is [x,y,z] and not [x,y-z]
end proc:

 

`&odot;` := proc(A, B)
description "Dot Product of Projective Vectors";
(A[1]) . (B[1]);
end proc:

 

V := ProjVectorR(2, 4, -6); W := ProjVectorR(11, 7, 5); S := ProjVectorC(6, -18, 24)

Vector[column](%id = 36893490982610361748)

(2)

whattype(V); `~`[whattype](V)

Vector[row](%id = 36893490982610825812)

(3)

whattype(S); `~`[whattype](S)

Vector[column](%id = 36893490982626471436)

(4)

`~`[whattype](V[1])

Vector[row](%id = 36893490982558545668)

(5)

V[1] . V[1]

14

(6)

`&odot;`(V, V)

14

(7)

R := `&otimes;`(W, V)

Vector[column](%id = 36893490982630825980)

(8)

R := `&otimes;`(V, W)

Vector[column](%id = 36893490982630903548)

(9)

whattype(R)

Vector[column]

(10)

`~`[whattype](R)

Vector[column](%id = 36893490982598861396)

(11)

`~`[whattype](R[1])

Vector[column](%id = 36893490982598866092)

(12)

`&otimes;`(R, S)

Vector[column](%id = 36893490982624872076)

(13)

`&odot;`(R, S)

-85

(14)

`&odot;`(W, R)

0

(15)

`&odot;`(R, `<,>`([`<,>`(x, y, 1)]))

15-31*x+38*y

(16)
 

 

Download 2024-11-21_Q_Projective_Vector_Format.mw

The following is not a profound problem, and there is an obvious solution,

but it came up, and I would like to learn more about it.

 

Even though I recommend the add procedure when summing up individual entities,

my students keep showing me how smart the sum procedure is. Which makes

our worksheets more readable and reproducible for Maple users who are less frequent.

 

For example:

 

restart; Xlist := [1, 2, 3]; N := numelems(Xlist)

3

Using palette icon:

sum(Xlist[n], n = 1 .. N)

6

Cool!  Which means

sum(Xlist[n], n = 1 .. N)

6

But if we use the same palette icon for a vector

Xvector := convert(Xlist, Vector); sum(Xvector[n], n = 1 .. N)

Error, bad index into Vector

Because I believe this fails

sum(Xvector[n], n = 1 .. N)

Error, bad index into Vector

 

Would someone please teach me how I can see why the sum of a list

works, but does the sum of a vector fail?

Download MaplePrimes_sum_list_vector.mw

First 52 53 54 55 56 57 58 Last Page 54 of 2425