资 源 简 介
Bernstein-poly is a simple code for numerical solution of differential equations implementing original collocation method using Bernstein polynomials.
Two point BVPs
We start with two-point boundary value problems for ordinary differential equations. Our main goal is to make a code implementing collocation method using Bernstein polynomials to solve Navier-Stokes equations in three dimensions.
The code is written in two versions: in modern Fortran and in Python.
Writing down a differential equation is very simple.
Suppose, we want to solve following two-point BVP:
y""(x) + y(x) = x2e-x
for x in [0,20], and y(0) = 0, y(20) = 0
To define differential operator:
y""(x) + y(x)
you just have to write:
lhs = bernstein_basis_fun_derivative(2,j,n,a,b,x) + bernstein_basis_fun_eval(j,n,a,b,x)
To define right-hand side:
rhs = x**2./(