#In The Name of God#
Hello to every one. I need to solve a large system of first order ODE's:(i
is imaginary unit)
i*y'[t]=A[t].y[t]
to find PSI[t](a vector of n functions of t), given PSI[0]and A[t] (a
sparse matrix with linear terms of t as non-zero elements).
As a begginer Sage user, I tried to follow instructions in "Solving ODE
numerically by GSL" entry in Sage Documentation; for a small instance of my
system my code is as follows:
var('s','t','T')
A=matrix(A_elements_dict);
f=A(s=t/T)
reset('i');
reset('x');
def Sch(t,y):
return [ -i*sum(f[j,k]*y[j] for k in range(2^L)) for j in range(2^L)]
NL1=[1 for i in range(2^L)];
TS=ode_solver()
TS.algorithm = "rk4"
TS.function=Sch
TS.y_0 = NL1
TS.ode_solve(t_span=[0,T], num_points=100)
print TS.solution;
But this error raised:
File "/tmp/tmpwWuHMa/___code___.py", line 128, in <module>
TS.ode_solve(t_span=[_sage_const_0 ,T], num_points=_sage_const_100 )
File "ode.pyx", line 539, in sage.gsl.ode.ode_solver.ode_solve
(build/cythonized/sage/gsl/ode.c:5053)
ValueError: error solving
However,since this syntax results in (trivial) answer when I set A[t]=0, I
interpret that it means my code is correct (without syntax errors or loss
of predefinitions).
Can anyone help me to find out the bug?
As I stated before, I am still a begginer in Sage.
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.