I've started using R to solve a complex equation. After generating the equation I tried to solve it using Ryacas
. Unfortunately, instead of giving me the result, Ryacas
returns the following:
CommandLine(1) : Max evaluation stack depth reached. Please use MaxEvalDepth to increase the stack size as needed.
CommandLine(1) : Max evaluation stack depth reached. Please use MaxEvalDepth to increase the stack size as needed.
Could you please tell me how to increase that stack size through Ryacas
? I've tried to do it in many ways, but I really don't know how to make use of the advice that Ryacas
gave me.
===== Edit =======
So here's the code that leads to generating an equation that I want to solve.
#define net and gross values
net=10000
gross=12563.49
#construct an array for cash flows
flows=matrix(nrow=1, ncol=60)
#populate the array with cash flows
flows[c(1:60)]=c(-297.21)
#generate the equation
#flows
eq1=NULL
for (i in 1:60) {
eq1=paste(eq1," + ", toString(flows[i]),"/((1 + x)^(",i, "/60)", ") ", collapse="")
}
#complete
equation=paste(toString(net), eq1, " == ", toString(gross), collapse="")
I then try to solve it using Solve(equation, "x").