This would be useful, but would be very easy to implement.
> 2. Implement case wise methods for expressions depending on
> parameters.
> e.g. Solve ODE containing constant parameters
> diff(f(r),r)=a*f(r)+b*r+c
>
> has two significantly different solutions
> f(r)=C1*exp(a*r)-b*r/a-(b+a*c)/a^2 if a != 0
> f(r)=b*r^2/2+c*r+C1 if a = 0
>
> where r - independent variable, f - dependent variable, a, b, c -
> arbitrary constants
> This problems become extremely painful, when we have bunch of more
> complex equations and expressions. Unfortunately there are no
> solutions in commercial CAS, such as Maple, Mathematica and MatLab as
> well as in open source such as Maxima and Sage. Actually Symbolic
> Tools Box (former MuPad) in MatLab tried to solve the second problem,
> but the solution does not work well. Mentioned problems are connected
> with each other and with improvement of pattern matching problem in
> Sympy. I have complete solution for Maple and porting it to
> Mathematica. I think it won't be a problem to implement this algorithm
> in Sympy.
This would be useful, I think, though it's a difficult problem to solve in general. But something like this would allow us to solve Sturm-Liouville problems and hence improve the PDE solver too, I think.
>
> Also I want to concentrate attention on some small problems, solution
> of which can improve usability of Sympy
> e.g. It is possible to simplify usage of dsolve function in case when
> dependent and independent variables are obvious.
> The equation
> eq=diff(y,x)+a*y+b*x+c
> has y as dependent variable and x as independent, so it is better to
> write
> dsolve(eq)
> The solution is complete (as patch for Sage, but it can be easily
> adopt to Sympy).
This would also be easy to implement.
>
> I think that it can be interesting to implement this algorithms in
> Sympy in terms of the GSoC project.
>
> If you are interested in my proposal please contact me and I will send
> you precise plan and if not, I will be glad to participate in one of
> the proposed projects.
>
> Best regards,
> Yuri Karadzhov
The first and third item would be useful to have, but they are not really big enough projects for a summer of code. The second one could be, though. I would need to see a more detailed plan on what you plan to implement to see if it is big enough.
Aaron Meurer
> The first and third item would be useful to have, but they are not really big enough projects for a summer of code. The second one could be, though. I would need to see a more detailed plan on what you plan to implement to see if it is big enough.Actually it was one idea which include three smaller ones because they
>
> Aaron Meurer
are connected with each other. The rough plan of implementation:
1. Implement pattern matching functionality. Function like Maple
indets which can return the list of subexpressions of given type from
given expression is required.
e.g. indets(f(x)+2*x+sin(y+cos(t)),'function')
should return the list
f(x), sin(y+cos(t)), cos(t)
This immediately give us the solution of the third problem (concerned
with dsolve)
2. Implement function which return minimal list of linearly
independent functions of one variable form given one.
e.g. linind(cos(t+1), sin(t), cos(t))
should return
sin(t), cos(t)
This helps to solve the first problem.
3. Then singular function should be implemented. This function should
return values of parameters which make given expression singular.
e.g. singular(tan(c)*y/(d*(a+b*x)),(a,b,c,d))
should return
(a=0, b=0),(c=Pi/2+Pi*N_1)
This helps to implement parametrizer.
4. Implement parametrizer casemap which do the require operation
parameter-wise
e.g. casemap(dsolve, diff(f(r),r)=a*f(r)+b*r+c, (a, b, c))
should return
(f(r)=C_1*exp(a*r)-b*r/a-(b+a*c)/a^2 , a!=0), (f(r)=b*r^2/2+c*r+C_1,
a=0)
the same method can be used for rank calculation using determinant
method because
A=Matrix((1, x), (1, 1))
casemap(det, Inverse(A), x)
should return
(1/(1-x), x!=1), (infinity, x=1)
This solve the second problem, but it's assumed that ODE module is
able to solve ODE's without checking of parameters. If it's not — the
improvement of ODE module should be done first.
This idea is not obligatory and if you need improvements of ODE or PDE
module or anything else, I will be glad to help.
--
You received this message because you are subscribed to the Google Groups "sympy" group.
To post to this group, send email to sy...@googlegroups.com.
To unsubscribe from this group, send email to sympy+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
>> The first and third item would be useful to have, but they are not really big enough projects for a summer of code. The second one could be, though. I would need to see a more detailed plan on what you plan to implement to see if it is big enough.
>>
>> Aaron Meurer
>
> Actually it was one idea which include three smaller ones because they
> are connected with each other. The rough plan of implementation:
>
> 1. Implement pattern matching functionality. Function like Maple
> indets which can return the list of subexpressions of given type from
> given expression is required.
>
> e.g. indets(f(x)+2*x+sin(y+cos(t)),'function')
> should return the list
> f(x), sin(y+cos(t)), cos(t)
>
> This immediately give us the solution of the third problem (concerned
> with dsolve)
>
> 2. Implement function which return minimal list of linearly
> independent functions of one variable form given one.
>
> e.g. linind(cos(t+1), sin(t), cos(t))
> should return
> sin(t), cos(t)
Do you know of an efficient algorithm to compute this? I know that it can be done, since the set is finite and the wronskian will tell you if it a set is linearly independent or not, but it seems that a naive implementation would have poor asymptotic (and actual) performance.
>
> This helps to solve the first problem.
>
> 3. Then singular function should be implemented. This function should
> return values of parameters which make given expression singular.
>
> e.g. singular(tan(c)*y/(d*(a+b*x)),(a,b,c,d))
> should return
> (a=0, b=0),(c=Pi/2+Pi*N_1)
>
> This helps to implement parametrizer.
>
> 4. Implement parametrizer casemap which do the require operation
> parameter-wise
>
> e.g. casemap(dsolve, diff(f(r),r)=a*f(r)+b*r+c, (a, b, c))
> should return
> (f(r)=C_1*exp(a*r)-b*r/a-(b+a*c)/a^2 , a!=0), (f(r)=b*r^2/2+c*r+C_1,
> a=0)
> the same method can be used for rank calculation using determinant
> method because
> A=Matrix((1, x), (1, 1))
> casemap(det, Inverse(A), x)
> should return
> (1/(1-x), x!=1), (infinity, x=1)
This could be a useful function. Probably the new assumptions could help it out (though sadly they are not fully implemented yet).
Aaron Meurer
>
> This solve the second problem, but it's assumed that ODE module is
> able to solve ODE's without checking of parameters. If it's not — the
> improvement of ODE module should be done first.
>
> This idea is not obligatory and if you need improvements of ODE or PDE
> module or anything else, I will be glad to help.
>
Also, you might find that you have to improve some simplification algorithms to solve Ax=0, because the present ones will not always be able to reduce large expressions to 0 (especially ones containing trigonometric functions).
Aaron Meurer
Aaron Meurer
Aaron Meurer
In [2]: integrate(1/(x**2 + a**2), x)
Out[2]:
⎽⎽⎽⎽ ⎛ ⎽⎽⎽⎽⎞ ⎽⎽⎽⎽ ⎛ ⎽⎽⎽⎽⎞
╱ -1 ⎜ 2 ╱ -1 ⎟ ╱ -1 ⎜ 2 ╱ -1 ⎟
╱ ── ⋅log⎜x + a ⋅ ╱ ── ⎟ ╱ ── ⋅log⎜x - a ⋅ ╱ ── ⎟
╱ 2 ⎜ ╱ 2 ⎟ ╱ 2 ⎜ ╱ 2 ⎟
╲╱ a ⎝ ╲╱ a ⎠ ╲╱ a ⎝ ╲╱ a ⎠
─────────────────────────────── - ───────────────────────────────
2 2
Unfortunately, this fix did not make it to my integration3-backport branch, but I think I will bisect the code and see if I can cherry-pick the correcting commit, since this is a wrong result.
Aaron Meurer