Here is how I would proceed (given that this is numerics it is
completely in numpy/scipy)

- I am assuming your free variable is x

1. Get k in a nice form
 - if they come from arrays, get interpolation functions for them:
`k_func=scipy.interpolate.interp1d(x_array,k_array)`
 - if they come from a known expression of x, u and u' just implement
it as a function

2. Rewrite the scalar second order ode into a vector first order ode
(this is maybe the most fundamental idea in numerical ode solving. It
is important because first order ODEs are "trivial" to solve by
iteration (not really, but you can search for the details))

u'' == f(u', u, x) becomes [v', u'] == [f(v, u, x), v] (i.e. just u' =
v). Now write a function `def my_first_derivative` that takes as an
argument [v, u] and returns [f(v, u, x), v]

3. Use the ode solver
solution_array = scipy.integrate.odeint(my_first_derivative,
initial_conditions_u_v, array_of_x_points)


Most importantly, read the documentation of the functions that I mentioned.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to