## Getting the error of "Error, (in simplify/table) t...

Asked by:

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

## Recursive sequence ...

Asked by:

hi every one, i would like to know if it is possible to implement the following recursive sequence in Maple :

q(1)       = q(0)        +q_dot(0)
q_dot(1)  = q_dot(0)  +q_ddot(0)
q_ddot(1) = q_ddot(0)+q_dddot

q(2)       = q(1)        +q_dot(1)   = (q(0)+q_dot(0)) + (q_dot(0)+q_ddot(0)) = q(0)+2q_dot(0)+q_ddot(0)
q_dot(2)  = q_dot(1)  +q_ddot(1)
q_ddot(2) = q_ddot(1)+q_dddot

q(3)      = q(2)        +q_dot(2)=(q(0)+2q_dot(0)+q_ddot(0))+(q_dot(1)+q_ddot(1))= q(0)+3q_dot(0)+q_ddot(0)+q_dddot
q_dot(3) = q_dot(2)  +q_ddot(2)
q_ddot(3)= q_ddot(2)+q_dddot

I would like every q(n) to be expressed as following : q(n)=q(0)+n_1*q_dot(0)+n_2*q_ddot(0)+n_3*q_dddot.

By computing manually some sequences i am now sure that :
n_1=n
n_2=(n²-n)/2
n_3=?? (I would like to find this one)

The sequence can be written in a more general way as following :
q(n)        = q(n-1) + q_dot(n-1)
q_dot(n)   = q_dot(n-1) + q_ddot(n-1)
q_ddot(n) =q_ddot(n-1)+q_dddot

Can you guys please show me how this can be implementes in Maple ?

Thanks in advance

## Generating a table with iteration...

Asked by:

I would like to generate a table with expansions of the formula  for different values of t, perhaps with an Explore function over t. How could I achieve this?

## Recursive procedure of piecewise ...

Asked by:

Hi, I'm new to Maple and I have to produce a recursive procedure with the nomenclature Puis:=proc(X,n::integer) which calculates X^n with:

for n<0   ->   1/(X^(-n))

for n=0  ->   1

for n being an even integer   ->   X^(n/2) * X^(n/2)

for n being an odd integer   ->   X*X^(n-1)

The procedure I produced is:

Puis:=proc(X,n::integer)
option remember;
if n<0 then Puis(X,-n);
elif n=0 then 1;
elif rem(n,2,x)=0 then Puis(X,n);
else X*Puis(X,n-1);
end if;
end proc;

i don't have any eror up to this point, but when I try to evaluate, only Puis(4,0) works

Puis(4,-1);
Error, (in content) too many levels of recursion
Puis(4,0);
1
Puis(4,3);
Error, (in content) too many levels of recursion
Puis(4,4);
Error, (in content) too many levels of recursion

I was wondering what was wrong with my procedure, I changed the 1/(X^(-n)) with X^n and X^(n/2)*X^(n/2) for X^n because it is equivalent. I think I should put some sort of initial value to limit the recursion, but with that kind of function i really don't know how. I also tried with the X^(n/2)*X^(n/2) for the even numbers, but it says Puis expects its 2nd argument, n, to be of type integer, but received 1/2.

## Extending diff for procedure...

Asked by:

Hi

