scikits.bvp_solver can solve a Two-Point Boundary Value problem, of a Nonlinear Second-Order Differential Equation ?

56 views
Skip to first unread message

freeblue

unread,
Apr 1, 2013, 11:36:55 AM4/1/13
to scikits-b...@googlegroups.com
Hello to everyone here,

I am trying to solve the next equation :
http://www.wolframalpha.com/input/?i=d%2Fdx%28du%2Fdx%29+%3D+%28-3%2F%28k1%29[x]%29*%28k4[x]-%28k2[x]%2Bk3[x]%29*u^
%281%2F3%29%29+*%28%28du%2Fdx%29^%282%2F3%29%29
which has 2 boundary conditions (u(x=0)=0, u(x=n(max) = m (constant) is calculated) ...

Please, do someone knows if it is possible to solve this nth nonlinear second-order differential equation through scikits.bvp_solver ? (1D problem - x(1,n) , u(x), arrays parameters:bk1-k4 calculated on each x gridpoint), depended by an import data X, which is a 1D nth array (n grid points)

I cant understand how to use the boundary conditions, when I have an initial at x=o of u, and for its derivative du/dx = u' at x=n, the last gridpoint?

Moreover, the known parameters k1-k4, how I have to use them inside the callback function which evaluates the ODEs? Do i have to use a K parameter like that:
def my_function(u, K): ... and then ... k1 = K[0] ... etc ? this script will be inside a time loop, so these parameters are changing on each time loop, as the import data Array X change on each time step (new value is being calculated on each time step)

At the end, one more question about the  solution = scikits.bvp_solver.solve() ... I dont know the exact solution on this strange equation, what I suppose to write on this?

Theoretically this equation could be solved using the Newton iteration method, but its too complicated for my knowledge and my little experience to do that. I tried also through scipy.integrate.odeint without success..

Please, any help will be more than welcome!!!
Kas

Hwan

unread,
Apr 3, 2013, 11:28:20 PM4/3/13
to scikits-b...@googlegroups.com
To use the bvp solver, you can transform the 2nd order differential equation into a system of two 1st order equations. There are several examples in the website.

Hwan

Kit

unread,
Apr 28, 2013, 7:02:28 PM4/28/13
to scikits-b...@googlegroups.com
The boundary value problem you quoted is not time dependent. The only independent variable should be x. If this is not your case, then you are solving a PDE which may need other solver (e.g., check out method of lines in mathematica).

Yes, the parameters can be input as an array K[i]. However, since your equation depends on k(x) which is a known function (e.g., from your data at x_i), you can interpolate it first (e.g., using scipy interp1d function) and put it in your function.

Kit
Reply all
Reply to author
Forward
0 new messages