GSoC Week 5

Hi there! It’s been five weeks and midterm evaluations are going on. I have completed the implementations of Singularity Function module and headed towards the Implementation of Beam Bending Module.

So far

  • In PR 11266 , I have implemented three major classes :
    • DistributedLoad : Have the attributes start, end and value. This object can be used to generate a distributed load. It is a mutable object. The start and  end attribute should be the instance of mechanics Point. The value can take any function as input. This Load can be represented as a Singularity Function (i have not implemented this functionality yet) and used for solving the beam bending problems.
    • PointLoad : There are two types : Moment and Point Load. Moments are basically the couple of forces and are represented by the Doublet function whereas Point Load is the force which acts on a single unique point of the Beam and is represented as a DiracDelta Function.
    • Beam : It is the principle object of the Beam Bending problems. I have started working on it.

Next Week

Thats all for this week. Cheers !!

Happy Coding.



GSoC Week 4

Hi there! It’s been four weeks at GSoC. This week, I have been working on integrations. I had a meeting with my mentors on 12th June. It was great. I got stuck while implementing the integrations of Singularity Function earlier. I had already discussed that in my previous blog post. But at the meeting, I got some good ideas from Sartaj and Jason which not only cleared my doubts but also helped me to complete the implementation of integration of Singularity Functions. Firstly, they suggested me to start with the integration part in a new PR, since PR 11178 was quite good enough to get merged. Secondly, to integrate the Singularity Functions having exponents -1, we need to rewrite it as  DiracDeltas and then to use the methods of integration which are already available at sympy and then again rewrite it back as Singularity Functions.  Now I am almost completed with the “Implementation of Singularity Functions”.

So Far

  • In  PR 11178, I have added the changes that Jason had suggested. This PR is now ready.
  • In PR 11237, I have almost completed implementing the integrations of Singularity Function both definite and indefinite. I have implemented methods to rewrite DiracDeltas and Heaviside back to Singularity Functions.  The arguments of DiracDeltas and Heavisides should be a linear polynomial to use these methods.
  • I have added a module named “singularityfunctions” in the integrals directory. In there I have defined a function “singularityintegrate”. This one is the core function to integrate the Singularity Functions. SingularityFunction(x, a, -1) perfectly behaves as DiracDelta(x – a).

Next Week

  • To polish PR 11178  and PR 11237 and get them merged.
  • To start working with Beam Bending Module.

Looking forward toward an another great week. Cheers!

Midterm Evaluation is Coming !!! All the best.

Happy Coding.

GSoC Week 3

Hi! It’s been three weeks into the coding period, & I have managed to get some pace.I had a meeting with Jason and Sartaj on 5th of this month. We exchanged our thoughts on implementing the integration of Singularity Function objects. Then our discussion moved on towards the implementation of the Beam Bending Module. We focused on whether a Beam object will be mutable or immutable.We ended up discussing two approaches for the implementation of the integration of Singularity Function objects.

So far

  •  PR 11103 and PR 11137 has finally got merged.
  • In  PR 11178, I have added two important methods under  Singularity Function class.
      • rewrite(Heaviside)
      • rewrite(DiracDelta)

    These would help to convert a Singularity Function object into a mixture of DiracDeltas and Heavisides.

    But while doing the inverse i.e. rewriting DiracDeltas and Heavisides I got stuck. I have implemented that in a way which can’t handle a bit complex expressions,but good for simple DiracDelta and Heaviside expressions. I need to work on this method.

  • In the same PR, I am also working on the integration of the Singularity Functions. There are two approaches which I have discussed with my mentors.
    • Directly use the rules of integrations:- I mean if the exponent is greater than zero then increase the exponent by 1 and divide the whole by the resulting exponent. Else just increase the exponent by 1.
      The issue with this approach is if we perform Sympy integrations over SingularityFunction(x, a, 0) ,which is basically DiracDelta(x – a), then it doesn’t satisfy the fundamentals properties of DiracDelta integrations. For the purpose, I am trying the next approach.
    • Using Heaviside and DiracDelta :- Convert the Singularity function into expressions containing DiracDeltas and Heavisides and then integrate that. Integrations of DiracDeltas and Heavisides are already there in Sympy. Then rewrite that result back into the Singularity Function. Lastly, just output that resulting expression.
      Currently, I am working on rewriting the DiracDeltas and Heavisides back into the Singularity Function.

Next Week

  • Continue with the implementation of integrations of Singularity Functions.

That’s all for now, looking forward to week 4.

Cheers. Happy Coding.

GSoC Week 2

Hi there! It’s been two weeks into the coding period, & I have managed to flip some bits. I had a meeting with Jason and Sartaj on 30th April. We were discussing on the implementation of Singularity Functions. I have implemented them using the properties of Heaviside and Diracdelta under eval() method. But they suggested me to return Heaviside and Diracdelta directly instead of their properties only. This way we can reuse the functionality that has been already there in Sympy. I tried doing that,but I am having problems with the representation part.

With the former one:-
In [2]: SingularityFunction(x, 3, 4)
<x - 3>
With the latter one:-
In [3]: SingularityFunction(x, 3, 4)
(x - 3) ⋅Heaviside(x - 3)

I have to figure out the representation part of Singularity Function class. If I can succeed, then we can follow the latter idea of implementation without any worry.

We further discussed a bit about the integrations of Singularity Functions.

Progress of Week 2

The major portion of this week went into working with the printing modules. Due to which I had to switch between the targets of this week and the next week.

  • In  PR 11139, I was finally able to figure out how to implement the pretty printing of derivatives of the DiracDelta Class similar to the one with latex printing. Hence, it got merged.
  • In PR 11178, I’ve enabled the pretty printing and latex printing of Singularity Functions and added their tests too. The output somewhat looks like (both in pretty printing and latex printing :
In [3]: SingularityFunction(x, 3, 4)
<x - 3>

In [4]: SingularityFunction(x, -5, 4)
<x + 5>

In [5]: SingularityFunction(x, 0, 4)
  • I was looking into  PR 11192, it seems a great work to me. Docstrings are quite well defined.

Next Week

  • To get  PR 11103 and PR 11137 merged.
  • Integrations of Singularity Functions.
  • Improve the Implementation of Singularity Functions.

That’s all for now, looking forward to week 3.

Cheers. Happy Coding.