Use lambdify(). Aaron Meurer
On Wed, Jun 12, 2013 at 1:06 PM, Shawn Garbett <shawn.garb...@gmail.com> wrote: > I'm struggling with the most direct route to use a time series numpy array > to get a time series back from a SymPy equation. > > Ideally I'd like to call something like sol.evalf(x), but that doesn't work. > I have a loop structure that does it at present, but the continual > reconstructing a dict causes the processor to heat up and the fans come on. > I figure, there has to be a shorter / better / direct method. I'm at a loss > to find it. > > Here's what the data looks like: > > In [212]: sol > Out[212]: 1.0e-6*s4 + 1.0e-12*s6 > > In [213]: x > Out[213]: > array([(1.0, 0.33, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0), > (7.332991703456984e-07, 0.06344978343322456, 1.0, > 1.9622076748233104e-10, 0.7332991703050197, 0.266668723224782, > 3.1373201206573815e-05, 1.1995787763723961e-07), > (6.853150238285165e-07, 0.015615017796943445, 1.0, > 2.359623438104902e-09, 0.6853150237422331, 0.31460014764904676, > 8.41433121893229e-05, 6.888955138586781e-07), > ..., > (7.447520789346351e-07, 0.00010069599712919727, 1.0, > 1.5661950866577716, 0.7447520734699161, 0.2497844169697847, > 0.005464700864489391, 0.00815509952413137), > (7.446567577748946e-07, 0.0001007088880961995, 1.0, > 1.5662440343737307, 0.7446567523064337, 0.24987599614231418, > 0.005468443007273509, 0.008160817601891841), > (7.445614740433947e-07, 0.00010072177731066373, 1.0, > 1.5662930164082658, 0.7445614685711894, 0.24996753549603745, > 0.005472187539255912, 0.008166538792436515)], > dtype=[('s0', '<f8'), ('s1', '<f8'), ('s2', '<f8'), ('s3', '<f8'), > ('s4', '<f8'), ('s5', '<f8'), ('s6', '<f8'), ('s7', '<f8')]) > > > -- > 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. > > -- 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.