It may be that we don't understand your application given your example.
From your example I suspect you want to compute something like the
following
In [1]: from sympy import *
In [2]: s4 = Symbol('s4')
In [3]: s6 = Symbol('s6')
In [4]: sol = 1.0e-6*s4 + 1.0e-12*s6
In [5]: sol
Out[5]: 1.0e-6*s4 + 1.0e-12*s6
In [6]: f = lambdify((s4, s6), sol)
In [7]: import numpy as np
In [8]: data_s4 = np.asarray([1,2,3,4]) # Some random data, presumably
these are much longer
In [9]: data_s6 = np.asarray([1,2,3,4])
In [10]: f(data_s4, data_s6)
Out[10]:
array([ 1.00000100e-06, 2.00000200e-06, 3.00000300e-06,
4.00000400e-06])
On Wed, Jun 12, 2013 at 8:40 PM, Shawn Garbett <[email protected]>wrote:
> On Wednesday, June 12, 2013 4:54:21 PM UTC-5, Aaron Meurer wrote:
>
>> Use lambdify().
>>
>
> I've just spent a couple hours fiddling with lambdify(). I can't seem to
> get it to work. First of all, lambdify requires that one specify the args
> for the first argument. I'm trying to write this to deal with sets of
> equations, that I don't know the args up front, and in fact they total
> number of variables will be large (10^26 is possible--but I've got a
> strategy to keep it under 10,000 if that happens). I could specify a single
> arg, but then that requires that the SymPy expression use numpy syntax for
> subscripting which I cannot get to work SymPy. So basically I'm lost on how
> lambdify helps me.
>
>
> --
> 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 [email protected].
> To post to this group, send email to [email protected].
> 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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.