-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented new Method to Calculate Beams with Hinges #26594
Conversation
✅ Hi, I am the SymPy bot. I'm here to help you write a release notes entry. Please read the guide on how to write release notes. Your release notes are in good order. Here is what the release notes will look like:
This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.14. Click here to see the pull request description that was parsed.
Update The release notes on the wiki have been updated. |
I will also take another look at the doctests that keep failing. |
I understand that this is a big change. Especially the removal of the For now I will continue with the following 3 points:
|
That's fine. It is a private method so it can be removed without deprecation if user facing functionality doesn't change. |
After looking at excersice 8 of the beam_problems.rst file, I see that there is a change in output between the new function and the old one. This change happens because the hinge is added to the load equation as a singularity function of order -3. This gives much easier and shorter slope and deflection equations, as I will show below here. But the problem of this change in equations is that the output of for example The original output of
The new output of
It is visible that the load equation became a bit longer because of the addition of the singularity function describing the hinge. The main adventage of this becomes visible when looking at the slope and deflection equation. The slope equation is shown below. Original output of
The new output of
This is a change that user can experience. If they calculate anything with these functions the result will be the same, but the function as a whole will look different. If a user plots the slope or uses My question is if this is something that has to follow depreciation policy. I saw that something has to be depreciated if it's backwards incompatible and user code would stop working after the change. I'm not sure if that is the case here. Knowing all that is stated above here, is it necessary for this code do follow depreciation pollicy? |
If the output changes to a mathematically equivalent form, then no deprecation is needed. If the output changes from an incorrect answer to a correct answer, no deprecation is needed. So I think you are fine here. |
Benchmark results from GitHub Actions Lower numbers are good, higher numbers are bad. A ratio less than 1 Significantly changed benchmark results (PR vs master) Significantly changed benchmark results (master vs previous release) Full benchmark results can be found as artifacts in GitHub Actions |
@mvg2002, What happens if you put two hinges at the same place or at the beginning or end of a beam? In the previous implementation that was not possible (or maybe something similar with a beam of length 0). |
Putting two hinges at the same place will give a Putting a hinge at the beginning or end of a Beam gives problems, especially when there is a fixed support at the place of the hinge. I will add some error messages for this. Overall it will probably still be possible to break the code if a user really wants to. It will be quite difficult to catch all possible 'wrong' structures. But you are right that it is better to add the error messages right now if certain problems are known.
It is still possible to add too many hinges and create a mechanism. If this happens |
I think these two possibilities to break the code are relevant to treat with your new implementation as the old method didn't allow you to place multiple hinges at arbitrary points. So I argee with your implementation in 43f3faf |
@Tom-van-Woudenberg, I changed the name to |
@moorepants Regarding the failing checks for symbolic and float inputs. I had never heard about the "garbage in -> garbage out" philosophy, but I understand the idea of it. Using this idea I think the following checks can be removed:
There are also some checks that test less trivial faulty placements:
These lines check for faults a user can make by mistake. This was already possible before the change proposed in PR, but it can be caught now. Do you think these checks can also be removed or is it better to change these checks in a certain way that they can handle float and symbolic inputs? If you think it is better to keep the tests, do you maybe have some hints on how to do this? I tried a few possible solutions but they did not work. |
Still a bit vague? What about |
It is not accually the non zero moment. The moment can still be zero at points or even regions in the bending moment plot. The difference is that the bending moment equation no more containes singularity functions of orders lower than 0. I changed it to
|
@Tom-van-Woudenberg and @moorepants, I just pushed a new version without the placement checks when applying a hinge. This is done because of the 'garbage in -> garbage out' phylosophy. It would be nice if there was a possibilty to place a hinge "just" before or "just" after a support or load. This was not possible in the previous implementation and overshoots the goal of this pull request. I made an issue for this possible improvement, visible here: #26639. The rest of the given feedback is implemented, are there any more changes necessary? |
I left a spelling suggestion and are you sure it is degrees not radians? |
This is going in! Nice work :) |
Perfect, thank you! |
References to other Issues or PRs
This PR solves the problem described in issue #26570.
Brief description of what is fixed or changed
Implemented a new way to calculate beams with hinges using singularity functions. Using this new method beams with multiple hinges can be calculated.
Other comments
As this is a large pull request where multiple things change at once I will go though it point by point.
Added method
apply_hinges
.This method places a hinge anywhere in the beam using a singularity function of order -3.
It introduces a new unknown: the rotation of the hinge.
It introduces a new boundry condition: bending moment is 0 at the hinge.
Added new property
bc_bending_moment
which shows the bending moment boundry conditions.The setter of this property also adds the boundry conditions to
_boundry_conditions
.Added the new unknowns and boundry conditions to
solve_for_reaction_loads
.In this method the new unknowns and boundry conditions are added which gives this method the possibility to calculate beams with multiple hinges.
Changed the way the
join
method handles hinges.The
join
method used to handle hinges by settingself._composite_type
to hinge. Now that theapply_hinge
method is there it can apply a hinge on the new beam at the place where the beams are joined.Changed
self._composite_type
toself._joined_beam
As hinges are handled in a different way now it doesn't matter anymore if a beam is joined by a hinge or fixed. For some functions it is still needed to know if a beam is joined or not. That is why
self._composite_type
is changed toself._joined_beam
.Removed
_solve_hinge_beams
.As hinge beams can now be calculated in
solve_for_reaction_loads
this_solve_hinge_beams
method became obsolete.Small change in
draw
method, so that it can draw multiple hinges if necessary.Added an error message when trying to do I.L.D. calculations on a beam with hinges.
This was not, and still is not, implemented. This can be done at a later time.
Release Notes