private double c(int n, int snum) { StageInfo stage = stages[snum]; if (!stage.c_dirty[n]) { return(stage.c[n]); } double ret; if (n == 0) { ret = b(0, snum) * stage.T - b(1, snum); } else { ret = c(n - 1, snum) * stage.tau - stage.v_e * MuUtils.IntPow(stage.T, n + 1) / (n * (n + 1)); } stage.c[n] = ret; stage.c_dirty[n] = false; return(ret); }
private double b(int n, int snum) { StageInfo stage = stages[snum]; if (!stage.b_dirty[n]) { return(stage.b[n]); } double ret; if (n == 0) { ret = stage.dV; } else { ret = b(n - 1, snum) * stage.tau - stage.v_e * MuUtils.IntPow(stage.T, n) / n; } stage.b[n] = ret; stage.b_dirty[n] = false; return(ret); }