#7560: len(t_span) > 2 case creates len(t_span) -  1 solutions
-------------------------+--------------------------------------------------
   Reporter:  adavid     |       Owner:  jkantor 
       Type:  defect     |      Status:  new     
   Priority:  minor      |   Milestone:  sage-4.3
  Component:  numerical  |    Keywords:  t_span  
Work_issues:             |      Author:          
   Upstream:  N/A        |    Reviewer:          
     Merged:             |  
-------------------------+--------------------------------------------------
 From: Ryan

 {{{
 Hello all,

 I've just started using Sage, and I'm currently trying to use the
 ode_solver class to solve some simple differential equations. I was
 having some problems setting up my own program based on this class
 until I realized that the number of points in the solution does not
 match the number of points requested by the t_span variable. For
 example, when I run this script:
 _________
 #!/usr/bin/env sage-python
 from sage.all import ode_solver

 def f(t, y):
    return [y[1], -y[0]]
 T = ode_solver()
 T.function=f
 T.y_0=[1, 1]
 T.ode_solve(t_span=[0, 10], num_points=100)
 print len(T.solution)
 T.ode_solve(t_span=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
 print len(T.solution)
 _________

 I get returned values of 101 and 10, where I would expect 100 and 11.

 I don't know about the first case, but for the second case, the
 solution for the last value (10) is missing. I was able to circumvent
 this problem by appending a dummy variable to the end of t_span, but
 I'm wondering if this is the expected behavior. Is there something
 about the solution that I'm missing? I am currently using Sage 4.2.1
 that I built from source in a Gentoo Linux distro.
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7560>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

--

You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.


Reply via email to