vv

5201 Reputation

9 Badges

3 years, 114 days

MaplePrimes Activity


These are questions asked by vv

add(add(1,i=1..j),j=1..4);

10

(1)

S:=%add(%add(1,i=1..j),j=1..4);

%add(%add(1, i = 1 .. j), j = 1 .. 4)

(2)

value(S);

Error, (in value) unable to execute add

 

It seems that the inner add is evaluated prematurely.

 

eval(subs(%add=add, S));  # ok

10

(3)

subs[eval](%add=add, S);  # ?

Error, unable to execute add

 

 

 

A strange fact about filenames. 
Some  filenames containing the "%" character cannot be loaded by Maple.  E.g.  "%add.mw"  or "xx%abyy.mw".  But "xx%yy.mw" is OK.
This happens in Windows, but I suspect that it is not OS related.  It seems that Maple is trying to do some hex manipulations with the filename.

 

A simple (?)  int and too many levels of recursion

 

J := Int(cos(2*x)/(1+2*sin(3*x)^2), x = 0 .. Pi);

Int(cos(2*x)/(1+2*sin(3*x)^2), x = 0 .. Pi)

(1)

evalf[30](J);

-0.321451052376028387436461558651e-32

(2)

value(J);

Error, (in csgn) too many levels of recursion

 

 

 

The workaround I know (for J = 0) it is not very simple.
Can you find an easy one?

 

 

Download int-too-many-levels-of-recursion.mw

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)

 

1 2 3 4 5 6 7 Page 1 of 8