Hi there,

first post. I am a beginner both with Maple and this forum, so please forgive my mistakes. Just here to learn.

I could not successfully use the Maple editor here, so the code goes as plain text, although I also attach the code: MapleSimulation_test.mw.

I am trying to simulate the function below for certain values of the parameters, but when executing the loop, Maple prints just R. Can anyone tell me where my error is, please?

f := .25; g := 1; R[0] = 5; R[1] = 4.8; nDays := 30;

lambda1:=(1 - f + sqrt((1 - f) + 4*g*f)*1/2;

lambda2:=(1 - f - sqrt((1 - f) + 4*g*f)*1/2;

-lambda2*R[0] + R[1]

k1:=--------------------------;

lambda1 - lambda2

lambda2*R[0] - R[1]

k2:=-------------------------;

lambda1 - lambda2

R:=n-> k1*lambda1^n + k2*lambda2^n

for n from 2 to nDays

do R:=evalf(subs(n=%,R));

od;