I wrote a custom recursive procedure to calculate some value (it is an implementation of a recursive algorithm)
During the further calculations derivatives of this procedure occur. Because of the statements in the specific procedure the automatic diff of a procedure does not work (at least I think that is the reason). However this is no problem as the differentiation is far from simple. L'hopitals rule needs to be used when necessary and Maple cannot detect when it needs to be used automatically (because there is another function, implicitly defined involved).
Therefore I am looking to write my own diff procedure as an extension. From the manual I gathered that this can be done as such `diff/name_of_type' =... however my procedure is not a type and I cannot easily write a 'type/name_of_type' function to define it as such. Can someone help me out?

I've made a toy example:

toy_example.mw

I know that in the case of this toy example other ways are possible.
What I need is a way to write my own procedure to evaluate the differential (D[1](A))(1,2,3);

Possibly defining procedure A as a type and writing 'diff/A'=proc...

Thanks

## too many levels of recursion when trying to plot r...

Asked by:

I'm trying to plot the graph of a recursive function in Maple 17 but I keep getting the error Error, (in f) too many levels of recursion.

I need to plot a logarithmic graph in the range of x=1,...40. Here is the code:

``````with(plots);
f:=x->(2.25*f(x-1)-0.5*f(x-2));
f(1):=1/3;
f(2):=1/12;
logplot(f(x),1..40);
``````

How can I fix this problem? Maybe I need to write it in an iterative form, but I don't know how. Thank you very much for any help!

## Value.............................

Asked by:

Hi:

how obtain value a4 from below equation in maple:

a[0]=1

a[n+2]=a[0]+a[n+1]

## How do I iterate this function using the @@ operat...

Asked by:

I can get the function to iterate as a recursive function by just reevaluating the x := evalf(x-(f1*j-i*g1)/(h*k-i*j), 25); y := evalf(y-(h*g1-f1*j)/(h*k-i*j), 25) portion of the function below but im trying beneath it to assign it as newt2d so that i can iterate it as newtons method in two variables like (newt2d@@10) and I can't seem to figure out what im doing wrong. Thanks for any help you can provide!

f := proc (x, y) options operator, arrow; x+y-cos(x)+sin(y-1) end proc; f1 := f(x, y)

(x, y) -> x + y - cos(x) + sin(y - 1)
x + y - cos(x) + sin(y - 1)

> g := proc (x, y) options operator, arrow; x^4+y^4-2*x*y end proc; g1 := g(x, y);

(x, y) -> x + y - 2 x y
x + y - 2 x y

> dh := D[1](f); h := dh(x, y);

(x, y) -> 1 + sin(x)
1 + sin(x)

> di := D[2](f); i := di(x, y);

(x, y) -> 1 + cos(y - 1)
1 + cos(y - 1)

> dj := D[1](g); j := dj(x, y);

(x, y) -> 4 x - 2 y
4 x - 2 y

> dk := D[2](g); k := dk(x, y);

(x, y) -> 4 y - 2 x
4 y - 2 x

x := .3; y := .8

0.3
0.8

> x := evalf(x-(f1*j-i*g1)/(h*k-i*j), 25); y := evalf(y-(h*g1-f1*j)/(h*k-i*j), 25);

0.2924403963319692595180140
0.8321243516906678979858730

> newt2d(.3, .8);

0.2577789764, 0.8333916830

> (newt2d@@5)(.3, .8);

Error, (in @@) invalid arguments

## rsolve when n doesn't start at 0...

Asked by:

For the recursive equation

xn − 10xn−1 + 50xn−2 = 0
n = 2, 3, ...
x0 = 0
x1 = 10

How do I calculate xn in Maple? I'm wondering because n doesn't start at 0 but at 2, how will that make a difference?

Thanks in advance!

## rsolve() recursive inhomogenous equation...

Asked by:

I want to use maple to solve the following recursive inhomogenous equation:

Xn+2 - 5xn+1 6xn = 4n+1

I thought I could write like this:

but it doesn't work. I get the error message

"Error, (in rsolve/single) equation false = 0 does not involve function F()"

How should I write in order to solve it?

## recursive assignment...

Asked by:

Hello !

I installed Maple 14 on my windows8 computer (with compatibility windows7). My program worked the 2 first times, and suddently it bugged on the third, though I changed NOTHING.

It puts me an "Error: recursive assignment". The concerned line is:

if a < 2 then broSet := broSet union {[param[1, j], param[2, i]]} fi:

There should be no problem.

Does anyone have any idea ?

## Stop Recursive Assignment...

Asked by:

Hi

Long story short I had a detailed question and then the session timed out and killed it!

Quickly then, if we calculate something recursively Maple acts differently to other languages.

For example, in Python:

__________________________________________

>>>t=1;

>>>t+=1;

>>>print t;

___________________________________________

Is interpreted as:

__________________________________________

>>>t=1;

>>>t=t+1=2

>>>print t

2

___________________________________________

In Maple:

___________________________________________

>t:=1

>t:=t+1

>print(t)

___________________________________________

Is Interpreted as:

___________________________________________

>t=1

>t=t+1=1+1=2

>print(t); t=t+1=1+1=2

2

____________________________________________
And there in lies my problem. Logically, I wish to use a iterative algorithm to work out an expression of the nth derivative of a function from the (n-1) derivative. However, doing this is in maple brings up "error (in Test) too many levels of recursion".

For context, Minimum Working Example:

____________________________________________

>TestFunction:=(x)->cos(exp(-1/x^2))*F(x):

>limit(TestFunction(x),x=0)

F(0)

>TestDerivative:=(x)->eval(diff(TestFunction(y),y),y=x):

>limit(TestDerivative(x),x=0)

D(F)(0)

>for i from 1 to 50 do
print(D^(i)(TestFunction)(0)=limit(TestDerivative(x),x=0));

TestDerivative:=(x)->eval(diff(TestDerivative(y),y),y=x):

od:

D(TestFunction)(0)=D(F)(0)

Error, (in TestDerivative) too many levels of recursion

_______________________________________________

Ideally, this code would output the limit of the second derivative at zero by differentiating the first derivative and then the limit of the third derivative at zero by differentiating the second derivative etc. But what Maple is trying to do is to find the limit of the second derivative by differentiating the function then differentiating the result of that, then to find the limit of the third derivative it will first derivative by differentiate the function, then the second by differentiating the result, then third derivative by differentiating the result of that. If I have the analytic expression for the 5th derivative and I wanted the expression for the 6th derivative, I do not want to work out the 1st, 2nd, 3rd, 4th and then 5th derivative when I've already an of the expression of the 5th derivative!

I will note, it is possible to avoid the problem by using different names at each step but that does not solve the iterative problem.  Is there anyway to force maple to overwrite a function name? Is there a seperate solution? Or is maple just that daft in this case?

Thanks for the help,

Hamzaan

## Optimizing a recursive procedure...

Asked by:

Dear Maple users

I am working on a problem, which basicly is dealing with putting n identical marbles in k different boxes. I need to run through all possible combinations and do something with it. The latter is unimportant. Mathematics say there are binomial(n+k-1,k-1) different combinations. I have already produced a recursive procedure to solve the problem and it is displayed below. I have placed a counter in the procedure to control if the procedures get through...

## Limit of Recursive Sequence...

Asked by:

Is there a way to have Maple compute the limit of a recursive sequence? For example, the sequence below

a_n = (a_(n-1) +2)/(a_(n-1) + 3), a_1 =2

is bounded and montonically decreasing, thus has a limit, but Maple is not able to compute the limit. Any ideas?

## recursive assignment...

Asked by:
`part of my codes are:`
`func[1] := (1/2)*(c+s)*x[1]+s*x[3]+(s-c)*x[1]*x[2];func[2] := (1/2)*(c-s)*x[1]+s*x[3]+(s+c)*x[1]*x[2];func[3] := -b*x[2]-x[1]^2; `
`They are just three ODE , how to fix the error?Where is the so-called recursive assignment...?`
`The program works well when:`
`"func[1] := x[2] + (x[1]^2 - x[1]*x[3]);`
`func[2] := - x[1] +  (x[2]^2 + x[1]*x[4]) + x[2]^3;`
 1 2 Page 1 of 2
﻿