Hey there people of the mailing list! Below is a copy of an email I sent to Ondrej asking about how I can do something for my project....anyone got any ideas please help! :)
Hi there Ondrej... I love your project, I would like to support it once I have gotten my head round it a bit more... I have two problems with using sympy with numpy for my 4th year master's project (which, of course,I will release under GNU when all is said and done...) The first is that I want to build up function expressions like: x=sympy.Symbol('x') a=[1,2,3] fn=a[0]sin(a[1]*x)+a[2] and be able to change the values of the elements of the list/array to change the values of the function parameters (without having to hand code it using def function(), my algorithm involves generating different functions with different parameters by operating on existing sympy function objects) so the above would give me fn=1*sin(2*x)+3 and I would like to be able to change, say, a[2]=4 so that a=[1,2,4] and fn=1*sin(2*x)+4 The above may be enough to solve my problem, in the course of my project I have also found the need to interface with scipy.optimise.leastsq() which is proving more difficult than I expected. I found a better least squares Levenberg-Marquardt implementation (based on MINPACK fortran routines) but would need to 'unsympify' my sympy function in order to use it. Is there some way I can convert from sympy functions to numpy functions, as I think the reverse is possible with sympify()? Thank you very much in advance for any help you can give me (I have found information to be sparse, I intend also to write an introduction to scientific programming with scipy/sympy/Scientific/pyMPI based on my experiences when I have finished). Tim Varkalis p.s. just thought i'd add, at the moment I'm going the rather inefficient route of building strings containing "def fn(blah, blah):\n\t <generated function>" and then evaluating them with exec(string). I have yet to see how well numpy and/or Scientific deal with differentiating functions constructed in this way... BTW does anyone know why eval(string) doesn't handle escape characters? they just passed through giving me syntax error.... Anyways, would love to hear thoughts from anyone/everyone interested... Cheers, Tim --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sympy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sympy?hl=en -~----------~----~----~----~------~----~------~--~---