Sat Feb 5 17:50:33 2022 odefun_test(): Python version: 3.6.9 Demonstrate the use of the mpmath multiple precision function odefun() to solve some simple ordinary differential equations (ODE) odefun_test01(): odefun() solves the ODE: y = y Exact solution is y(x) = exp(x) Use 15 digit arithmetic: (0.0, 1.0, 1.0) (1.0, 2.71828182845905, 2.71828182845905) (2.5, 12.1824939607035, 12.1824939607035) Use 50 digit arithmetic: (0.0, 1.0, 1.0) (1.0, 2.7182818284590452353602874713526624977572470937, 2.7182818284590452353602874713526624977572470937) (2.5, 12.182493960703473438070175951167966183182767790063, 12.182493960703473438070175951167966183182767790063) odefun_test02(): ODE: y = y Use 15 digit arithmetic and vector form of ODE. ([1.0], 1.0) ([2.71828182845905], 2.71828182845905) ([12.1824939607035], 12.1824939607035) Use 50 digit arithmetic and vector form of ODE. ([1.0], 1.0) ([2.7182818284590452353602874713526624977572470937], 2.7182818284590452353602874713526624977572470937) ([12.182493960703473438070175951167966183182767790063], 12.182493960703473438070175951167966183182767790063) odefun_test03(): Solve nonlinear ODE: y = x*sin(y) Use 15 digit arithmetic. (2.87255666284091, 2.87255666284091) (3.14158520028345, 3.14158520028345) (3.14159265358979, 3.14159265358979) Use 50 digit arithmeticE. (2.8725566628409117191074779550054627306546626704065, 2.8725566628409117191074779550054627306546626704065) (3.1415852002834491156243575719681632794591593184052, 3.1415852002834491156243575719681632794591593184052) (3.1415926535897932384622576333099101006405659308118, 3.1415926535897932384622576333099101006405659308118) odefun_test04(): Solve autonomous nonlinear ODE: y = (1+x**2)/(1+x**3) Compare solution to quadrature result. odefun() solution at 2 pi: 0.72128263801696 quadrature at 2 pi: 0.72128263801696 odefun_test05(): ODE: y0 = -y1 y1 = y0 [1.0, 0.0] [1.0, 0.0] --- [0.54030230586814, 0.841470984807897] [0.54030230586814, 0.841470984807897] --- [-0.801143615546934, 0.598472144103957] [-0.801143615546934, 0.598472144103957] --- [-0.839071529076452, -0.54402111088937] [-0.839071529076452, -0.54402111088937] --- odefun_test(): Normal end of execution. Sat Feb 5 17:51:04 2022