Items tagged with error


Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/Question.mw .

Hello, Maple is giving me the error:

"Error, (in simplify/table) too many levels of recursion"
 

Once I take the integral of an expression I am getting the error. It starts at the first integral of the document. 

Note: If I make another maple worksheet and write the expression of the integral without writing it shorthand by substituting the functions in it seems to give me an answer. 

For example instead of the integral of say, y(x)*f(x) I would write out the definitions of the functions in the integral and it would give me an answer while the former would give me the error. 

I have uploaded the document, Any help would be appreciated. I'm not sure if there is a fix or not. Thanks

Question.mw
Download Question.mw

Hello,

I tried to define the Poisson bracket in this way

restart:
Ps:=proc(f,g)
local P;
P:=simplify(diff(f,P[1])*diff(g,X)-diff(f,X)*diff(g,P[1])+
diff(f,P[2])*diff(g,Y)-diff(f,Y)*diff(g,P[2]));
end;

The problem is that, if I ask Ps(P[1],X) I got 0 which is clearly wrong.

Where is the error?

https://dl.dropboxusercontent.com/u/51122291/Scrreshot.jpeg

Thanks Nicola 

I have tried to solve the following ode equation, but I have got error. What is the potencial problem?

http://i65.tinypic.com/xdcl8p.jpg

 

 error

 

When I use the Determinant function on a matrix with (single variable) polynomial entries with real coefficients I often get an incorrect answer. I know the answers are incorrect because they have a higher degree or a lower lowest degree than is possible given the matrix elements.

However, when I replace the coefficients in the polynomials with rational numbers or I put in the option method=minor, I get the correct answer.

The problem seems to be roundoff error. However, the important error is not simply small changes in the resulting polynomial. The important error is the presence of entirely incorrect powers of the variable and not with very small coefficients.

How does this happen and why does the help page for Determinant( ) not warn of this behavior? In particuiar, why does the help page not say that using Gaussian elimination (i.e., the default) will often give incorrect answers in such cases, but using method=minor will work? Is this behavior known? I cannot find any reference to it on the internet.

 

In Maple V, Release 4 (1996):

 

T:=table():
i:=1:N:=5000;

for i from i to N  
do
   T[i]:=T[i+1]:
   T[i+1]:=1;
   eval(T[1]);
od:
print(i);

for i from i to N  
do
   T[i]:=T[i+1]:
   T[i+1]:=1;
   eval(T[1]);
od:
print(i);

I receive this output:

N := 5000
Error, too many levels of recursion
3607
5001

Can You explain this occurence, as well as the following one:

In Maple V, Release 4 (1996):

 

T:=table():
i:=1:N:=5000;

for i from i to N  
do
  T[i]:=T[i+1]:
  eval(T[1]);
od:
print(i);
 
for i from i to N  
do
  T[i]:=T[i+1]:
  eval(T[1]);
od:
print(i);;

gives:

N := 5000
Error, too many levels of recursion
3607
Error, too many levels of recursion
3607

How does one control allowance for recursion depth?

HI there,

 

I have the following problem: I want to improve the runtime of my script (Maple 2016) and want to use multithreading/tasking.

First I have this script (let's start with an easy example):

>restart;
  with(LinearAlgebra): 
  with(Student[MultivariateCalculus]):
  with(plots):
  with(Statistics):
  with(Threads):
  with(RealDomain): #I know, I don't need all of that here

>cdf := x-> int(PDF(GammaDistribution(4.5/100,2.5),xi-0.068),xi=0.068..x):
>N:= 20:
>sample := (i) -> solve( (1/(2*(N+1))+1/(N+1)*i)=cdf(x),x): #this is an equidistant sampling

> smpl := [Seq(sample(i),i=1..(N-1))]; #I try to run a multithread seq -> got it from the documentation

   Error, (in assuming) when calling 'Engine:-Process'. Received: 'type `System` does not exist'

I get this error message, but I don't really know what to do with it. I googled and searched, but I couldn't find useful help. Note that when I run this command, I still use only one processor (at least until it returns the error). I also tried:

>smpl := Map(sample,sample_dists);>N:= 20:
   Error, (in assuming) when calling 'Engine:-Process'. Received: 'type `System` does not exist'

I also tried to implement it with threads:

> cont := proc()
      global mutex_sample, smpl:
      smpl := [op(smpl), _passed]: #add the results of the tasks to the smpl var.
      print("Sampling Done");
   end proc:

> sample := proc(cdf, min, max, N) #samle the region
      local output:
      seq(solve(,x),i=0..(N-1)); #return value
   end proc:

> startSampling := proc()
      local sampling_tasks,i:

      print("Starting Sampling!");
      sampling_tasks := []:
      for i from 1 to kernelopts(numcpus) do #for each processor
          sampling_tasks := [op(sampling_tasks), Task=[sample, cdf, i/(kernelopts(numcpus)+1),(i+1)/(kernelopts(numcpus)+1),ceil(N/kernelopts(numcpus))]]; #sample a region
      end do:

      print("Starting Sampling Tasks!");
      Threads:-Task:-Continue( cont, op(sampling_tasks)); #start sampling threads
      print("Sampling Tasks started!");
   end proc:

> Threads:-Task:-Start( startSampling ); #start everything

"Starting Sampling!"
"Starting Sampling Tasks!"
"Sampling Tasks started!"
Error, (in assuming) when calling 'Engine:-Process'. Received: 'type `System` does not exist'

 I know I'm doing here something systematically wrong, but I can't figure it out.

I would be very greatful, for your help or insiged.  

 

EDIT: 
1) The presented script might doesn't make sense (or might be pointless), because I have a much larger and more complex (model) in my original script. But, my script didn't work (exactly same error). So, I tried this simple example, to figure out what the problem is. But it didn't work either. I thought, it might be better (didactically) to find the problem in the simple code. It might be easier to explain in a forum and easier to analyse. (SO I could then see why my more complex code is not working).

2) I was running the script in Linux (Ubuntu 16.04 x64) and it produced this error. I also run the script in Windows 10.2 where I got the same error (and sometimes I got an "Maple Kernel cannot be reached" message where I had to restart Maple.

3) I noticed that solve sometimes returns a complex solution (usually it returned: "value + 0.0 I"). I therefore added "with(RealDomain): ", which had the consequence that some sample points were "NULL". I know that, and that is another issue, which I'm not bothered about (right now).

SOLUTION: (most likely)
Thanks to everyone who replied. But Carl_Love probably is right by pointing out that int, solve, fsolve ... are not thread-safe and therefore caused the crahses/error messages, while calling thesefunctions in different threads.