我已经开始使用 R 来解决一个复杂的方程。生成方程后,我尝试使用Ryacas
. 不幸的是,不是给我结果,而是Ryacas
返回以下内容:
CommandLine(1):达到最大评估堆栈深度。请根据需要使用 MaxEvalDepth 增加堆栈大小。
CommandLine(1):达到最大评估堆栈深度。请根据需要使用 MaxEvalDepth 增加堆栈大小。
你能告诉我如何增加堆栈大小Ryacas
吗?我尝试了很多方法,但我真的不知道如何利用Ryacas
给我的建议。
===== 编辑 =======
所以这是导致生成我想要求解的方程的代码。
#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="")
然后我尝试使用解决它Solve(equation, "x").