vv

13560 Reputation

20 Badges

9 years, 211 days

MaplePrimes Activity


These are questions asked by vv

Executing the entire worksheet several times I obtain random results for Threads:-Seq

restart;

N:=10^3;
f:= (a,b) -> add(evalf(j), j=a..b);

1000

 

proc (a, b) options operator, arrow; add(evalf(j), j = a .. b) end proc

(1)

seq(f(k*N/4+1,(k+1)*N/4), k=0..3);

31375., 93875., 156375., 218875.

(2)

Threads:-Seq(f(k*N/4+1,(k+1)*N/4), k=0..3);

31218.+j, 93875., 156375., 218875.

(3)

Threads:-Seq(f(k*N/4+1,(k+1)*N/4), k=0..3);

31375., 93875., 156375., 218875.

(4)

Threads:-Seq(f(k*N/4+1,(k+1)*N/4), k=0..3);

31900., 94170., 156375., 218875.

(5)

 


Download threads!.mw

It seems that the forum activity of the user  Markiyan Hirnyk   is no longer accessible.
Is it a site problem?

sys:={x+y=10,x^2-y^2+z^2=1};

{x+y = 10, x^2-y^2+z^2 = 1}

(1)

isolve(sys, n);

{x = -(1/20)*(1+20*n)^2+101/20, y = (1/20)*(1+20*n)^2+99/20, z = 1+20*n}

(2)

_SolutionsMayBeLost;  # It was set in Maple 10 or so!  E.g. x=5,y=5,z=-1 is not found.

_SolutionsMayBeLost

(3)

# Workaround

yz:=eliminate(sys,x);

[{x = -y+10}, {z^2-20*y+99}]

(4)

S:=isolve(yz[2], n);

{y = 20*n^2-38*n+23, z = 19-20*n}, {y = 20*n^2-22*n+11, z = 11-20*n}, {y = 20*n^2-18*n+9, z = 9-20*n}, {y = 20*n^2-2*n+5, z = 1-20*n}

(5)

map(u -> ( u union eval(yz[1],u) ), [S])[];  # The correct solution

{x = -20*n^2+38*n-13, y = 20*n^2-38*n+23, z = 19-20*n}, {x = -20*n^2+22*n-1, y = 20*n^2-22*n+11, z = 11-20*n}, {x = -20*n^2+18*n+1, y = 20*n^2-18*n+9, z = 9-20*n}, {x = -20*n^2+2*n+5, y = 20*n^2-2*n+5, z = 1-20*n}

(6)

 

 

restart;

with(IntegrationTools):

# A very simple double integral

J:=Int(Int(x^2, x = 0 .. y), y = 0 .. 1);

Int(Int(x^2, x = 0 .. y), y = 0 .. 1)

(1)

value(J);

1/12

(2)

# Try a simple change of variables

Change(J, x=t*y, [t]);   # Why this form?

Intat(Intat(_a^2, _a = _b)-Intat(_a^2, _a = 0), _b = 1)-Intat(Intat(_a^2, _a = _b)-Intat(_a^2, _a = 0), _b = 0)

(3)

value(%);

1/12

(4)

# Now the same for 2*J

Change(2*J, x=t*y, [t]);  # OK, but why?

2*(Int(y^3*(Int(t^2, t = 0 .. 1)), y = 0 .. 1))

(5)

value(%);

1/6

(6)

 


Download IntegrationTools-Change.mw

Consider the `or` procedure.
`or`(x, y)  should be equivalent to  x  or  y.

However:
restart;
x := a=0;
y := b=0;

                           x := a = 0
                           y := b = 0
x or y;
                             false
`or`(x,y);
                         a = 0 or b = 0
%;
                             false
simplify(`or`(x,y));
                         a = 0 or b = 0
eval(`or`(x,y));
                             false


### So,  `or`(x,y)  is not fully evaluated [or simplified?].
### Is this documented somewhere?


# Similarly
`not`(x);
                           not a = 0
%;
                              true
not x;
                              true

 

4 5 6 7 8 9 10 Page 6 of 13