## 571 Reputation

17 years, 283 days
Technical professional in industry or government
Budapest, Hungary

## abs and infinity together?...

It works good without abs:

piecewise(a<infinity,1,0);

## abs and infinity together?...

It works good without abs:

piecewise(a<infinity,1,0);

## Thanks...

I have checked the source of `&where` and I 'll check PDESolStruc.

## Thanks...

I have checked the source of `&where` and I 'll check PDESolStruc.

## Repeats...

Thank you for this nice solution.

It is bad that the Repeats command doesn't have an option to control the length or the minimum length of the repeating patterns to find and it would be also useful to have a Repeats command for searching repeating patterns in lists.

## Repeats...

Thank you for this nice solution.

It is bad that the Repeats command doesn't have an option to control the length or the minimum length of the repeating patterns to find and it would be also useful to have a Repeats command for searching repeating patterns in lists.

## searching for repeating patterns in a se...

Now, I am trying to find  repeating sequences with the maximum length in the first 10000 digits of Pi using the suggested StringTools package:

restart;

PiDigits:= StringTools[Delete](convert(evalf(Pi,10000),string),2..2): # this line is from Robert.

reps:=StringTools[Repeats](PiDigits): # repeating sequences in the digits of Pi

lngth:=seq(op(3,A),A in [reps]):M:=max(lngth); # finding the max length of the repeating sequences.

# the result is: M := 7 the max. length of the repeating patterns.

ns:=ListTools[SearchAll](M,[lngth]);

p1p2len:=seq(reps[op(i,[ns])],i=1..nops([ns]));
# p1p2len := [3503, 6116, 7], [4168, 4602, 7]  There are two repeating patterns with the max. length of 7 in the first 10000 digits of PI.

seq(PiDigits[op(k,[p1p2len])[1]..op(k,[p1p2len])[1]+op(k,[p1p2len])[3]-1],k=1..nops([p1p2len]));

# it gives "7111369", "8530614"  just for checking: the first occurances of the patterns

seq(PiDigits[op(k,[p1p2len])[2]..op(k,[p1p2len])[2]+op(k,[p1p2len])[3]-1],k=1..nops([p1p2len]));

# "7111369", "8530614" the second occurances of the patterns

It seems to work, but I am not sure, it is working with much more digits of PI.

## searching for repeating patterns in a se...

Now, I am trying to find  repeating sequences with the maximum length in the first 10000 digits of Pi using the suggested StringTools package:

restart;

PiDigits:= StringTools[Delete](convert(evalf(Pi,10000),string),2..2): # this line is from Robert.

reps:=StringTools[Repeats](PiDigits): # repeating sequences in the digits of Pi

lngth:=seq(op(3,A),A in [reps]):M:=max(lngth); # finding the max length of the repeating sequences.

# the result is: M := 7 the max. length of the repeating patterns.

ns:=ListTools[SearchAll](M,[lngth]);

p1p2len:=seq(reps[op(i,[ns])],i=1..nops([ns]));
# p1p2len := [3503, 6116, 7], [4168, 4602, 7]  There are two repeating patterns with the max. length of 7 in the first 10000 digits of PI.

seq(PiDigits[op(k,[p1p2len])[1]..op(k,[p1p2len])[1]+op(k,[p1p2len])[3]-1],k=1..nops([p1p2len]));

# it gives "7111369", "8530614"  just for checking: the first occurances of the patterns

seq(PiDigits[op(k,[p1p2len])[2]..op(k,[p1p2len])[2]+op(k,[p1p2len])[3]-1],k=1..nops([p1p2len]));

# "7111369", "8530614" the second occurances of the patterns

It seems to work, but I am not sure, it is working with much more digits of PI.

## thanks...

Thank Joe and Robert.

I thought the solution was based on the pattern matching in strings. It can be useful if Maple can do pattern matching in sequence of digits directly.

Zsolt

## thanks...

Thank Joe and Robert.

I thought the solution was based on the pattern matching in strings. It can be useful if Maple can do pattern matching in sequence of digits directly.

Zsolt

## I have reported the bug...

Thank you and Doug for the information. I didn't know this way.

## I have reported the bug...

Thank you and Doug for the information. I didn't know this way.

## bug report...

I haven't reported any bugs.  I would like to report it directly to Maplesoft, but the support page says that I should contact the local Maplesoft partner (I am in Europe) This is not convient for me. There should be a simple way to report bugs.

## bug report...

I haven't reported any bugs.  I would like to report it directly to Maplesoft, but the support page says that I should contact the local Maplesoft partner (I am in Europe) This is not convient for me. There should be a simple way to report bugs.

## CriticalPoints and Roots in the Student ...

You can use the CriticalPoints and the Roots commands of the Student package to solve your problem.

Try this:

restart;
with(plots):with(Student[Calculus1]):
a := 2; b := 1;
A := (a*b)^2/(8*cos(theta)*sin(theta)*(a*sin(theta)+b*cos(theta))^2);
Agraph:=plot(A,theta=-2..5,view=[-2..5,-15..15],numpoints=3000,color=red):