Yathartha Joshi Open Source Enthusiast

GSoC 2018 - Week 5 - Implementing log solver

So this is the last week of the first evaluation. I started with implementing log solver as part of transolve. As per the documentation of the transolve we will need two helpers for implementing log solver, check_log that will check whether the equation is logarithmic or not and log_solver that will solve the equation. Here’s the PR

Idea behind check_log

Heuristic is implemented to determine whether the equation is logarithmic or not. According to it the logarithmic equations can be reduced to simpler form using log identities. For this purpose we use SymPy’s function logcombine. If the equation is logarithmic it will be reduced and hence the number of log in the original and modified equation may differ. This will ensure that the equation is logarithmic.

Idea behind the log solver

The idea is simple, the reduced form from the check_log is used as the new target equation and is sent to solveset to handle. Solutions are retuned from solveset, but it may contain values that won’t satisfy the equation (log does not take negative values in real domain). Therfore to remove unwanted values we use checksol function of solve module which substitutes each solution in the equation and returns True if it satisfies otherwise False.

Apart from implementing helpers, I have added their documentation. Certain things needs to be done before the PR is ready for review: Tests needs to be added for the helpers and check_log needs to be improved a bit to handle corner cases.

In parallel I am also working on improving transolve's PR to make it merge as soon as possible. After these two gets completely fixed we will be focusing on implementing lambert equation solver.

In the coming week I will be focussing on finishing off the work of these two PR.

Follow @Yathartha22