# 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)
C_1_II = C_1_II.subs(sols)
C_1_III = C_1_III.subs(sols)
C_1_IV = C_1_IV.subs(sols)
C_2_I = C_2_I.subs(sols)
C_2_II = C_2_II.subs(sols)
C_2_III = C_2_III.subs(sols)
C_2_IV = C_2_IV.subs(sols)


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. 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)
C_1_II = C_1_II.subs(sols)
C_1_III = C_1_III.subs(sols)
C_1_IV = C_1_IV.subs(sols)
C_2_I = C_2_I.subs(sols)
C_2_II = C_2_II.subs(sols)
C_2_III = C_2_III.subs(sols)
C_2_IV = C_2_IV.subs(sols)


This part of the code only returns the equation C_1_I to all constants. The expression sols 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. edit retag close merge delete

1

Please 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[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?

Sort by » oldest newest most voted

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
{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). Since you passed solution_dict=True you get the solutions for each variable as a dict, so the solution for each variable can be extracted like:

sage: sol = sols  # 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.

more