private void OnResultGeneratedCall(RKResult r) { if (OnResultGenerated != null) { OnResultGenerated(r, curveName); } }
private void rk_OnResultGenerated2(RKResult res, string curveName) { view.DrawPoint2(res.X, res.Y.GetValues(), curveName); }
private void rk_OnResGenForType2(RKResult res, string curveName) { view.DrawPhasePortret(res.X, res.Y.GetValues(), curveName); }
public RKResults SolveWithConstH(int N, RKMetodType type) { var res = new RKResults(); t.Clear(); z.Clear(); Func <double, Vector, double, Vector> RKfunc = null; switch (type) { case RKMetodType.RK4_1: RKfunc = RK4_1; break; case RKMetodType.RK4_2: RKfunc = RK4_2; break; case RKMetodType.RK3_1: RKfunc = RK3_1; break; case RKMetodType.RK3_2: RKfunc = RK3_2; break; case RKMetodType.RK2_1: RKfunc = RK2_1; break; case RKMetodType.RK2_2: RKfunc = RK2_2; break; } double h = (t1 - t0) / N; H = h; double x; Vector y; t.Add(t0); z.Add(Y0); var r = new RKResult(t0, Y0); res.Add(r); OnResultGeneratedCall(r); for (int i = 0; i < N; i++) { y = RKfunc(t[i], z[i], h); x = t0 + (i + 1) * h; t.Add(x); z.Add(y); r = new RKResult(x, y); res.Add(r); OnResultGeneratedCall(r); } if (OnSolvingDone != null) { OnSolvingDone(res, curveName, fe); } return(res); }
public RKResults SolveWithConstH(int N, RKMetodType type) { var res = new RKResults(); t.Clear(); z.Clear(); Func<double, Vector, double, Vector> RKfunc = null; switch (type) { case RKMetodType.RK4_1: RKfunc = RK4_1; break; case RKMetodType.RK4_2: RKfunc = RK4_2; break; case RKMetodType.RK3_1: RKfunc = RK3_1; break; case RKMetodType.RK3_2: RKfunc = RK3_2; break; case RKMetodType.RK2_1: RKfunc = RK2_1; break; case RKMetodType.RK2_2: RKfunc = RK2_2; break; } double h = (t1 - t0)/N; H = h; double x; Vector y; t.Add(t0); z.Add(Y0); var r = new RKResult(t0, Y0); res.Add(r); OnResultGeneratedCall(r); for (int i = 0; i < N; i++) { y = RKfunc(t[i], z[i], h); x = t0 + (i + 1)*h; t.Add(x); z.Add(y); r = new RKResult(x, y); res.Add(r); OnResultGeneratedCall(r); } if (OnSolvingDone != null) { OnSolvingDone(res, curveName, fe); } return res; }