See also https://github.com/sympy/sympy/pull/2580 which started some work related to solving systems of equations.
On Monday, March 16, 2015 at 8:50:48 PM UTC-5, AMiT Kumar wrote: > > The primary hints doesn't have much significance, the sub hints > are the main hints which would contain various methods, used > to solve different equations. > > The primary hint is just the primary information we would like to extract > from input, (I should rather rename it) > to classify equation on the basis of univariate", > "multivariate_or_parametric", "single_eq", "multiple_eq. > > For example: > > def classify_primaryhint(f): > """Clasifies expression(s) `f` based on the primaryhints. > Primaryhints are > "univariate", "multivariate_or_parametric", "single_eq", " > multiple_eq". > > > Examples > ======== > > > >>> from sympy import * > >>> from sympy.solvers.solveset import * > >>> from sympy.abc import x > >>> classify_primaryhint(x**2 + 2*x + 1) > >>> ['single_eq', 'univariate'] > > > """ > > > phints = [] > > > # classify by number of Equations, i.e single_eq or multiple_eq > if not iterable(f): > phints.append('single_eq') > f = sympify(f) > free_symbols = set(f.free_symbols) > > > else: > free_symbols = [] > for fi in f: > fi = sympify(fi) > free_symbols.append(fi.free_symbols) > if len(f) > 1: > phints.append('multiple_eq') > > > # classify by univariate and multivariate > if len(free_symbols) == 1: > phints.append('univariate') > elif len(free_symbols) > 1: > phints.append('multivariate') > return phints > > > > Thanks, > > AMiT Kumar > > On Tuesday, March 17, 2015 at 1:44:38 AM UTC+5:30, Aaron Meurer wrote: >> >> Sorry if you already answered this in the application and I didn't see >> it, but what is the difference between primary hints and subhints? >> >> Also, I should point out that you're going to have to remove most (or >> maybe all) of your formatting when you submit your proposal in >> Melange. I would just try to make it look as good as possible in >> Melange, and provide a link to the wiki so people can read it there. >> >> Aaron Meurer >> >> On Mon, Mar 16, 2015 at 1:39 PM, AMiT Kumar <dtu....@gmail.com> wrote: >> > Hi, >> > >> > Sorry for late reply, (I was busy with Mid terms & Assignments). >> > >> > Based on the above Ideas, I have made the draft of my Proposal on SymPy >> > wiki, Please have a look: >> > >> https://github.com/sympy/sympy/wiki/GSoC-2015-Application-AMiT-Kumar--Solvers-:-Extending-Solveset >> >> > >> > >> > Thanks, >> > >> > >> > AMiT Kumar >> > 3rd Year Undergrad >> > Delhi Technological University >> > www.iamit.in >> > >> > On Tuesday, March 10, 2015 at 12:15:15 AM UTC+5:30, Aaron Meurer wrote: >> >> >> >> That sounds good, except as I noted at >> >> https://groups.google.com/forum/#!msg/sympy/42GdMJ9ssyM/swC6bHVunP8J, >> >> it's very important to build this around a framework of rewriting and >> >> decomposition. You want to be able solve, f(g(x)) = 0, where f is a >> >> polynomial and g is a lambertW (for example). You want the hints to >> >> be as simple as possible, and any complicated equations to be solvable >> >> by an application of possibly many hints. This is more complicated >> >> than what the ODE solver does. >> >> >> >> Rewriting basically boils down to simplifying the matching portion of >> >> the hints. This is something that is not done very well in the ODE >> >> system, so I would only look there to see how it is lacking. >> >> >> >> You want each hint to match a simple pattern, and then have some set >> >> of rules on how to rewrite different expressions to that pattern >> >> mathematically, even if they don't match it structurally. I would take >> >> a look at the rules system used in the fu algorithm, and in the unify >> >> submodule. Also take a look at Francesco's pattern matching >> >> suggestions (search the mailing list and the wiki). >> >> >> >> Aaron Meurer >> >> >> >> On Sun, Mar 8, 2015 at 12:18 AM, AMiT Kumar <dtu....@gmail.com> >> wrote: >> >> > Hi, >> >> > I was thinking, How about designing the solveset similiar >> >> > to the ODE Module . Something like hints system to classify solvers? >> >> > >> >> > Example: >> >> > >> >> > primaryhint = [ >> >> > "univariate", >> >> > "multivariate", >> >> > "single_eq", >> >> > "multiple_eq" >> >> > ] >> >> > >> >> > >> >> > subhints = [ >> >> > 'solve_linear_system' >> >> > 'linear_trig', >> >> > 'polynomial', >> >> > 'transcendental', >> >> > 'piecewise', >> >> > 'relational' >> >> > 'solve_lambertw' >> >> > 'miscellaneous' >> >> > ] >> >> > >> >> > >> >> > def classify_solver(f, symbols=None): >> >> > """ >> >> > Clasifies the input equation(s)/function(s) to solve for, into >> >> > possible >> >> > hints such as linear, univariate, multivariate, etc. >> >> > """ >> >> > hints = [] >> >> > >> >> > # Methods to classify Equations >> >> > >> >> > def solveset(f, symbol=None): >> >> > >> >> > if eq_type == 'linear': >> >> > solve_linear(f, symbol) >> >> > >> >> > if eq_type == 'linear_system': >> >> > solve_linear_system(f, symbol) >> >> > >> >> > . >> >> > . >> >> > . and so on >> >> > >> >> > >> >> > >> >> > In that case we will be able to add new solvers, without messing >> with >> >> > the others, and we will have a more robust and flexible framework >> >> > which will be easy to extend. >> >> > >> >> > I think, building a robust framework, which felicitates further >> >> > development, worth much more than adding new solvers. >> >> > >> >> > Thoughts from the community are invited. >> >> > >> >> > AMiT Kumar >> >> > >> >> > -- >> >> > 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+un...@googlegroups.com. >> >> > To post to this group, send email to sy...@googlegroups.com. >> >> > Visit this group at http://groups.google.com/group/sympy. >> >> > To view this discussion on the web visit >> >> > >> >> > >> https://groups.google.com/d/msgid/sympy/5b7393ef-7d4d-46f9-bfcd-dbbeb38639c4%40googlegroups.com. >> >> >> >> > >> >> > For more options, visit https://groups.google.com/d/optout. >> > >> > -- >> > 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+un...@googlegroups.com. >> > To post to this group, send email to sy...@googlegroups.com. >> > Visit this group at http://groups.google.com/group/sympy. >> > To view this discussion on the web visit >> > >> https://groups.google.com/d/msgid/sympy/6247761d-1673-4f10-bfcd-c0b92a555e7b%40googlegroups.com. >> >> >> > >> > For more options, visit https://groups.google.com/d/optout. >> > -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/c976eef4-cc67-4554-b2df-6abad7dcc48f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.