Everything about SymPy’s Column module

The Column class implemented in PR #17122 enables the continuum mechanics module of SymPy to deal with column buckling related calculations. The Column module can calculate the moment equation, deflection equation, slope equation and the critical load for a column defined by a user.

Example use-case of Column class:

>>> from sympy.physics.continuum_mechanics.column import Column
>>> from sympy import Symbol, symbols
>>> E, I, P = symbols('E, I, P', positive=True)
>>> c = Column(3, E, I, 78000, top="pinned", bottom="pinned")
>>> c.end_conditions
{'bottom': 'pinned', 'top': 'pinned'}
>>> c.boundary_conditions
{'deflection': [(0, 0), (3, 0)], 'slope': [(0, 0)]}
>>> c.moment()
78000*y(x)
>>> c.solve_slope_deflection()
>>> c.deflection()
C1*sin(20*sqrt(195)*x/(sqrt(E)*sqrt(I)))
>>> c.slope()
20*sqrt(195)*C1*cos(20*sqrt(195)*x/(sqrt(E)*sqrt(I)))/(sqrt(E)*sqrt(I))
>>> c.critical_load()
pi**2*E*I/9

The Column class

The Column class is non-mutable, Continue reading “Everything about SymPy’s Column module”

GSoC’19: Week-12 – The Final wrap-up

This was the last week of the coding period. With not much of work left, the goal was to wrap-up the PR’s.

The week started with the merge of  PR #17001 which implemented a method cut_section() in the polygon class, in order to get two new polygons when a polygon is cut via a line. After this a new method first_moment_of_area() was added in PR #17153. This method used cut_section() for its implementation. Tests for the same were added in this PR. Also the existing documentation was improved. I also renamed the polar_modulus() function to polar_second_moment_of_area() which was a more general term as compared to the previous name. This PR also got merged later on.

Now, we are left with two more PR’s to go. PR #17122 (Column Buckling) and PR #17345 (Beam diagram). The column buckling probably requires a little more documentation. I will surely look into it and add some more explanations and references to it. Also, the beam diagram PR has been completed and documented. A few more discussions to be done on its working and we will be ready with it. Continue reading “GSoC’19: Week-12 – The Final wrap-up”

GSoC’19: Week-11- Heading to the final week

With the end of this week the draw() function has been completely implemented. The work on PR #17345 has been completed along with the documentations.

As mentioned in the previous blog this PR was an attempt to make the draw() function use SymPy’s own plot() rather than importing matplotlib externally to plot the diagram. The idea was to plot the load equation which is in terms of singularity function. This would directly plot uniformly distributed load, uniformly varying load and other higher order loads except for point loads and moment loads.
The task was now to plot the remaining parts of the diagram which were:

GSoC’19: Week-10- An alternative to the draw() function

This was the end of the tenth week, and we have entered the final phase of the project.

For the last phase we have Truss calculations to be implemented in the continuum_mechanics module. I had initiated a discussion regarding what needs to be done and how the implementation will move forward in an issue #17302. We will have to analyse a bit more about making Truss calculations symbolic and what benefits one might get in solving it symbolically. We have some good packages to compare from like this. I guess a bit more discussion is needed before we go ahead with it.

Besides this, I had worked on improving the draw() function implemented in the previous week in PR #17240. I modified it to use the _backend attribute for plotting the beam diagram. This could have worked until Continue reading “GSoC’19: Week-10- An alternative to the draw() function”

GSoC’19: Week-9- Analyzing the draw() function

With the end of this week the third phase officially ends.

There has been some discussions in the PR #17240 which implements the draw() function. We might change the name of the function to plot() which is more consistent with the previous beam methods plot_shear_force(), plot_bending_moment(), etc.

Another discussion was about making this beam diagram a part of the plot_loading_results(), which basically intends to plot all the beam related plots. Although currently the beam diagram uses matplotlib as an external module, whereas the plot_loading_results() uses PlotGrid which is Sympy’s internal functionality. So it would be a bit tricky to merge those two. Continue reading “GSoC’19: Week-9- Analyzing the draw() function”

GSoC’19: Week-8- The draw() function in action

The 8th week has ended and we are now in the middle of phase –III.

Last week was a bit of research-based, understanding matplotlib and how it can be used to plot a beam diagram. I had a conversation with Jason Moore and Jashan where Jason shared a link of a repository, which also was a bit of help as I took some hints from it for the draw() function. After a lot of investigation and analysis, I was finally able to make a draft PR # 17240 which did the work as we intended.

Here is an example of how it would function: Continue reading “GSoC’19: Week-8- The draw() function in action”

GSoC’19: Week-7- Starting with the phase-III draw() function

The week was successfully completed as planned. The work on Column class has been completed.

The documentation and tests have been written and with some changes in the solve_slope_deflection() and critical_load(), the Column class is now able to handle cases with trivial solutions of the constants ( C1 & C2) which made the deflection equation zero.

Apart from this, another problem that we had with the pinned-fixed end condition, where solve() wasn’t giving the output in the required form, has temporary been handled by making an XFAIL test against it. We can work on it later. Either there has to be some changes in solve() so that we would be able to handle our case or we might have to figure out a way to rewrite it into the desired form. Continue reading “GSoC’19: Week-7- Starting with the phase-III draw() function”

GSoC’19: Week-6-Completing the Column class.

The sixth week has ended with a lot of work to be done ahead.

Last week the work was majorly focused on the work in progress PR #17122. I have included the critical load function which makes the Column class capable of determining the critical load. Some problems still came up in solving some equations. I have made an issue related to those.

An equation similar to tan(x) – x comes up while determining the critical load for the pinned-fixed end-condition. SymPy’s solve() won’t be able to solve such an equation, and as per the solution given in the issue, I think that nsolve() would surely help in this case. So I will be going ahead to solve it using the approximation returned by nsolve() to handle this condition. Continue reading “GSoC’19: Week-6-Completing the Column class.”

GSoC’19: Week-5 – Moving on with a Non-mutable Column class

A lot of things happened this week and I am happy to inform you that PR #17055 has been successfully merged. The beam module now supports the cross-sectional shape of the beam as an alternative parameter to the second moment. With this, the aim of the stage-I to integrate the geometry module with beam module has been accomplished.

Although we need to add some examples in the docs, to make it easier for the user to understand how to use this new feature.

Coming on to stage-II, I had already, initiated a discussion to finalize the API of the new Column class that is to be implemented as a part of the continuum mechanics module in this stage. Continue reading “GSoC’19: Week-5 – Moving on with a Non-mutable Column class”

Create a free website or blog at WordPress.com.

Up ↑