snharding

5 Reputation

One Badge

10 years, 176 days

MaplePrimes Activity


These are questions asked by snharding

I am having issues when defining functions in a loop. First, I define the first two functions as follows (here, r(x) is a function already assigned).

 

f_0 := x -> r(x):

f_1 := x -> r(x)*f_0(r(x)):

 

Then, I define successive functions in a for loop as follows.

 

for i from 2 to 10 do

   f_i := x -> r(x)*f_[i - 1](r(x));

end do

 

The loop defines the function f_2 but compiles erroneously for f_3 which, and I do admit, relies on f_2. Does someone have an idea of how to fix this issue? Any help will be greatly appreciated. Thanks.

Page 1 of 1