On Fri, Mar 13, 2009 at 8:03 PM, asmeurer <asme...@gmail.com> wrote:
>
> Hello. My name is Aaron Meurer, and I would be interested in applying
> to work with sympy under the Google Summer of Code 2009. I am
> currently a student at New Mexico Tech and am doubling majoring in
> Mathematics and Computer Science, and, as such, sympy looked like it
> would be a good project for me. Of the project ideas that are listed
> for sympy, the one that looked the most interesting to me was the
> differential equations project. I am currently taking Math 335
> Ordinary Differential Equations.
Thanks for your interest and sorry for my late reply. We just spent 3
full days hacking on sympy with Luke, I'll post a blog about it soon.
>
> I looked at the section of the sympy source that deals with solving
> differential equations and I must say that there is much potential
> work. So far it only solves first order linear equations and
Indeed.
> equations of the type a*y''+b*y+c=0. It doesn't even support simple
> separable equations! And not to mention Bernoulli, nth order
> homogeneous, homogeneous (the other meaning), exact... The list goes
Yes, it's very embarrassing. :)
> on. This would be a good project because I could implement a little
> or a lot and it would still be complete (e.g., I could implement all
> of those things or just end up implementing separable and
> homogeneous), allowing for it to be difficult or easy for me.
That'd be really great. My roommate is also teaching differential
equations, so I know that it would be handy to be able to solve any
equation from the book.
>
> I have never developed for open source before, but I think that this
> would be a great opportunity to learn what it is like.
Absolutely! SymPy contains lots of contributions from people that have
never contributed to any opensource project before. All code has to be
reviewed, so we'll help you prepare the patches in the way, so that it
could be pushed in.
Looking forward,
Ondrej
You can get involved more with the sympy project, more below.
> then :) ). Google does not have the information on applying up yet,
> so I am not exactly sure what I will need. From what I've read an
> various websites linked to on the main gsoc page, I will need some
> kind of application for the idea, as well as some kind of a résumé.
Yes, you will be writing an application. Search archives of this list
to find examples of applications from 2008 and 2007.
>
> Also, some sites that I have looked at recommend proposing a couple of
> ideas. Would you recommend that? There is little on the ideas page
> that I would feel qualified doing, as most of it involves higher math
> than I have taken yet. There are some that I could do (such as Maple
> integration, as I own Maple and am somewhat decent with it), but the
> differential equation one looks the most interesting and fun to me by
> far. I am also currently taking Basic Concepts of Math (352),
> Discrete Math and Formal Logic (221), and Vector Analysis (332), and
> have taken up to Calc. 3, if you think I missed something.
There are lots of things that you can do with your level of math that
are very needed. For example code generation to C needs improvements
and testing.
Or just search through our issues:
http://code.google.com/p/sympy/issues/list
and easy to fix issues:
http://code.google.com/p/sympy/issues/list?q=label:EasyToFix
to get an idea which areas of sympy need improvements.
>
> Lastly, some sites mentioned that some mentoring organizations require
> a timeline. Will you be wanting that? Like I said, with this
> project, I could do a lot or a little and still add useful code to the
> project, and I really have no idea how long any of this will take for
> me to code. And depending on how I do it, I could complete different
> amounts of things. For example, I could focus on different methods of
> substitution that convert a differential equation into a type that can
> be solved, or I could focus on implementing as many different distinct
> types of differential equations as possible.
Yes, we do. We also require each applicant to post at least one patch
to sympy, that gets reviewed and accepted, so that we can see that you
will be able to learn how to contribute.
I suggest you pick some differential equation that sympy cannot solve
and send us a patch fixing it (you will have to do it anyway). That
way you will see first hand how much work it is and then you can
estimate how much time you need for the whole project.
As to the project, I suggest you pick some algorithm (that could be
used to solve lots of differential equations) that you could implement
and test. One example is variation of constants:
http://en.wikipedia.org/wiki/Method_of_variation_of_parameters
And there are others. Then you would build your project around such
algorithm, e.g. it would be the core part of it and you would make
sure it works and then implement some special cases.
Another approach is to go through your differential equations textbook
and think what algorithms you need to implement to be able to solve
all equations.
In general, you are given a free hand at what to propose. We (not just
sympy but I think gsoc in general) are looking for projects that we
can see that you will be able to finish in the summer, e.g. that it is
not just words, but you can actually deliver the result. Some working
prototype is a big plus.
So my suggestion is -- dive in right now and try to implement some solvers.
Ondrej
> As to the project, I suggest you pick some algorithm (that could be
> used to solve lots of differential equations) that you could implement
> and test. One example is variation of constants:
>
> http://en.wikipedia.org/wiki/Method_of_variation_of_parameters
>
> And there are others. Then you would build your project around such
> algorithm, e.g. it would be the core part of it and you would make
> sure it works and then implement some special cases.
Joel S. Cohen's _Computer Algebra and Symbolic Computation: Elementary
Algorithms_ describes an algorithm along these lines and gives
references which should help implement the special cases:
http://web.cs.du.edu/~jscohen/ElementaryAlgorithms/
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
-- Umberto Eco
In [1]: ccode?
Type: function
Base Class: <type 'function'>
String Form: <function ccode at 0x9182c6c>
Namespace: Interactive
File: /home/ondra/repos/sympy/sympy/printing/ccode.py
Definition: ccode(expr)
Docstring:
Converts an expr to a string of c code
Works for simple expressions using math.h functions.
>>> from sympy import *
>>> from sympy.abc import *
>>> ccode((2*tau)**Rational(7,2))
'8*pow(2,(1/2))*pow(tau,(7/2))'
>>
>> Or just search through our issues:
>>
>> http://code.google.com/p/sympy/issues/list
>>
>> and easy to fix issues:
>>
>> http://code.google.com/p/sympy/issues/list?q=label:EasyToFix
>>
>> to get an idea which areas of sympy need improvements.
>>
>>
> I will look there too.
>>
>> Yes, we do. We also require each applicant to post at least one patch
>> to sympy, that gets reviewed and accepted, so that we can see that you
>> will be able to learn how to contribute.
>>
>> I suggest you pick some differential equation that sympy cannot solve
>> and send us a patch fixing it (you will have to do it anyway). That
>> way you will see first hand how much work it is and then you can
>> estimate how much time you need for the whole project.
>>
>
> I think that I could try Bernoulli for a start, since it is can be
> solved generally much like linear can be (see the sympy code for
> linear equations to see what I am talking about). Hopefully I can
> figure out the matcher and solver functions.
That's a good idea to try to figure it out, because this is what you
will be doing the whole summer. :)
> However, as you could probably tell from the classes I am taking
> (those in addition to my computer science class), I will have limited
> time to work on sympy before the summer time. Nonetheless, I will try
> to do some of what you have said.
>
>
>> As to the project, I suggest you pick some algorithm (that could be
>> used to solve lots of differential equations) that you could implement
>> and test. One example is variation of constants:
>>
>> http://en.wikipedia.org/wiki/Method_of_variation_of_parameters
>>
>> And there are others. Then you would build your project around such
>> algorithm, e.g. it would be the core part of it and you would make
>> sure it works and then implement some special cases.
>>
>> Another approach is to go through your differential equations textbook
>> and think what algorithms you need to implement to be able to solve
>> all equations.
>
> I will have to think about this. As I have said, I am only half way
> through the class, but from what I can tell, most of what I have yet
> to learn requires transformations (which according to your ideas list
> aren't implemented yet),
Not sure what you mean here, but transformations are easy to
implement, just take an expression and differentiate it.
> are numerical solution techniques, or relate
> to solving systems of differential equations (I think I should focus
> on solving just one differential equation, since it hardly makes since
> to try solving systems if the engine cannot even solve single
> equations anyway).
Btw, this reminds me that recently we implemented a finite element
method solver for 1D equations in my group at UNR:
http://groups.google.com/group/hpfem/browse_thread/thread/d132ba50fe2a7e08
What's different to regular FEM solvers is that it allows to assign
the initial conditions at the beginning of the interval, e.g. like the
rk4 method. When we polish it more and implement hp-FEM adaptivity, I
am very curious how it's going to perform with comparison to regular
adaptive ode solvers, like the one in scipy.
So if you are interested in numerical solvers, we are always looking
for new collaborators, our page is: hpfem.org
>
> By the way, if you are interested, this is the website of my ODE
> class: http://infohost.nmt.edu/~jstarret/TeachingSpring2009/335/335Spring2009.html
>
> My professor teaches the class in Maple. There is also a link to the
> textbook that I own there too.
Ondrej
You can either install all the time and there are some convenience
tools for that, e.g. setuptools inplace. I myself just develop in the
tree, e.g. just download the git version of sympy and "import sympy".
You execute tests using
bin/test sympy
>
> Also, as I predicted, I am having difficulties understanding the match
> function that the ODE solving functions use. How exactly does this
> work? As far as I can tell, it returns a dictionary of the variables
> of the function, but what are these set to. I probably could figure
> this one out, but as I said above, I currently don't know how to test
> this very efficiently.
Just create a simple python script that imports sympy, put it into the
sympy root directory and you can experiment. Or use ipython.
>
> And of course, if I actually manage to churn out something that works,
> I have no idea how to submit it.
http://docs.sympy.org/sympy-patches-tutorial.html#quick-start
O.
No, it doesn't change anything. Everything that I wrote stays.
>
> By the way, I am coming along fine with that Bernoulli patch although
> it is going slow because I am learning the system (sympy, python
> modules, get) and because I am busy with homework. I currently have
> the code written, I just need to figure out how to use git so I can
> upload it.
Excellent, great job. Follow the link I posted to learn git.
Ondrej
Thanks!
>
> I was wondering, should the test file be updated with tests for the
> new types of ODE's that I implement or should that wait until the
> patch is accepted?
The patch will not be accepted without tests, so yes, the tests should
be updated.
You should see your mail in sympy-patches. If you don't, your mail
client may not work. In this case, just attach the files generated
with "git format-patch" to some issue in our bug tracker.
>
> For now, I will be focusing on my application (as well as my school
> work), but now that I know how to patch the system, I might fix a few
> of those easy bugs you linked to.
Excellent!
Ondrej
Just resubmit the patch. You can use
git rebase -i
to merge/squash patches. I'll help you with the rest once I can see the patch.
>
>> You should see your mail in sympy-patches. If you don't, your mail
>> client may not work. In this case, just attach the files generated
>> with "git format-patch" to some issue in our bug tracker.
>
> I see it now. My mail client was marking it as junk.
Could you please post a link to the message in the sympy-patches list:
http://groups.google.com/group/sympy-patches
I can't see it.
Ondrej
googling a bit revealed:
http://blog.madism.org/index.php/2007/09/09/138-git-awsome-ness-git-rebase-interactive
http://www.kernel.org/pub/software/scm/git/docs/git-rebase.html
try to follow those tutorials.
>
>> Could you please post a link to the message in the sympy-patches list:
>
> I don't know how to post a link, but I will post a copy of the patch
> there.
You go here:
http://groups.google.com/group/sympy-patches
click on the first link:
http://groups.google.com/group/sympy-patches/browse_thread/thread/e11b2244ced4709e
and do copy and paste of that link. That's what I meant.
Ondrej
Not currently, but if you want to help out, here is the issue for it:
http://code.google.com/p/sympy/issues/detail?id=1256
> about that! Of course I know how to copy and paste the message post
> link.
Sure, I was a bit joking. :)
Ondrej
Yes, just search this list for examples of applications. Definitely
start on this as soon as possible and prepare a schedule etc. You can
then easily fit it on the template that PSF will put up.
Ondrej
This is a great project; I hope this gets accepted.
> • Am I missing anything important here?
* Implement the (generalized) hypergeometric differential equation and
add hypergeometric functions like Bessel and Airy functions to SymPy
(these functions are needed to solve many important ODEs from physics
and elsewhere)
* Identification of singular points of linear ODEs. Series expansions
for linear ODEs with unknown solution (see for example "Advanced
Mathematical Methods for Scientists and Engineers" by Bender &
Orszag). Possibly difficult, especially since the series code in SymPy
has some problems.
* Symbolic FEM code, e.g. for approximating ODE solutions by
polynomials (see e.g.
http://fredrik-j.blogspot.com/2009/02/galerkins-method-in-sympy.html),
or by trigonometric polynomials (Fourier series).
* Implement automatic transformation of high-order ODEs to systems of
first-order ODEs. Write wrappers for numerical ODE solvers in mpmath
and/or SciPy so that numerical solutions can be obtained conveniently
in SymPy.
Though I will not be mentoring, I will be happy to provide guidance
about any of the above if necessary.
Fredrik
Python does, but we have a word in it. It's a good idea to introduce
yourself in the python-gsoc list.
Ondrej
Thanks, I look at it. Some suggestions ---
try to create more specific timeline, e.g. first week I'll do this,
next 3 weeks I'll do this, I will have this before the midterm, etc.
could you ellaborat a bit more on which exact equations you are going to solve?
Btw, have you looked at the link posted by Robert Kern on this list
recently? What is your opinion about it?
>
> Also, I had another question. I had heard mentions that a résumé
> would be needed from other projects, but I haven't seen any explicit
> mention of it on sympy or python's template pages. Will you or python
> be wanting any kind of formal or informal résumé from me? I don't
I don't think you need a resume for PSF. Could last GSoC students
clarify this please?
> think I would have anything interesting to put on it, except for the
> relevant classes that I have taken so far, as I have never had any
> kind of computer science related job or internship or anything like
> that.
Ondrej
I think this is fairly straightforward work; the solutions have
standardized forms
and don't require implementing any series. If you're not sure if
you'll have time,
it can be good to include it in the application anyway, but state clearly
that you'll do it only if you have time. Assuming you are interested in the
task, that is.
> One of the nice things about implementing ODEs is that I
> can shoot for a realistic goal and if I achieve it faster than I
> thought I would, then I could easily logically continue the project
> from there by implementing more advanced types of solutions, i.e.,
> series, numerical, systems of ODEs, etc.
Of course.
>> * Implement automatic transformation of high-order ODEs to systems of
>> first-order ODEs. Write wrappers for numerical ODE solvers in mpmath
>> and/or SciPy so that numerical solutions can be obtained conveniently
>> in SymPy.
> Writing wrappers might no be as difficult. Is there already a
> standard for wrappers in sympy?
There are existing wrappers to look at, but not exactly any standard.
>> Though I will not be mentoring, I will be happy to provide guidance
>> about any of the above if necessary.
> I see from your blog that you participated in gsoc last year. Do you
> perhaps have any advice for me, especially with regards to the
> application process?
The best advice is probably to discuss your application with the
developers, as you're already doing. Include a schedule plan
in your application.
Fredrik
>> Also, I had another question. I had heard mentions that a résumé
>> would be needed from other projects, but I haven't seen any explicit
>> mention of it on sympy or python's template pages. Will you or python
>> be wanting any kind of formal or informal résumé from me? I don't
>
> I don't think you need a resume for PSF. Could last GSoC students
> clarify this please?
You should write in the application why you're the right person to do this
project. At least last year, a formal resume wasn't required.
Fredrik
Yes and welcome to SymPy! :)
I'll send you a feedback to your application later tonight, was quite
busy with fixing bugs..
Ondrej
Change:
http://code.google.com/p/SymPy/issues/detail?id=1336
to:
http://code.google.com/p/sympy/issues/detail?id=1336
Also find a good name for the whole application, so that people find
it interesting among the others. e.g.
SymPy: differential equations solvers ...
maybe you can find something better.
>
> Some particular questions about it:
> Length. Is this too short? too long? I have no idea how long a good
> application should be.
I think it's good. I suggest to refactor the Notes and Other Notes and
make it part of the application.
If you have time, one idea for improvement is to be more specific
about what and how you implement things in each week. E.g. take your
Notes and Other notes and make the paragraphs about each week more
detailed.
> Sectioning. The way I have it now, the crux of my application is
> under "Summary". Is this supposed to be somewhere else, with only a
> summary under "Summary"? That wouldn't make any sense, because
> "Abstract" is supposed to summarize the application.
Yes, Abstract is the thing that will be visible to others if your app
is selected and that is the thing that people will read the most. E.g.
if there are ~70+ applications at PSF, some mentors will only read the
abstract. Or less. :)
> Content. Mainly, how well is this written? Would you accept me based
> on the application as it is now written?
This very much depends on how many slots we get for SymPy and about
the other applications. E.g. it's relative.
But I think it has a great chance of being accepted.
> Spelling and grammar. You don't need to do a check for me, but if you
> see something blatantly obvious, let me know or go ahead and fix it.
>
> Also, does anyone know: why does python have a section for final
> evaluation? It would seem that they want me to divide my time line
> into the period before the midterm evaluation and the period after.
> But they also have a section for the final evaluation, which doesn't
> make any sense, as all of the coding should be done by then. Am I
> misinterpreting this somehow?
The template is here:
http://socghop.appspot.com/org/show/google/gsoc2009/python
I think it means what work you do before the program starts, what work
you do before the midterm and what work you do before the final
evaluation.
Thanks for writing it up and I promise I will be now more responsive.
The deadline is on Friday.
Ondrej