| Im solving a system equation within a for loop, but it never ends But its ok to evaluate f1(n) outside the loop.... why? def f1(ll): where eqa is in the other hand this works so.. whats the problem with ode_solver?
Just to check: Are you solving Legendre's DE?
Mitesh Patel (Aug 22 '10)
yea, im just trying to learn Sage solving problems like this. for Pl(x)=x i found the eigenvalue l= 0.994838832387 using desolve_system_rk4. I just wanna to solve the problem using ode_solver and odeint.
ngativ (Aug 22 '10)
how i do backtrace? the script doesn't crash.... it just calculate forever
ngativ (Aug 23 '10)
Well... it seems to be that when the solver evaluates the function (eqa(t=1)) the solution diverges because the 1/t factor. But this doesn't happens with the desolver_system_rk4. i dont like this, maybe ode_solver is faster but.. it really has to have this kind of problems?
ngativ (Aug 23 '10) |
| It seems like this is just ridiculously slow, but I'm not sure why. I tried tweaking your code in a variety of ways and nothing helped. To try to figure out what was going on I wrote the following Runge-Kutta 4th order code in Cython; its pretty hackish but it makes it clear that the solution isn't doing anything very strange. The version below is hard-coded for your ll=2. and then you can get a plot with: Anyway for me it seems easier to implement such things directly than to wrestle with the GSL wrapping.
is a convergence problem for l!=1.
ngativ (Aug 28 '10) |
Asked: Aug 22 '10
Seen: 120 times
Last updated: Aug 27 '10
powered by ASKBOT version 0.7.22
Copyright Sage, 2010. Some rights reserved under creative commons license.