ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 06 May 2019 10:16:03 -0500Calculation of a bending linehttp://ask.sagemath.org/question/46431/calculation-of-a-bending-line/Hi everybody,
i have two problems by using Sage to solve a technical difficulty and hope you can help me with it.
I want to calculate a bending line of a girder with two regions with different second moments of areas.
The first Problem is About the handling of sage. I get a solution, but i can't extract the single variables of the solution list.
The second Problem is that the solution isn't correct. I calculated the bending line at Excel and the area of the greater diameter has a wrong position and gradient. I don't know where the error is.
I hope you can help me and please excuse my bad english talent!
Greatings
Forceman
reset
var ('a_s,a,b,c,M,F,Delta,x_I,x_II')
var ('E,I_R,I_W')
var ('C_1_I,C_1_II,C_1_III,C_1_IV,C_2_I,C_2_II,C_2_III,C_2_IV')
MI=function('MI')(x_I)
MII=function('MII')(x_II)
MI = F*(a_s-x_I)
MII = M-M/c*x_II
w_sI = MI.integral(x_I)+C_1_I
w_I = (w_sI.integral(x_I)+C_2_I)/(E*I_W)
w_sI = w_sI/(E*I_W)
w_sII = MII.integral(x_II)+C_1_II
w_II = (w_sII.integral(x_II)+C_2_II)/(E*I_W)
w_sII = w_sII/(E*I_W)
w_sIII = MII.integral(x_II)+C_1_III
w_III = (w_sIII.integral(x_II)+C_2_III)/(E*I_R)
w_sIII = w_sIII/(E*I_R)
w_sIV = MII.integral(x_II)+C_1_IV
w_IV = (w_sIV.integral(x_II)+C_2_IV)/(E*I_W)
w_sIV = w_sIV/(E*I_W)
sols = solve([
w_I(x_I=0)==0,
w_sI(x_I=0)==w_sII(x_II=0),
w_II(x_II=0)==0,
w_II(x_II=a)==w_III(x_II=a),
w_sII(x_II=a)==w_sIII(x_II=a),
w_III(x_II=b)==w_IV(x_II=b),
w_sIII(x_II=b)==w_sIV(x_II=b),
w_IV(x_II=c)==0],
C_2_IV,C_2_III,C_2_II,C_2_I,C_1_IV,C_1_III,C_1_II,C_1_I,solution_dict=true)
C_1_I = C_1_I.subs(sols[0])
C_1_II = C_1_II.subs(sols[0])
C_1_III = C_1_III.subs(sols[0])
C_1_IV = C_1_IV.subs(sols[0])
C_2_I = C_2_I.subs(sols[0])
C_2_II = C_2_II.subs(sols[0])
C_2_III = C_2_III.subs(sols[0])
C_2_IV = C_2_IV.subs(sols[0])
**Update that the OP added as an "answer"; I have removed the answer and updated the question:**
MI = F*(a_s-x_I)
MII = M-M/c*x_II
This is the definition of the the moment course. The Moment is caused by the force at point V. Till the first bearing position the Moment increases, between the two bearings it decreases till 0.
![image description](https://www.bilder-upload.eu/thumb/17cce5-1557122907.png)
If the moment course is integrated two times, you get the bending line.
w_sI = MI.integral(x_I)+C_1_I
w_I = (w_sI.integral(x_I)+C_2_I)/(E*I_W)
w_sI = w_sI/(E*I_W)
Divided with the local stiffness `w_I` returns the displacement at position `x_I` in the area `I`, `w_sI` the inclation.
The constants of integration are received by the boundary conditions
sols = solve([
w_I(x_I=0)==0,
w_sI(x_I=0)==w_sII(x_II=0),
w_II(x_II=0)==0,
w_II(x_II=a)==w_III(x_II=a),
w_sII(x_II=a)==w_sIII(x_II=a),
w_III(x_II=b)==w_IV(x_II=b),
w_sIII(x_II=b)==w_sIV(x_II=b),
w_IV(x_II=c)==0],
C_2_IV,C_2_III,C_2_II,C_2_I,C_1_IV,C_1_III,C_1_II,C_1_I,solution_dict=true)
Here:
Displacement at the Bearing positions = 0, displacement and inclinations at the transition points are equal at both sides.
C_1_I = C_1_I.subs(sols[0])
C_1_II = C_1_II.subs(sols[0])
C_1_III = C_1_III.subs(sols[0])
C_1_IV = C_1_IV.subs(sols[0])
C_2_I = C_2_I.subs(sols[0])
C_2_II = C_2_II.subs(sols[0])
C_2_III = C_2_III.subs(sols[0])
C_2_IV = C_2_IV.subs(sols[0])
This part of the code only returns the equation `C_1_I` to all constants. The expression `sols[1]` returns an error.
The second error i think isn't a Sage error, rather an error of the mathematical approach, which i can't detect.
![image description](https://www.bilder-upload.eu/thumb/dec06a-1557122996.png)Fri, 03 May 2019 07:26:52 -0500http://ask.sagemath.org/question/46431/calculation-of-a-bending-line/Comment by Iguananaut for <p>Hi everybody,</p>
<p>i have two problems by using Sage to solve a technical difficulty and hope you can help me with it.</p>
<p>I want to calculate a bending line of a girder with two regions with different second moments of areas.</p>
<p>The first Problem is About the handling of sage. I get a solution, but i can't extract the single variables of the solution list. </p>
<p>The second Problem is that the solution isn't correct. I calculated the bending line at Excel and the area of the greater diameter has a wrong position and gradient. I don't know where the error is.</p>
<p>I hope you can help me and please excuse my bad english talent! </p>
<p>Greatings</p>
<p>Forceman</p>
<pre><code> reset
var ('a_s,a,b,c,M,F,Delta,x_I,x_II')
var ('E,I_R,I_W')
var ('C_1_I,C_1_II,C_1_III,C_1_IV,C_2_I,C_2_II,C_2_III,C_2_IV')
MI=function('MI')(x_I)
MII=function('MII')(x_II)
MI = F*(a_s-x_I)
MII = M-M/c*x_II
w_sI = MI.integral(x_I)+C_1_I
w_I = (w_sI.integral(x_I)+C_2_I)/(E*I_W)
w_sI = w_sI/(E*I_W)
w_sII = MII.integral(x_II)+C_1_II
w_II = (w_sII.integral(x_II)+C_2_II)/(E*I_W)
w_sII = w_sII/(E*I_W)
w_sIII = MII.integral(x_II)+C_1_III
w_III = (w_sIII.integral(x_II)+C_2_III)/(E*I_R)
w_sIII = w_sIII/(E*I_R)
w_sIV = MII.integral(x_II)+C_1_IV
w_IV = (w_sIV.integral(x_II)+C_2_IV)/(E*I_W)
w_sIV = w_sIV/(E*I_W)
sols = solve([
w_I(x_I=0)==0,
w_sI(x_I=0)==w_sII(x_II=0),
w_II(x_II=0)==0,
w_II(x_II=a)==w_III(x_II=a),
w_sII(x_II=a)==w_sIII(x_II=a),
w_III(x_II=b)==w_IV(x_II=b),
w_sIII(x_II=b)==w_sIV(x_II=b),
w_IV(x_II=c)==0],
C_2_IV,C_2_III,C_2_II,C_2_I,C_1_IV,C_1_III,C_1_II,C_1_I,solution_dict=true)
C_1_I = C_1_I.subs(sols[0])
C_1_II = C_1_II.subs(sols[0])
C_1_III = C_1_III.subs(sols[0])
C_1_IV = C_1_IV.subs(sols[0])
C_2_I = C_2_I.subs(sols[0])
C_2_II = C_2_II.subs(sols[0])
C_2_III = C_2_III.subs(sols[0])
C_2_IV = C_2_IV.subs(sols[0])
</code></pre>
<p><strong>Update that the OP added as an "answer"; I have removed the answer and updated the question:</strong></p>
<pre><code>MI = F*(a_s-x_I)
MII = M-M/c*x_II
</code></pre>
<p>This is the definition of the the moment course. The Moment is caused by the force at point V. Till the first bearing position the Moment increases, between the two bearings it decreases till 0.</p>
<p><img alt="image description" src="https://www.bilder-upload.eu/thumb/17cce5-1557122907.png"></p>
<p>If the moment course is integrated two times, you get the bending line. </p>
<pre><code>w_sI = MI.integral(x_I)+C_1_I
w_I = (w_sI.integral(x_I)+C_2_I)/(E*I_W)
w_sI = w_sI/(E*I_W)
</code></pre>
<p>Divided with the local stiffness <code>w_I</code> returns the displacement at position <code>x_I</code> in the area <code>I</code>, <code>w_sI</code> the inclation.</p>
<p>The constants of integration are received by the boundary conditions</p>
<pre><code>sols = solve([
w_I(x_I=0)==0,
w_sI(x_I=0)==w_sII(x_II=0),
w_II(x_II=0)==0,
w_II(x_II=a)==w_III(x_II=a),
w_sII(x_II=a)==w_sIII(x_II=a),
w_III(x_II=b)==w_IV(x_II=b),
w_sIII(x_II=b)==w_sIV(x_II=b),
w_IV(x_II=c)==0],
C_2_IV,C_2_III,C_2_II,C_2_I,C_1_IV,C_1_III,C_1_II,C_1_I,solution_dict=true)
</code></pre>
<p>Here:
Displacement at the Bearing positions = 0, displacement and inclinations at the transition points are equal at both sides.</p>
<pre><code>C_1_I = C_1_I.subs(sols[0])
C_1_II = C_1_II.subs(sols[0])
C_1_III = C_1_III.subs(sols[0])
C_1_IV = C_1_IV.subs(sols[0])
C_2_I = C_2_I.subs(sols[0])
C_2_II = C_2_II.subs(sols[0])
C_2_III = C_2_III.subs(sols[0])
C_2_IV = C_2_IV.subs(sols[0])
</code></pre>
<p>This part of the code only returns the equation <code>C_1_I</code> to all constants. The expression <code>sols[1]</code> returns an error.</p>
<p>The second error i think isn't a Sage error, rather an error of the mathematical approach, which i can't detect.</p>
<p><img alt="image description" src="https://www.bilder-upload.eu/thumb/dec06a-1557122996.png"></p>
http://ask.sagemath.org/question/46431/calculation-of-a-bending-line/?comment=46465#post-id-46465@Forceman Please note you can *edit* the contents of your question using the "edit" link at the bottom of the post. Please add updates as edits or comments, and not as "answers". I have gone ahead and deleted the updates you posted as an "answer" and added them as edits to your question.Mon, 06 May 2019 10:05:45 -0500http://ask.sagemath.org/question/46431/calculation-of-a-bending-line/?comment=46465#post-id-46465Comment by dan_fulea for <p>Hi everybody,</p>
<p>i have two problems by using Sage to solve a technical difficulty and hope you can help me with it.</p>
<p>I want to calculate a bending line of a girder with two regions with different second moments of areas.</p>
<p>The first Problem is About the handling of sage. I get a solution, but i can't extract the single variables of the solution list. </p>
<p>The second Problem is that the solution isn't correct. I calculated the bending line at Excel and the area of the greater diameter has a wrong position and gradient. I don't know where the error is.</p>
<p>I hope you can help me and please excuse my bad english talent! </p>
<p>Greatings</p>
<p>Forceman</p>
<pre><code> reset
var ('a_s,a,b,c,M,F,Delta,x_I,x_II')
var ('E,I_R,I_W')
var ('C_1_I,C_1_II,C_1_III,C_1_IV,C_2_I,C_2_II,C_2_III,C_2_IV')
MI=function('MI')(x_I)
MII=function('MII')(x_II)
MI = F*(a_s-x_I)
MII = M-M/c*x_II
w_sI = MI.integral(x_I)+C_1_I
w_I = (w_sI.integral(x_I)+C_2_I)/(E*I_W)
w_sI = w_sI/(E*I_W)
w_sII = MII.integral(x_II)+C_1_II
w_II = (w_sII.integral(x_II)+C_2_II)/(E*I_W)
w_sII = w_sII/(E*I_W)
w_sIII = MII.integral(x_II)+C_1_III
w_III = (w_sIII.integral(x_II)+C_2_III)/(E*I_R)
w_sIII = w_sIII/(E*I_R)
w_sIV = MII.integral(x_II)+C_1_IV
w_IV = (w_sIV.integral(x_II)+C_2_IV)/(E*I_W)
w_sIV = w_sIV/(E*I_W)
sols = solve([
w_I(x_I=0)==0,
w_sI(x_I=0)==w_sII(x_II=0),
w_II(x_II=0)==0,
w_II(x_II=a)==w_III(x_II=a),
w_sII(x_II=a)==w_sIII(x_II=a),
w_III(x_II=b)==w_IV(x_II=b),
w_sIII(x_II=b)==w_sIV(x_II=b),
w_IV(x_II=c)==0],
C_2_IV,C_2_III,C_2_II,C_2_I,C_1_IV,C_1_III,C_1_II,C_1_I,solution_dict=true)
C_1_I = C_1_I.subs(sols[0])
C_1_II = C_1_II.subs(sols[0])
C_1_III = C_1_III.subs(sols[0])
C_1_IV = C_1_IV.subs(sols[0])
C_2_I = C_2_I.subs(sols[0])
C_2_II = C_2_II.subs(sols[0])
C_2_III = C_2_III.subs(sols[0])
C_2_IV = C_2_IV.subs(sols[0])
</code></pre>
<p><strong>Update that the OP added as an "answer"; I have removed the answer and updated the question:</strong></p>
<pre><code>MI = F*(a_s-x_I)
MII = M-M/c*x_II
</code></pre>
<p>This is the definition of the the moment course. The Moment is caused by the force at point V. Till the first bearing position the Moment increases, between the two bearings it decreases till 0.</p>
<p><img alt="image description" src="https://www.bilder-upload.eu/thumb/17cce5-1557122907.png"></p>
<p>If the moment course is integrated two times, you get the bending line. </p>
<pre><code>w_sI = MI.integral(x_I)+C_1_I
w_I = (w_sI.integral(x_I)+C_2_I)/(E*I_W)
w_sI = w_sI/(E*I_W)
</code></pre>
<p>Divided with the local stiffness <code>w_I</code> returns the displacement at position <code>x_I</code> in the area <code>I</code>, <code>w_sI</code> the inclation.</p>
<p>The constants of integration are received by the boundary conditions</p>
<pre><code>sols = solve([
w_I(x_I=0)==0,
w_sI(x_I=0)==w_sII(x_II=0),
w_II(x_II=0)==0,
w_II(x_II=a)==w_III(x_II=a),
w_sII(x_II=a)==w_sIII(x_II=a),
w_III(x_II=b)==w_IV(x_II=b),
w_sIII(x_II=b)==w_sIV(x_II=b),
w_IV(x_II=c)==0],
C_2_IV,C_2_III,C_2_II,C_2_I,C_1_IV,C_1_III,C_1_II,C_1_I,solution_dict=true)
</code></pre>
<p>Here:
Displacement at the Bearing positions = 0, displacement and inclinations at the transition points are equal at both sides.</p>
<pre><code>C_1_I = C_1_I.subs(sols[0])
C_1_II = C_1_II.subs(sols[0])
C_1_III = C_1_III.subs(sols[0])
C_1_IV = C_1_IV.subs(sols[0])
C_2_I = C_2_I.subs(sols[0])
C_2_II = C_2_II.subs(sols[0])
C_2_III = C_2_III.subs(sols[0])
C_2_IV = C_2_IV.subs(sols[0])
</code></pre>
<p>This part of the code only returns the equation <code>C_1_I</code> to all constants. The expression <code>sols[1]</code> returns an error.</p>
<p>The second error i think isn't a Sage error, rather an error of the mathematical approach, which i can't detect.</p>
<p><img alt="image description" src="https://www.bilder-upload.eu/thumb/dec06a-1557122996.png"></p>
http://ask.sagemath.org/question/46431/calculation-of-a-bending-line/?comment=46442#post-id-46442Please document the code and/ or explain the mathematical situation. Then explicitly, which data cannot be extracted from the above solution? Which is the object that cannot be inspected? And which is the expected solution. Is there maybe some simpler situation with the same problem (but with less and/or simpler equations)? Why does the simple extraction `sage: sols[0][C_2_III]` with the answer
`1/6*(2*(I_R - I_W)*M*a^3 - 3*(I_R - I_W)*M*a^2*c)/(I_W*c)` not work?Fri, 03 May 2019 13:52:26 -0500http://ask.sagemath.org/question/46431/calculation-of-a-bending-line/?comment=46442#post-id-46442Answer by Iguananaut for <p>Hi everybody,</p>
<p>i have two problems by using Sage to solve a technical difficulty and hope you can help me with it.</p>
<p>I want to calculate a bending line of a girder with two regions with different second moments of areas.</p>
<p>The first Problem is About the handling of sage. I get a solution, but i can't extract the single variables of the solution list. </p>
<p>The second Problem is that the solution isn't correct. I calculated the bending line at Excel and the area of the greater diameter has a wrong position and gradient. I don't know where the error is.</p>
<p>I hope you can help me and please excuse my bad english talent! </p>
<p>Greatings</p>
<p>Forceman</p>
<pre><code> reset
var ('a_s,a,b,c,M,F,Delta,x_I,x_II')
var ('E,I_R,I_W')
var ('C_1_I,C_1_II,C_1_III,C_1_IV,C_2_I,C_2_II,C_2_III,C_2_IV')
MI=function('MI')(x_I)
MII=function('MII')(x_II)
MI = F*(a_s-x_I)
MII = M-M/c*x_II
w_sI = MI.integral(x_I)+C_1_I
w_I = (w_sI.integral(x_I)+C_2_I)/(E*I_W)
w_sI = w_sI/(E*I_W)
w_sII = MII.integral(x_II)+C_1_II
w_II = (w_sII.integral(x_II)+C_2_II)/(E*I_W)
w_sII = w_sII/(E*I_W)
w_sIII = MII.integral(x_II)+C_1_III
w_III = (w_sIII.integral(x_II)+C_2_III)/(E*I_R)
w_sIII = w_sIII/(E*I_R)
w_sIV = MII.integral(x_II)+C_1_IV
w_IV = (w_sIV.integral(x_II)+C_2_IV)/(E*I_W)
w_sIV = w_sIV/(E*I_W)
sols = solve([
w_I(x_I=0)==0,
w_sI(x_I=0)==w_sII(x_II=0),
w_II(x_II=0)==0,
w_II(x_II=a)==w_III(x_II=a),
w_sII(x_II=a)==w_sIII(x_II=a),
w_III(x_II=b)==w_IV(x_II=b),
w_sIII(x_II=b)==w_sIV(x_II=b),
w_IV(x_II=c)==0],
C_2_IV,C_2_III,C_2_II,C_2_I,C_1_IV,C_1_III,C_1_II,C_1_I,solution_dict=true)
C_1_I = C_1_I.subs(sols[0])
C_1_II = C_1_II.subs(sols[0])
C_1_III = C_1_III.subs(sols[0])
C_1_IV = C_1_IV.subs(sols[0])
C_2_I = C_2_I.subs(sols[0])
C_2_II = C_2_II.subs(sols[0])
C_2_III = C_2_III.subs(sols[0])
C_2_IV = C_2_IV.subs(sols[0])
</code></pre>
<p><strong>Update that the OP added as an "answer"; I have removed the answer and updated the question:</strong></p>
<pre><code>MI = F*(a_s-x_I)
MII = M-M/c*x_II
</code></pre>
<p>This is the definition of the the moment course. The Moment is caused by the force at point V. Till the first bearing position the Moment increases, between the two bearings it decreases till 0.</p>
<p><img alt="image description" src="https://www.bilder-upload.eu/thumb/17cce5-1557122907.png"></p>
<p>If the moment course is integrated two times, you get the bending line. </p>
<pre><code>w_sI = MI.integral(x_I)+C_1_I
w_I = (w_sI.integral(x_I)+C_2_I)/(E*I_W)
w_sI = w_sI/(E*I_W)
</code></pre>
<p>Divided with the local stiffness <code>w_I</code> returns the displacement at position <code>x_I</code> in the area <code>I</code>, <code>w_sI</code> the inclation.</p>
<p>The constants of integration are received by the boundary conditions</p>
<pre><code>sols = solve([
w_I(x_I=0)==0,
w_sI(x_I=0)==w_sII(x_II=0),
w_II(x_II=0)==0,
w_II(x_II=a)==w_III(x_II=a),
w_sII(x_II=a)==w_sIII(x_II=a),
w_III(x_II=b)==w_IV(x_II=b),
w_sIII(x_II=b)==w_sIV(x_II=b),
w_IV(x_II=c)==0],
C_2_IV,C_2_III,C_2_II,C_2_I,C_1_IV,C_1_III,C_1_II,C_1_I,solution_dict=true)
</code></pre>
<p>Here:
Displacement at the Bearing positions = 0, displacement and inclinations at the transition points are equal at both sides.</p>
<pre><code>C_1_I = C_1_I.subs(sols[0])
C_1_II = C_1_II.subs(sols[0])
C_1_III = C_1_III.subs(sols[0])
C_1_IV = C_1_IV.subs(sols[0])
C_2_I = C_2_I.subs(sols[0])
C_2_II = C_2_II.subs(sols[0])
C_2_III = C_2_III.subs(sols[0])
C_2_IV = C_2_IV.subs(sols[0])
</code></pre>
<p>This part of the code only returns the equation <code>C_1_I</code> to all constants. The expression <code>sols[1]</code> returns an error.</p>
<p>The second error i think isn't a Sage error, rather an error of the mathematical approach, which i can't detect.</p>
<p><img alt="image description" src="https://www.bilder-upload.eu/thumb/dec06a-1557122996.png"></p>
http://ask.sagemath.org/question/46431/calculation-of-a-bending-line/?answer=46466#post-id-46466Regarding your first question
> I get a solution, but i can't extract the single variables of the solution list.
I'm not sure what you mean here. I get:
sage: sols[0]
{C_2_IV: 1/6*(2*(I_R - I_W)*M*a^3 - 2*(I_R*b^3 - I_W*b^3)*M - 3*((I_R - I_W)*M*a^2 - (I_R*b^2 - I_W*b^2)*M)*c)/(I_R*c),
C_2_III: 1/6*(2*(I_R - I_W)*M*a^3 - 3*(I_R - I_W)*M*a^2*c)/(I_W*c),
C_2_II: 0,
C_2_I: 0,
C_1_IV: -1/6*(2*(I_R - I_W)*M*a^3 + 2*I_R*M*c^3 - 2*(I_R*b^3 - I_W*b^3)*M - 3*((I_R - I_W)*M*a^2 - (I_R*b^2 - I_W*b^2)*M)*c)/(I_R*c^2),
C_1_III: -1/6*(2*(I_R - I_W)*M*a^3 + 2*I_R*M*c^3 - 6*(I_R*b - I_W*b)*M*c^2 - 2*(I_R*b^3 - I_W*b^3)*M - 3*((I_R - I_W)*M*a^2 - 2*(I_R*b^2 - I_W*b^2)*M)*c)/(I_W*c^2),
C_1_II: -1/3*((I_R - I_W)*M*a^3 + I_R*M*c^3 + 3*((I_R - I_W)*M*a - (I_R*b - I_W*b)*M)*c^2 - (I_R*b^3 - I_W*b^3)*M - 3*((I_R - I_W)*M*a^2 - (I_R*b^2 - I_W*b^2)*M)*c)/(I_R*c^2),
C_1_I: -1/3*((I_R - I_W)*M*a^3 + I_R*M*c^3 + 3*((I_R - I_W)*M*a - (I_R*b - I_W*b)*M)*c^2 - (I_R*b^3 - I_W*b^3)*M - 3*((I_R - I_W)*M*a^2 - (I_R*b^2 - I_W*b^2)*M)*c)/(I_R*c^2)}
In this case there is one solution (`sols[0]`). Since you passed `solution_dict=True` you get the solutions for each variable as a [`dict`](https://doc.sagemath.org/html/en/thematic_tutorials/tutorial-programming-python.html#dictionaries), so the solution for each variable can be extracted like:
sage: sol = sols[0] # assign the sole solution to its own variable for convenience
sage: sol[C_1_I]
-1/3*((I_R - I_W)*M*a^3 + I_R*M*c^3 + 3*((I_R - I_W)*M*a - (I_R*b - I_W*b)*M)*c^2 - (I_R*b^3 - I_W*b^3)*M - 3*((I_R - I_W)*M*a^2 - (I_R*b^2 - I_W*b^2)*M)*c)/(I_R*c^2)
and so on. For ease of viewing you can also convert it to $ \LaTeX $ :
sage: latex(sol[C_1_I])
$
-\frac{{\left(I_{R} - I_{W}\right)} M a^{3} + I_{R} M c^{3} + 3 \, {\left({\left(I_{R} - I_{W}\right)} M a - {\left(I_{R} b - I_{W} b\right)} M\right)} c^{2} - {\left(I_{R} b^{3} - I_{W} b^{3}\right)} M - 3 \, {\left({\left(I_{R} - I_{W}\right)} M a^{2} - {\left(I_{R} b^{2} - I_{W} b^{2}\right)} M\right)} c}{3 \, I_{R} c^{2}}
$
The next step would be to make sure that those solutions make sense to you. Check things step be step and make sure that all intermediate results are correct.Mon, 06 May 2019 10:16:03 -0500http://ask.sagemath.org/question/46431/calculation-of-a-bending-line/?answer=46466#post-id-46466Answer by Forceman for <p>Hi everybody,</p>
<p>i have two problems by using Sage to solve a technical difficulty and hope you can help me with it.</p>
<p>I want to calculate a bending line of a girder with two regions with different second moments of areas.</p>
<p>The first Problem is About the handling of sage. I get a solution, but i can't extract the single variables of the solution list. </p>
<p>The second Problem is that the solution isn't correct. I calculated the bending line at Excel and the area of the greater diameter has a wrong position and gradient. I don't know where the error is.</p>
<p>I hope you can help me and please excuse my bad english talent! </p>
<p>Greatings</p>
<p>Forceman</p>
<pre><code> reset
var ('a_s,a,b,c,M,F,Delta,x_I,x_II')
var ('E,I_R,I_W')
var ('C_1_I,C_1_II,C_1_III,C_1_IV,C_2_I,C_2_II,C_2_III,C_2_IV')
MI=function('MI')(x_I)
MII=function('MII')(x_II)
MI = F*(a_s-x_I)
MII = M-M/c*x_II
w_sI = MI.integral(x_I)+C_1_I
w_I = (w_sI.integral(x_I)+C_2_I)/(E*I_W)
w_sI = w_sI/(E*I_W)
w_sII = MII.integral(x_II)+C_1_II
w_II = (w_sII.integral(x_II)+C_2_II)/(E*I_W)
w_sII = w_sII/(E*I_W)
w_sIII = MII.integral(x_II)+C_1_III
w_III = (w_sIII.integral(x_II)+C_2_III)/(E*I_R)
w_sIII = w_sIII/(E*I_R)
w_sIV = MII.integral(x_II)+C_1_IV
w_IV = (w_sIV.integral(x_II)+C_2_IV)/(E*I_W)
w_sIV = w_sIV/(E*I_W)
sols = solve([
w_I(x_I=0)==0,
w_sI(x_I=0)==w_sII(x_II=0),
w_II(x_II=0)==0,
w_II(x_II=a)==w_III(x_II=a),
w_sII(x_II=a)==w_sIII(x_II=a),
w_III(x_II=b)==w_IV(x_II=b),
w_sIII(x_II=b)==w_sIV(x_II=b),
w_IV(x_II=c)==0],
C_2_IV,C_2_III,C_2_II,C_2_I,C_1_IV,C_1_III,C_1_II,C_1_I,solution_dict=true)
C_1_I = C_1_I.subs(sols[0])
C_1_II = C_1_II.subs(sols[0])
C_1_III = C_1_III.subs(sols[0])
C_1_IV = C_1_IV.subs(sols[0])
C_2_I = C_2_I.subs(sols[0])
C_2_II = C_2_II.subs(sols[0])
C_2_III = C_2_III.subs(sols[0])
C_2_IV = C_2_IV.subs(sols[0])
</code></pre>
<p><strong>Update that the OP added as an "answer"; I have removed the answer and updated the question:</strong></p>
<pre><code>MI = F*(a_s-x_I)
MII = M-M/c*x_II
</code></pre>
<p>This is the definition of the the moment course. The Moment is caused by the force at point V. Till the first bearing position the Moment increases, between the two bearings it decreases till 0.</p>
<p><img alt="image description" src="https://www.bilder-upload.eu/thumb/17cce5-1557122907.png"></p>
<p>If the moment course is integrated two times, you get the bending line. </p>
<pre><code>w_sI = MI.integral(x_I)+C_1_I
w_I = (w_sI.integral(x_I)+C_2_I)/(E*I_W)
w_sI = w_sI/(E*I_W)
</code></pre>
<p>Divided with the local stiffness <code>w_I</code> returns the displacement at position <code>x_I</code> in the area <code>I</code>, <code>w_sI</code> the inclation.</p>
<p>The constants of integration are received by the boundary conditions</p>
<pre><code>sols = solve([
w_I(x_I=0)==0,
w_sI(x_I=0)==w_sII(x_II=0),
w_II(x_II=0)==0,
w_II(x_II=a)==w_III(x_II=a),
w_sII(x_II=a)==w_sIII(x_II=a),
w_III(x_II=b)==w_IV(x_II=b),
w_sIII(x_II=b)==w_sIV(x_II=b),
w_IV(x_II=c)==0],
C_2_IV,C_2_III,C_2_II,C_2_I,C_1_IV,C_1_III,C_1_II,C_1_I,solution_dict=true)
</code></pre>
<p>Here:
Displacement at the Bearing positions = 0, displacement and inclinations at the transition points are equal at both sides.</p>
<pre><code>C_1_I = C_1_I.subs(sols[0])
C_1_II = C_1_II.subs(sols[0])
C_1_III = C_1_III.subs(sols[0])
C_1_IV = C_1_IV.subs(sols[0])
C_2_I = C_2_I.subs(sols[0])
C_2_II = C_2_II.subs(sols[0])
C_2_III = C_2_III.subs(sols[0])
C_2_IV = C_2_IV.subs(sols[0])
</code></pre>
<p>This part of the code only returns the equation <code>C_1_I</code> to all constants. The expression <code>sols[1]</code> returns an error.</p>
<p>The second error i think isn't a Sage error, rather an error of the mathematical approach, which i can't detect.</p>
<p><img alt="image description" src="https://www.bilder-upload.eu/thumb/dec06a-1557122996.png"></p>
http://ask.sagemath.org/question/46431/calculation-of-a-bending-line/?answer=46459#post-id-46459 MI = F*(a_s-x_I)
MII = M-M/c*x_II
This is the definition of the the moment course. The Moment is caused by the force at point V. Till the first bearing position the Moment increases, between the two bearings it decreases till 0.
[URL=https://www.bilder-upload.eu/bild-17cce5-1557122907.png.html][IMG]https://www.bilder-upload.eu/thumb/17cce5-1557122907.png[/IMG][/URL]
If the moment course is integrated two times, you get the bending line.
w_sI = MI.integral(x_I)+C_1_I
w_I = (w_sI.integral(x_I)+C_2_I)/(E*I_W)
w_sI = w_sI/(E*I_W)
Divided with the local stiffness w_I returns the displacement at position x_I in the area I, w_sI the inclation.
The constants of inegration are recieved by the boundary conditions
sols = solve([
w_I(x_I=0)==0,
w_sI(x_I=0)==w_sII(x_II=0),
w_II(x_II=0)==0,
w_II(x_II=a)==w_III(x_II=a),
w_sII(x_II=a)==w_sIII(x_II=a),
w_III(x_II=b)==w_IV(x_II=b),
w_sIII(x_II=b)==w_sIV(x_II=b),
w_IV(x_II=c)==0],
C_2_IV,C_2_III,C_2_II,C_2_I,C_1_IV,C_1_III,C_1_II,C_1_I,solution_dict=true)
Here:
Displacement at the Bearing positions = 0, displacment and inclations at the transition points are equal at both sides.
C_1_I = C_1_I.subs(sols[0])
C_1_II = C_1_II.subs(sols[0])
C_1_III = C_1_III.subs(sols[0])
C_1_IV = C_1_IV.subs(sols[0])
C_2_I = C_2_I.subs(sols[0])
C_2_II = C_2_II.subs(sols[0])
C_2_III = C_2_III.subs(sols[0])
C_2_IV = C_2_IV.subs(sols[0])
This part of the code only returns the equation C_1_I to all constants. The expression sols[1] returns an error.
The second error i think isn't a Sage error, rather an error of the mathematical approach, which i can't detect.
[URL=https://www.bilder-upload.eu/bild-dec06a-1557122996.png.html][IMG]https://www.bilder-upload.eu/thumb/dec06a-1557122996.png[/IMG][/URL]
![image description](https://www.bilder-upload.eu/bild-dec06a-1557122996.png.html][IMG]https://www.bilder-upload.eu/thumb/dec06a-1557122996.png)Mon, 06 May 2019 01:10:55 -0500http://ask.sagemath.org/question/46431/calculation-of-a-bending-line/?answer=46459#post-id-46459