Mindful LearningsA novice's journey to mastery. http://localhost:2368/Ghost 0.11Tue, 27 Dec 2016 13:07:01 GMT60Setting up my macOS Sierra 10.12.1 for developmenthttp://localhost:2368/setting-up-my-macos-sierra-10-12-1-for-development/017787c8-1934-4316-8887-5ce3e109a54cKshitij SaraogiFri, 23 Dec 2016 15:46:52 GMTGSoC Week 10 & 11 - The One with `solvify`<pre><code> FiniteSet | list
ImageSet, | list (if `f` is periodic)
Union |
EmptySet | empty list
Others | None
</code></pre>
<ol>
<li><p>Adding <code>domain</code> support. </p>
<p>I added a <code>domain</code> argument to <code>isolve</code> whose default value is the real domain (<code>domain=S.Reals</code>).
A few limitation to the conditions of <code>S.Infinity</code> and <code>S.NegativeInfinity</code> followed.</p>
<p>Another noticable point,</p></li></ol>http://localhost:2368/gsoc-week-10-11/3be453ad-c5b2-4967-bf33-02e884041dd7GSoCsympyPythonKshitij SaraogiSun, 07 Aug 2016 00:00:00 GMT<pre><code> FiniteSet | list
ImageSet, | list (if `f` is periodic)
Union |
EmptySet | empty list
Others | None
</code></pre>
<ol>
<li><p>Adding <code>domain</code> support. </p>
<p>I added a <code>domain</code> argument to <code>isolve</code> whose default value is the real domain (<code>domain=S.Reals</code>).
A few limitation to the conditions of <code>S.Infinity</code> and <code>S.NegativeInfinity</code> followed.</p>
<p>Another noticable point, from the point of implementation, was to deal with singularities and discontinuities of the given inequality.
For this, I used the <code>continuous_domain</code> method to find the continuous domains of the expression within the specified domain. </p>
<p>This was a minimalistic addition with considerable returns (especially for solving periodic inequalties).</p></li>
<li><p>Solving trigonometric inequalities.</p>
<p>Since most of the trigonometric inequalities are periodic in nature and have infinite solutions,
solving the expression in the entire real domain is a repetitive task and computationally expensive.</p>
<p>In order to simplify the problem, I intend to solve all the inequalities in a positive periodic interval (say <code>[0, 2*pi)</code> for <code>sin(x)</code>).
We already have a function to compute the real period of a function : <code>periodicity</code>. <br>
In case of a non-finite <code>domain</code> argument, I intend to use this to restrict the solutions of the problem to a periodic interval.</p>
<p>This might not seem the perfect approach but it seems reasonable to handle infinite interval sets for now.
We need a new <code>Set</code> object : <code>BigUnion</code> to represent infinite number of interval objects.</p></li>
</ol>
<h3 id="newimplementation"><em>New Implementation</em></h3>
<p>I have opened <a href="https://github.com/sympy/sympy/pull/11458">PR#11458</a> for the same with all the implementation details.</p>
<pre><code class="language-python">In []: isolve(cos(x) > S(0), x, relational=False)
Out[]: [0, pi/2) U (3*pi/2, 2*pi)
In []: isolve(tan(x) > S(0), x, relational=False)
Out[]: (0, pi/2)
</code></pre>
<h3 id="afterthoughts"><em>After thoughts</em></h3>
<p>For the past couple of weeks, I haven't been able to give much time to the project due to my college schedule. <br>
I try to make up for the lost time during the weekend and meet the 40 hour weekly deadline.</p>
<p>With the endsem evaluation soon approaching, I expect this PR to get merged and count as a part of my project.</p>GSoC Week 09 - The One with Inequalities<p>This week I worked on solving trigonometric inequalities.</p>
<h3 id="trigonometricinequalities"><strong>Trigonometric inequalities</strong></h3>
<p>The primary univariate inequality solver - <code>solve_univariate_inequality</code>, <br>
depends upon the results of <code>solve</code> in order to solve the given inequality. <br>
Taking a cue from <a href="https://github.com/sympy/sympy/pull/10022">PR#10022</a> on incorporating <code>solveset</code> for inequalities, I worked on developing an approach for</p>http://localhost:2368/gsoc-week-09/262de006-4c7a-4c4d-956d-8f6870c1f308GSoCsympyPythonKshitij SaraogiSun, 24 Jul 2016 00:00:00 GMT<p>This week I worked on solving trigonometric inequalities.</p>
<h3 id="trigonometricinequalities"><strong>Trigonometric inequalities</strong></h3>
<p>The primary univariate inequality solver - <code>solve_univariate_inequality</code>, <br>
depends upon the results of <code>solve</code> in order to solve the given inequality. <br>
Taking a cue from <a href="https://github.com/sympy/sympy/pull/10022">PR#10022</a> on incorporating <code>solveset</code> for inequalities, I worked on developing an approach for replacing the use of <code>solve</code> <br>
with <code>solveset</code> in solving inequalities. </p>
<p><strong>Idea</strong></p>
<blockquote>
<p>Convert <code>Set</code>-type output from <code>solveset</code> to <code>list</code> objects similar to that returned by <code>solve</code>.</p>
</blockquote>
<p>The most striking difference between both the APIs is the uniform <code>Set</code> output returned by <code>solveset</code>. <br>
Hence, the prime concern while transitioning from <code>solve</code> to <code>solveset</code> should be handling the various type of solutions.</p>
<p>Here are a few implementation ideas on the same:</p>
<ul>
<li><p><strong>FiniteSet</strong> : finite number of solutions <br>
Using the <code>list</code> constructor on these type of objects works extremely well.</p></li>
<li><p><strong>ImageSet</strong> : infinite number of solutions <br>
This is generally the case with trigonometric functions as most of them are periodic in nature.
We need to limit the number of solutions to be finite. <br>
For this, I intend to use the a periodic interval: <code>[0, period]</code> as the basis for filtering the solution set.
This returns a simplified <code>FiniteSet</code> of solutions which can be used to solve inequalities in a restricted interval.
Following which we can generalise the output over the entire domain of the function.</p>
<p>A major issue here is the representation of the final solution set. <br>
For example: </p>
<p><code>python
In []: solveset(cos(x)<0, x, domain=S.Reals)
⎡ π 3⋅π ⎤
⎢2*n*pi + ─, 2*n*pi + ─── | n ∊ ℤ⎥
⎣ 2 2 ⎦
</code></p>
<p>Currently, we do not have a <code>Set</code> object for representing this. <br>
For this, we need to implement an <em>Indexed Union</em> : <code>Union(X(a) for a in I)</code></p>
<p>We can symbolically represent the above solution as <code>BigUnion(Interval(2*n*pi + pi/2, 2*n*pi + 3*pi/2), n, S.Intgers)</code>.</p></li>
</ul>
<p><strong>After thoughts</strong></p>
<p>Also, this week my <a href="https://github.com/sympy/sympy/pull/11277">PR#11277</a> on periodicity got merged finally. <br>
I have updated the corresponding <a href="https://github.com/sympy/sympy/pull/11141">PR#11141</a> which has been stalled for some time now. <br>
Hopefully, it will get merged soon.</p>
<p>The next week I will devote my time to the implementation part of solving inequalities.</p>GSoC Week 07 - The One With Generalised Periodicity<p>This week I updated my <a href="https://github.com/sympy/sympy/pull/11277">PR#11277</a> to find the period of a <strong>general function</strong>.</p>
<h3 id="periodicity"><strong><em>Periodicity</em></strong></h3>
<p>In the past few weeks, I dedicated a lot of my time reading about the property of periodicity of a function. <br>
Earlier, I had implemented a trivial(and restricted) functionality for this task. <br>
This</p>http://localhost:2368/gsoc-week-07/7fb63cff-a6ce-4411-8cc4-d3c0e38b41a2GSoCsympyPythonKshitij SaraogiThu, 07 Jul 2016 00:00:00 GMT<p>This week I updated my <a href="https://github.com/sympy/sympy/pull/11277">PR#11277</a> to find the period of a <strong>general function</strong>.</p>
<h3 id="periodicity"><strong><em>Periodicity</em></strong></h3>
<p>In the past few weeks, I dedicated a lot of my time reading about the property of periodicity of a function. <br>
Earlier, I had implemented a trivial(and restricted) functionality for this task. <br>
This motivated me to study this topic as I planned to generalise the function.</p>
<p>Here are my notes on periodicity which were the literature reference for the development of the method:</p>
<ul>
<li><p>Note that <code>2π</code> is a period of <code>sin(x)</code>.
But <code>sin(x)</code> has many other periods, such as <code>4π</code>, <code>6π</code>, and so on. <br>
However, <code>sin(x)</code> has no (positive) period shorter than <code>2π</code>.</p></li>
<li><blockquote>
<p>If <code>p</code> is a period of <code>f(x)</code>, and <code>H</code> is any function, then <code>p</code> is a period of <code>H(f(x))</code>. </p>
</blockquote></li>
<li><blockquote>
<p>For sums and products, the general situation is complicated. </p>
</blockquote>
<p>Let <code>p</code> be a period of <code>f(x)</code> and let <code>q</code> be a period of <code>g(x)</code>.
Suppose that there are positive integers <code>a</code> and <code>b</code> such that <code>ap=bq=r</code>. <br>
Then <code>r</code> is a period of <code>f(x)+g(x)</code>, and also of <code>f(x)g(x)</code>. <br>
However, the point to note here is that <code>r</code> need not be the shortest period of <code>f(x)+g(x)</code> or <code>f(x)g(x)</code>.</p>
<p>For example:
The shortest period of <code>sin(x)</code> is <code>2π</code>, while the shortest period of <code>(sinx)**2</code> is <code>π</code>. </p>
<p>Another example: Let <code>f(x)=sin(x)</code>, and <code>g(x)=−sin(x)</code>.
Each function has smallest period <code>2π</code>. But their sum is the <code>0</code>-function, which has every positive number <code>p</code> as a period!</p></li>
<li><blockquote>
<p>If <code>p</code> and <code>q</code> are periods of <code>f(x)</code> and <code>g(x)</code> respectively, then any common multiple of <code>p</code> and <code>q</code> is a period of <code>H(f(x),g(x))</code>
for any function <code>H(u,v)</code>, in particular when <code>H</code> is addition, multiplication or division. However, it need not be the smallest period.</p>
</blockquote></li>
<li><blockquote>
<p>The sum of two periodic functions need not be periodic. </p>
</blockquote>
<p>For example: Let <code>f(x)=sin(x)+cos(2πx)</code>.
The function is not periodic. <br>
The problem is that <code>1</code> and <code>2π</code> are incommensurable. There do not exist positive integers <code>a</code> and <code>b</code>
such that <code>(a)(1)=(b)(2π)</code>.</p></li>
</ul>
<h3 id="issues"><strong><em>Issues</em></strong></h3>
<p>I am abstracting the details of implementation so as not to make the post even further boring.</p>
<p>During the period of development, I faced few issues and had a lot of queries to make.</p>
<ol>
<li><p>The new implementation returns a value which might not be the <strong>fundamental period</strong> of the given function. <br>
The previous implementation, though limited, returned the fundamental period of the given function.</p></li>
<li><p>The ability to find the LCM of irrationals. <br>
We will be dealing with the iconic <code>π</code>(and its multiples) in many of our cases(as is evident from the example above). <br>
Currently, we donot have the functionality to find the LCM of <br>
irrational numbers. A method needs to be developed to handle this issue.</p></li>
<li><p>Issue with automatic simplification while verifying the result.</p></li>
</ol>
<p><strong>After Thoughts</strong></p>
<p>I am looking forward to addressing all these issues in tonight's meeting. <br>
Apart from that, implementing this was a lot of fun. <br>
I got to learn about inheritance and abstraction while implementing instance methods for periodic functions.</p>
<p>Hopefully, all my effort doesn't go in vain.</p>
<p>Till next time !</p>GSoC Week 06 - The One with Singularities<p>This week I worked on the topic of <em>singularities</em>.</p>
<h3 id="singularities"><strong><em>Singularities</em></strong></h3>
<blockquote>
<p>A singularity is in general a point at which a given mathematical object is not defined.</p>
</blockquote>
<p>Examples:</p>
<ul>
<li><code>1/x</code> has a singularity at <code>x = 0</code> as it seems to reach infinity.</li>
<li><code>|x| (Absolute)</code> has a singularity at <code>x = 0</code> since</li></ul>http://localhost:2368/gsoc-week-06/bf99dab9-296f-46bf-a54c-97c7a2676bdfGSoCsympyPythonKshitij SaraogiFri, 01 Jul 2016 00:00:00 GMT<p>This week I worked on the topic of <em>singularities</em>.</p>
<h3 id="singularities"><strong><em>Singularities</em></strong></h3>
<blockquote>
<p>A singularity is in general a point at which a given mathematical object is not defined.</p>
</blockquote>
<p>Examples:</p>
<ul>
<li><code>1/x</code> has a singularity at <code>x = 0</code> as it seems to reach infinity.</li>
<li><code>|x| (Absolute)</code> has a singularity at <code>x = 0</code> since it is not differentiable at that point.</li>
<li><code>√x (Square root)</code> has a singularity at <code>x = 0</code> since it doesnot admit a tangent there.</li>
</ul>
<p>In real analysis, singularities are either discontinuities or discontinuities of <br>
the derivative (sometimes also discontinuities of higher order derivatives).</p>
<p>A <strong>removable singularity</strong> of a function is a point at which the function is undefined, <br>
but it is possible to redefine the function at that point in such a way that the resulting <br>
function is regular in a neighbourhood of that point.</p>
<p>For instance, </p>
<p><code>f(z) = sin(z)/z</code> has a removable singularity at <code>z = 0</code>. <br>
This singularity can be removed by defining <code>f(0) := 1</code>, which is the limit of <code>f</code> as <code>z</code> tends to <code>0</code>.</p>
<p>In SymPy, we try to automatically simplify some of the expressions before passing it for <br>
further processing.</p>
<p>For example,</p>
<ul>
<li><code>x/x</code> simplifies to <code>1</code>.</li>
<li><code>(x-1)^2/(x-1)</code> simplifies to <code>x-1</code>.</li>
</ul>
<p>At times, this can lead to incorrect behaviour. <br>
Suppose, we are interested to find the singularities ( and/or domain ) of the function <code>f(x) = x/x</code>.</p>
<pre><code>In []: f = x/x
In []: singularities(f, x)
Out[]: S.EmptySet # no singularities
In []: continuous_domain(f, x, S.Reals) # finding the valid domain of f on the real line
Out[]: S.Reals # should be (-oo, 0) U (0, oo)
</code></pre>
<p>After some discussion about this issue of automatic simplification, we came to the <br>
conclusion that removable singularities should be treated as part of the domain of the function. <br>
This will help in justifying the behaviour of expressions which are automatically simplified.</p>
<p>So, I studied about how to classify a singularity as a removable one. <br>
For this, we use the <strong>Reimann's theorem</strong>:</p>
<blockquote>
<p>Let <code>f</code> a function defined on the set <code>D \{a}</code>.
The point <code>a</code> is a removable discontinuity if there exists a neighborhood of <code>a</code> on which <code>f</code> is bounded.</p>
</blockquote>
<p>Mathematically,</p>
<p><code>lim (z -a)*f(z)</code> <br>
<code>z->a+</code> </p>
<p>I have implemented this theorem in the form of a function but I face certain issues with <br>
the values returned by <code>solveset</code> due to <code>check_domain</code> function (which checks the bound of a <br>
function at a particular value). This remains to be discussed in the meeting.</p>
<p><strong>After Thoughts</strong></p>
<p>I have lots to discuss with my mentors on these issues. <br>
After merging the PR#11277, I think <code>solve_decomposition</code> method will be good to go.</p>GSoC Weeks 04 & 05 - The One with Periodicity<p>Hi folks !</p>
<p>The past couple of weeks were spent of developing heuristics for determining the <br>
fundamental period of a given trigonometric function.</p>
<p>In our higher school, we all must have come across <code>Trigonometric Functions</code>. <br>
One of the most striking properties of these functions is their periodicty. <br>
The ability of a</p>http://localhost:2368/gsoc-week-04-05/65ca58c6-c6fd-4b06-8bd8-2ba3749d6ecaGSoCsympyPythonKshitij SaraogiFri, 24 Jun 2016 00:00:00 GMT<p>Hi folks !</p>
<p>The past couple of weeks were spent of developing heuristics for determining the <br>
fundamental period of a given trigonometric function.</p>
<p>In our higher school, we all must have come across <code>Trigonometric Functions</code>. <br>
One of the most striking properties of these functions is their periodicty. <br>
The ability of a function to repeat its values in regular intervals has always <br>
caught my imagination.</p>
<h2 id="motivation"><strong>Motivation</strong></h2>
<p>Well, SymPy ought to have a functionality to determine the period of a function. <br>
The instigated me to implement this function now was the build failure in my <br>
PR#11141 on <code>solve_decomposition</code>. </p>
<h3 id="issue"><strong>Issue</strong></h3>
<p><code>function_range(sin(x), x, domain=S.Reals)</code> causes the build to time-out as the
number of critical points of <code>sin(x)</code> in the entire real domain is infinite. <br>
The same goes for other trigonometric functions as well.</p>
<p>However, if we can set the <code>domain</code> argument to be a finite interval which <br>
encompasses the entire behaviour of <code>sin(x)</code> over the entire real domain, our <br>
issue can be solved.</p>
<p>This led me to the idea of using the periodicity of the function as its domain.</p>
<h2 id="design"><strong>Design</strong></h2>
<p><code>f = sin(x) + sin(2*x) + cos(3*x)</code></p>
<p>We know that the period of <code>f</code> is <code>2⋅π</code> <br>
i.e. the LCM of the periods of individual function.</p>
<p><em>It is known !</em></p>
<p>Hence, in order to find the period of <code>f</code>, we need the functionality to determine <br>
the period simpler trigonometric functions such as <code>sin(x)</code>, <code>sin(2*x)</code> and <code>cos(3*x)</code></p>
<h3 id="property"><strong>Property</strong></h3>
<blockquote>
<p>If the period of <code>g(x)</code> is <code>T</code>, then the period of <code>g(a*x)</code> is <code>T/a</code>.</p>
</blockquote>
<p>Using this property, we can easily compute the periods of <code>sin(2*x)</code> and <code>cos(3*x)</code> <br>
with our knowledge of the periodicity of the fundamental trigonometric functions.</p>GSoC Week 03 - The One With Function Range (Part II)<p>Hey !</p>
<p>This week I worked on implementing a method for finding the range of a function in a given domain. <br>
Following from last weeek's research on the same, I tried to develop these utility functions.</p>
<h3 id="implementation"><strong>Implementation</strong></h3>
<p>Here, I have defined the two functions along with some of their implementation details:</p>http://localhost:2368/gsoc-week-03/2bc0e8c3-e166-48c0-a635-9358b7d03810GSoCsympyPythonKshitij SaraogiFri, 10 Jun 2016 00:00:00 GMT<p>Hey !</p>
<p>This week I worked on implementing a method for finding the range of a function in a given domain. <br>
Following from last weeek's research on the same, I tried to develop these utility functions.</p>
<h3 id="implementation"><strong>Implementation</strong></h3>
<p>Here, I have defined the two functions along with some of their implementation details:</p>
<p><strong><code>continuous_in(f, x, interval)</code></strong></p>
<p>The function returns the sub-domains as an <code>Union</code> of <code>Interval</code> in case a discontinuity exists in the <code>interval</code>. If the function is continuous in the entire domain, the <code>interval</code> itself is returned.</p>
<p>For this we need to consider 2 primary conditions:</p>
<ul>
<li><p><strong>Domain constraints for real functions</strong>
I have also added some code for domain constraints in <code>sqrt</code> and <code>log</code> functions. <br>
Using the <code>solve_univariate_inequality</code> method (as the name suggests, it solves univariate inequalities), <br>
we calculate these constraints. <br>
Given <code>f(x) = sqrt(g(x))</code>, we determine the range of values of <code>x</code> for which the function <code>g(x) >= 0</code>. <br>
Similarly, for <code>f(x) = log(g(x))</code>, the interval of <code>x</code> in which <code>g(x) > 0</code> is the constrained interval. </p></li>
<li><p><strong>Singularities</strong>
For determining the discontinuities, I tried to solve the reciprocal of the given function using <code>solveset</code>:<code>
solveset(1/f, x, interval)</code>. The <code>singularities</code> function can also be used here but its implementation is <br>
restricted to rational functions only. There are possibilities of improving this function to create a universal <br>
function which returns all the possible singularities of the function in a given domain.</p></li>
</ul>
<p><strong><code>function_range(f, x, domain)</code></strong> </p>
<p>Like the name suggests, this method returns the range of a univariate function in a given domain. This function is primarily designed for the purpose of <code>solve_decomposition</code>. </p>
<p>This function calls the above implemented <code>continuous_in</code> method for finding the actual domain of <code>f</code>. Following this, we iterate over each <code>Interval</code> object returned by <code>continuous_in</code>. </p>
<p>By using the boundaries of the interval and first derivate test, we determine the crtical points in the interval <br>
and their corresponding critical values. </p>
<p>For determining the values of the function at the singularities, we determine its limit at that point. <br>
For this, I use the <code>limit</code> function of SymPy.</p>
<p>After calculating the local extremas, I calculate the global minima and maxima using the <code>inf</code>(infimum) and <code>sup</code>(supremum) of the <code>FiniteSet</code> of all critical values. The range, which is the <code>Interval</code> of these extremasm, is returned.</p>
<h3 id="dgitlog"><strong>$ git log</strong></h3>
<p><a href="https://github.com/sympy/sympy/pull/11141">PR#11141</a>: Method for solving equations using Decomposition and Rewriting
<em>Opened this week</em> <br>
<a href="https://github.com/sympy/sympy/pull/11224">PR#11224</a>: Methods for finding the range of a function in a given domain </p>
<p><strong>Final Thoughts</strong></p>
<p>That was all for this week. <br>
My task for the upcoming days would be to update my <code>solve_decomposition</code> method to accomodate these methods. <br>
I aim to get all these PR merged before the midterm evaluation.</p>GSoC Week 02 - The One With Function Range (Part I)<p>This week I worked on developing methods for computing the range of an univariate function. <br>
For this pupose, I spent most of my time in research; reading previous discussions on mailing lists, pull requests and wikis.</p>
<h3 id="progress"><strong>Progress</strong></h3>
<p>Suppose, we want to solve the following equation in the variable <code>x</code>:</p>
<p><code>sin(</code></p>http://localhost:2368/gsoc-week-02/c9b87a98-4653-49fa-a629-128107d43f2bGSoCsympyPythonKshitij SaraogiSat, 04 Jun 2016 00:00:00 GMT<p>This week I worked on developing methods for computing the range of an univariate function. <br>
For this pupose, I spent most of my time in research; reading previous discussions on mailing lists, pull requests and wikis.</p>
<h3 id="progress"><strong>Progress</strong></h3>
<p>Suppose, we want to solve the following equation in the variable <code>x</code>:</p>
<p><code>sin(x) = π / 2</code></p>
<p>We can straight away state that this equations has <em>no solutions</em> as the range of the function <code>sin</code> is -1 to 1 <br>
i.e <code>sin(x) ∈ [-1, 1]</code>.</p>
<p>Thus, we find that the range of the function can also be used to leverage the solutions of an equation. The implementation of a function to determine the range of a function in a given domain is particularly interesting for checking whether an equation is at all solvable.</p>
<p>In the last meeting, Amit had suggested me to read the conversation on</p>
<ul>
<li><a href="https://github.com/sympy/sympy/pull/2723">PR#2723</a> : Fixed imageset for Interval</li>
<li><a href="https://github.com/sympy/sympy/pull/2925">PR#2925</a> : find singularities for any expression. </li>
</ul>
<p>Along with this, I read the following mailing lists discussions:</p>
<ol>
<li><p><a href="https://groups.google.com/forum/#!searchin/sympy/minimize/sympy/Na_p5pm1I7M/V6uv4ZAkp2oJ">Find minimum value of a function symbolically</a> </p></li>
<li><p><a href="https://groups.google.com/forum/#!topic/sympy/8TM8cnuzkG8">Best way to find extrema of function over interval</a></p></li>
<li><p><a href="https://groups.google.com/forum/#!searchin/sympy/singularity/sympy/ijhl7rkHEbk/lsWTuJ2Nb8wJ">GSoC 2013 Idea - Find Domain / Range / Continuity / Singularity of a Function</a></p></li>
<li><p><a href="https://groups.google.com/forum/#!searchin/sympy/singularity/sympy/c_fpCu9QiII/n2KaXN-z3rwJ">On a general representation for singularities and infinities</a></p></li>
<li><p><a href="https://groups.google.com/forum/#!searchin/sympy/singularity/sympy/mJlCxuZ5uZw/peWogHzbKekJ">Functions: Singularity and Continuity</a></p></li>
</ol>
<p>All this research helped me appreciate the difficulty of the problem at hand. Also, my approach to solving this issue is heavily inspired from these discussions. </p>
<h3 id="design"><strong>Design</strong></h3>
<p>The methodology of determining the range of a function:</p>
<ol>
<li>Determine the points of discontinuities in the concerned domain. </li>
<li>Divide the entire domain into sub-domains about the above-determined singularities. </li>
<li>Use the <a href="https://en.wikipedia.org/wiki/Derivative_test#Second_derivative_test">Derivative Test</a> to locate the critical points of the function within each sub-domain. </li>
<li>Calcuate the corresponding values of the function at the critical points and the boundary values of the sub-domains. </li>
<li>The extremas of the function in the entire domain are the maximum and minimum values in all the smaller domains combined.</li>
</ol>
<p>For now, I have thought of designing 2 functions to solve this issue:</p>
<ol>
<li>Function to divide the domain into sub-domains. </li>
<li>Function to calculate the extremum values.</li>
</ol>
<h3 id="dgitlog"><strong>$ git log</strong></h3>
<p><a href="https://github.com/sympy/sympy/pull/11141">PR#11141</a> : Method for solving equations using Decomposition and Rewriting
<a href="https://github.com/sympy/sympy/pull/11164">PR#11164</a> : Intersection of certain ImageSets with Intervals</p>
<h3 id="thoughts"><strong>Thoughts</strong></h3>
<p>After tommorrow's meeting, I will iron out a more concrete design. <br>
My goal for next week would be to implement the above-said functions.</p>
<p>Looking forward to another exciting week !</p>GSoC Week 01 - The One with Intersections<h3 id="dgitlog"><strong>$ git log</strong></h3>
<p><a href="https://github.com/sympy/sympy/pull/11149">PR #11149</a> : Intersection of null Range and an Interval returns EmptySet <br>
<a href="https://github.com/sympy/sympy/pull/11164">PR #11164</a> : Intersection of certain ImageSets with Intervals</p>
<p>In the next week, I will try to design a method to determine the range of a function in the given domain. <br>
This will require some digging up and</p>http://localhost:2368/gsoc-week-01/2dc28cb5-1bad-4e26-989f-e53c75e6073eGSoCsympyPythonKshitij SaraogiSun, 29 May 2016 00:00:00 GMT<h3 id="dgitlog"><strong>$ git log</strong></h3>
<p><a href="https://github.com/sympy/sympy/pull/11149">PR #11149</a> : Intersection of null Range and an Interval returns EmptySet <br>
<a href="https://github.com/sympy/sympy/pull/11164">PR #11164</a> : Intersection of certain ImageSets with Intervals</p>
<p>In the next week, I will try to design a method to determine the range of a function in the given domain. <br>
This will require some digging up and a bit of research.</p>
<p>Looking forward to it ! </p>Solving equations via Decomposition and Rewriting<p>A robust framework for solving equations is a salient feature of any Computer Algebra System. An important idea in this regard is <strong>"Rewriting and Decomposition"</strong>. By using this techniques, we try to reduce the given equation to a set of simpler equations which can be solved with relative ease.</p>
<p>An</p>http://localhost:2368/solving-equations-via-decomposition-and-rewriting/e336f009-21fd-4734-a18b-1c760788b99aGSoCsympyPythonKshitij SaraogiSun, 22 May 2016 00:00:00 GMT<p>A robust framework for solving equations is a salient feature of any Computer Algebra System. An important idea in this regard is <strong>"Rewriting and Decomposition"</strong>. By using this techniques, we try to reduce the given equation to a set of simpler equations which can be solved with relative ease.</p>
<p>An example here would be the best way to establish the significance of the above idea.</p>
<p>If we have to solve for <code>x</code> in the equation <code>f(x) = 0</code>, where <br>
<code>f(x) = ln(x)**2 - 3*ln(x) + 2</code></p>
<p>This problem can be approached with the idea of "Decomposition and Rewriting". <br>
Here is the procedure:</p>
<ol>
<li><p><strong>Decomposition</strong> <br>
The step involves a decomposition of the given function into smaller, constituent functions. <br>
In the above case, we decompose f(x) as: <br>
<code>f(x) = g(x)*2- 3*g(x) + 2</code> , where <code>g(x) = ln(x)</code></p></li>
<li><p><strong>Rewriting</strong> <br>
Substituting <code>g(x)</code> with a dummy variable <code>t</code> in <code>f(x)</code>, we get a polynomial in <code>t</code>: <br>
<code>h(t) = (t -1)*(t-2)</code> , where <code>t = ln(x)</code></p></li>
<li><p>We determine the values which satisfy the equation <code>h(t) = 0</code>. <br>
For our example: <code>t = 1</code> or <code>t = 2</code></p></li>
<li><p>Back-substituting the value of <code>t</code> into these solutions, we get 2 independent equations in <code>x</code>: <br>
<code>ln(x)= 1</code> or <code>ln(x) = 2</code></p></li>
<li><p>Solving these equations individually, we get the desired solutions of the inital equation <code>f(x) = 0</code> i.e. <br>
<code>x = exp(1)</code> or <code>x = exp(2)</code></p></li>
</ol>
<p>Thus, we get two possible solutions of the given complex transcendental equation through the methods of Rewriting and Decomposition. An important observation can be made with respect to the relative ease of calculating the solutions of the intermediate equations compared to that of the original equation. This motivates the development of a simpler and modular system for solving equations rather than a vast and case-specific one.</p>
<p>A well-designed implementation of the above technique can be of high value to the <code>solveset</code> system. This will be my task for the 1st week of GSoC. I created a Pull Request <a href="https://github.com/sympy/sympy/pull/11141">PR#11141</a> with a primitive design. <br>
Reviews and suggestions are welcomed ! <br>
Thats pretty much it for now. In the next blog post, I will be writing in detail about the implementation process. </p>Auditing SymPy's Transcendental solver<p>Having considered the current codebase of <code>_tsolve</code> function, I find the following few points considered while implementing the new solver: </p>
<ul>
<li>modularise the code for various classes of equations(LambertW, <code>bivariate</code> equation type, logarithmic, exponential). </li>
<li>using SymPy <code>Set</code> objects internally, instead of using the built-in Python <code>lists</code>. </li>
<li>use of <code>decompogen</code> function</li></ul>http://localhost:2368/auditing-sympys-transcendental-solver/9715ccee-1a40-4740-9590-aa4930144dd5GSoCsympyPythonKshitij SaraogiSun, 15 May 2016 00:00:00 GMT<p>Having considered the current codebase of <code>_tsolve</code> function, I find the following few points considered while implementing the new solver: </p>
<ul>
<li>modularise the code for various classes of equations(LambertW, <code>bivariate</code> equation type, logarithmic, exponential). </li>
<li>using SymPy <code>Set</code> objects internally, instead of using the built-in Python <code>lists</code>. </li>
<li>use of <code>decompogen</code> function to check for possible decomposition of the given expression into simpler functions.</li>
<li>handle the case where the given equation has no closed-form solution and infinite recursion occurs.</li>
</ul>
<p>These are just a handful of strategies that I intend to use. However, the whole process of development is going to a lot more complex and might need some more considerations from my side. </p>
<h3 id="taskimplementtransolvefunction">Task : Implement <code>transolve</code> function.</h3>
<p>My plan is to do a <em>test-driven development</em> for this solver. <br>
For this, I will start by porting the relevant tests present in <code>test_solvers.py</code> module to the <code>test_solveset.py</code>. <br>
Following this, I will start the developement process of the <code>transolve</code> solver. </p>
<p>I aim to accomplish a major portion of this task by the end of this week.</p>
<p>Thats all for now. <br>
And the coding begins !</p>