c# - solving complexed ODE set

前端 未结 1 1416
刺人心
刺人心 2021-01-06 19:44

Introduction Some sets od ODE can\'t be solved analytically. In this case there are plenty of well-know methods, especially in typical scientific software l

相关标签:
1条回答
  • 2021-01-06 20:01

    You should be able to use

    var sol = Ode.RK547M(0, new Vector(5.0, 1.0),
        (t, u) => {
            double x=u[0], y=u[1];
            double a=x*2+7, b=y*x+3;
            double c = additional_solve(b, x);
            return new Vector(
                x - x*y + a + c,
                -y +x*y + b
            );
         });
    

    as the long form of a lambda delegate definition, that is, using that x => x*x is short for x => { return x*x; } which is short for delegate(x) { return x*x; } and so on.

    0 讨论(0)
提交回复
热议问题