Voorbeelden 1 t/m 3

Voorbeelden 1 t/m 3#

import sympy as sp
import numpy as np
from sympy import symbols
sf = sp.SingularityFunction
import matplotlib.pyplot as plt
EI = symbols('EI')
x = symbols('x')
## het oplossen van differentiaal vergelijking
## in x-richting
# Define the symbols
cv, cn, qx, qz, theta = sp.symbols('cv, cn, qx, qz, theta')  ## cv = dv/dx, cn = dn/dx

# Define the equations
eq1 = (qx* sp.tan(theta)) + (sp.sin(theta) * cv) + (sp.cos(theta) * cn)
eq2 = (qz) + (sp.cos(theta) * cv) - (sp.sin(theta) * cn)

# Solve the system of equations
solution = sp.solve((eq1, eq2), (cv, cn))

# Display the solution
print("Solution in the x-direction:")
display("dV/dx =", solution[cv])
display("dN/dx =", solution[cn])
Solution in the x-direction:
'dV/dx ='
\[\displaystyle - qx \sin{\left(\theta \right)} \tan{\left(\theta \right)} - qz \cos{\left(\theta \right)}\]
'dN/dx ='
\[\displaystyle \left(- qx + qz\right) \sin{\left(\theta \right)}\]
## het oplossen van differentiaal vergelijking

## in x-richting

# Define the symbols
cv, cn, qx, qz, theta = sp.symbols('cv, cn, qx, qz, theta')  ## cv = dv/dx, cn = dn/dx

# Define the equations
eq1 = (qx) + (sp.sin(theta) * cv) + (sp.cos(theta) * cn)
eq2 = (qz) + (sp.cos(theta) * cv) - (sp.sin(theta) * cn)

# Solve the system of equations
solution = sp.solve((eq1, eq2), (cv, cn))

# Display the solution
print("Solution in the x-direction:")
display("dV/dx =", solution[cv])
display("dN/dx =", solution[cn])
Solution in the x-direction:
'dV/dx ='
\[\displaystyle - qx \sin{\left(\theta \right)} - qz \cos{\left(\theta \right)}\]
'dN/dx ='
\[\displaystyle - qx \cos{\left(\theta \right)} + qz \sin{\left(\theta \right)}\]

Voorbeeld 1#

Cv, Cm, Cphi, Cw, Av, Bv, Ah, Cn, Cu = sp.symbols('Cv, Cm, Cphi, Cw, Av, Bv, Ah, Cn, Cu')

# F, l en theta definiëren 
F = 10  ## KN
l = 4   ## m
theta = sp.atan(1/2) 

# qz en qx definiëren
qz = -Av * sf(x, 0, -1) + F * sf(x, l/2, -1) - Bv * sf(x, l, -1)
qx = Ah * sf(x, 0, -1)
# V definiëren als een functie van x
V = sp.integrate(-qx * sp.sin(theta), x) + sp.integrate(-qz * sp.cos(theta), x) + Cv
# N definiëren als een functie van x
N = sp.integrate(-qx * sp.cos(theta), x) + sp.integrate(qz * sp.sin(theta), x) + Cn
# N definiëren als een functie van x
M = sp.integrate(V/sp.cos(theta), x) + Cm

# phi definiëren als een functie van x
phi = sp.integrate(M, x) + Cphi

# W definiëren als een functie van x
W = sp.integrate(-phi, x) + Cw
# u definiëren als een functie van x
u = sp.integrate(N, x) + Cu
display("V:", V)
display("M:", M)
display("phi:", phi)
display("W:", W)
display("N:", N)
display("u:", u)
'V:'
\[\displaystyle - 0.447213595499958 Ah {\left\langle x \right\rangle}^{0} + 0.894427190999916 Av {\left\langle x \right\rangle}^{0} + 0.894427190999916 Bv {\left\langle x - 4 \right\rangle}^{0} + Cv - 8.94427190999916 {\left\langle x - 2.0 \right\rangle}^{0}\]
'M:'
\[\displaystyle - 0.5 Ah {\left\langle x \right\rangle}^{1} + 1.0 Av {\left\langle x \right\rangle}^{1} + 1.0 Bv {\left\langle x - 4 \right\rangle}^{1} + Cm + 1.11803398874989 Cv x - 10.0 {\left\langle x - 2.0 \right\rangle}^{1}\]
'phi:'
\[\displaystyle - 0.25 Ah {\left\langle x \right\rangle}^{2} + 0.5 Av {\left\langle x \right\rangle}^{2} + 0.5 Bv {\left\langle x - 4 \right\rangle}^{2} + Cm x + Cphi + 0.559016994374947 Cv x^{2} - 5.0 {\left\langle x - 2.0 \right\rangle}^{2}\]
'W:'
\[\displaystyle 0.0833333333333333 Ah {\left\langle x \right\rangle}^{3} - 0.166666666666667 Av {\left\langle x \right\rangle}^{3} - 0.166666666666667 Bv {\left\langle x - 4 \right\rangle}^{3} - \frac{Cm x^{2}}{2} - Cphi x - 0.186338998124982 Cv x^{3} + Cw + 1.66666666666667 {\left\langle x - 2.0 \right\rangle}^{3}\]
'N:'
\[\displaystyle - 0.894427190999916 Ah {\left\langle x \right\rangle}^{0} - 0.447213595499958 Av {\left\langle x \right\rangle}^{0} - 0.447213595499958 Bv {\left\langle x - 4 \right\rangle}^{0} + Cn + 4.47213595499958 {\left\langle x - 2.0 \right\rangle}^{0}\]
'u:'
\[\displaystyle - 0.894427190999916 Ah {\left\langle x \right\rangle}^{1} - 0.447213595499958 Av {\left\langle x \right\rangle}^{1} - 0.447213595499958 Bv {\left\langle x - 4 \right\rangle}^{1} + Cn x + Cu + 4.47213595499958 {\left\langle x - 2.0 \right\rangle}^{1}\]
## Voorwarden

eq1 = V.subs(x, -1)
eq2 = V.subs(x, l+1) 

eq3 = M.subs(x, 0)
eq4 = M.subs(x, l)

eq5 = W.subs(x, l)
eq6 = W.subs(x, 0)

eq7 = N.subs(x, -1)
eq8 = N.subs(x, l+1)

eq9 = u.subs(x, 0)

equations = [eq1 -0, eq2-0,eq3-0,eq4-0,eq5-0,eq6-0, eq7-0, eq8 -0, eq9 - 0]
solutions = sp.solve(equations, (Cv, Cm, Cphi, Cw, Av, Bv, Ah, Cn, Cu))
print(solutions)
{Cv: 0.0, Cm: 0.0, Cphi: -10.0000000000000, Cw: 0.0, Av: 5.00000000000000, Bv: 5.00000000000000, Ah: 0.0, Cn: 0.0, Cu: 0.0}
l/sp.cos(theta)
\[\displaystyle 4.47213595499958\]
x_val = np.linspace(0, 4.47213595499958, 901)
V_numpy = sp.lambdify(x,V.subs(solutions).rewrite(sp.Piecewise).simplify()) #substitute full solution, make python function of formula
V_list = V_numpy(x_val)

#print(V_list)
fig = plt.figure(figsize=(10, 5))
ax = fig.add_subplot(1, 1, 1)
ax.set_xlim(0, 4.48)
ax.set_ylim(-6, 10)

ax.spines["left"].set_position("zero")
ax.spines["right"].set_visible(False)
ax.spines["bottom"].set_position("zero")
ax.spines["top"].set_visible(False)


ax.set_xlabel("$V-lijn$")
ax.xaxis.set_label_coords(0.53, 1.04)
plt.gca()
ax.plot(x_val/sp.cos(theta), np.array(V_list) , label='V-lijn')
plt.text(0.7, 2, f'{V_list[100]:.2f}', fontsize=25, color='red')
plt.text(3, -2.4, f'{V_list[500]:.2f}', fontsize=25, color='red')
plt.savefig('V_lijnvoorbeeld1', dpi=450);
../../_images/d79690e007b1372c4ff177de800ce785e679a4ce05ebee7b3a44fa3bb8dd6893.png
x_val = np.linspace(0, l, 901)
M_numpy = sp.lambdify(x,M.subs(solutions).rewrite(sp.Piecewise).simplify()) #substitute full solution, make python function of formula
M_list = M_numpy(x_val)
#print(M_list)
fig = plt.figure(figsize=(10, 5))
ax = fig.add_subplot(1, 1, 1)
ax.set_xlim(0, 4.48)
ax.set_ylim(-14, 10)

ax.spines["left"].set_position("zero")
ax.spines["right"].set_visible(False)
ax.spines["bottom"].set_position("zero")
ax.spines["top"].set_visible(False)


ax.set_xlabel("$M-lijn$")
ax.xaxis.set_label_coords(0.53, 1.04)
plt.gca()
ax.plot(x_val/sp.cos(theta), - np.array(M_list) , label='M-lijn');
plt.savefig('M_lijnvoorbeeld1', dpi=450);
../../_images/8a651d080372529f3325238c565879c7bf297ac6068dba22a53345bfe6cb414b.png
x_val = np.linspace(0, l, 901)
phi_numpy = sp.lambdify(x,phi.subs(solutions).rewrite(sp.Piecewise).simplify()) #substitute full solution, make python function of formula
phi_list = phi_numpy(x_val)
fig = plt.figure(figsize=(10, 5))
ax = fig.add_subplot(1, 1, 1)
ax.set_xlim(0, 4.48)
ax.set_ylim(-12, 12)

ax.spines["left"].set_position("zero")
ax.spines["right"].set_visible(False)
ax.spines["bottom"].set_position("zero")
ax.spines["top"].set_visible(False)


ax.set_xlabel("$EI*phi-lijn$")
ax.xaxis.set_label_coords(0.53, 1.04)
plt.gca()
ax.plot(x_val/sp.cos(theta), np.array(phi_list) , label='phi-lijn')
plt.savefig('phi_lijnvoorbeeld1', dpi=450);
../../_images/3adff06e7db654e3648d8709f3fb69ecf25a46dae2776a1fd4ebb91285cc43c1.png
x_val = np.linspace(0, l, 901)
W_numpy = sp.lambdify(x,W.subs(solutions).rewrite(sp.Piecewise).simplify()) #substitute full solution, make python function of formula
W_list = W_numpy(x_val)
fig = plt.figure(figsize=(10, 5))
ax = fig.add_subplot(1, 1, 1)
ax.set_xlim(0, 4.48)
ax.set_ylim(-15, 2)

ax.spines["left"].set_position("zero")
ax.spines["right"].set_visible(False)
ax.spines["bottom"].set_position("zero")
ax.spines["top"].set_visible(False)


ax.set_xlabel("$EI*w-lijn$")
ax.xaxis.set_label_coords(0.53, 1.04)
plt.gca()
ax.plot(x_val/sp.cos(theta), - np.array(W_list) , label='w-lijn')
plt.savefig('w_lijnvoorbeeld1', dpi=450);
../../_images/2dedbe7b9813006094d369c3acc513fbd49b9926fe992274cbfd42abfc10ce4c.png
x_val = np.linspace(0,  4.47213595499958, 901)
N_numpy = sp.lambdify(x,N.subs(solutions).rewrite(sp.Piecewise).simplify()) #substitute full solution, make python function of formula
N_list = N_numpy(x_val)
fig = plt.figure(figsize=(10, 5))
ax = fig.add_subplot(1, 1, 1)
ax.set_xlim(0, 4.48)
ax.set_ylim(-4, 4)

ax.spines["left"].set_position("zero")
ax.spines["right"].set_visible(False)
ax.spines["bottom"].set_position("zero")
ax.spines["top"].set_visible(False)


ax.set_xlabel("$N-lijn$")
ax.xaxis.set_label_coords(0.53, 1.04)
plt.text(0.7, -1, f'{N_list[100]:.2f}', fontsize=25, color='red')
plt.text(3, 1.2, f'{N_list[500]:.2f}', fontsize=25, color='red')
plt.gca()
ax.plot(x_val/sp.cos(theta),  np.array(N_list) , label='N-lijn')
plt.savefig('N_lijnvoorbeeld1', dpi=450);
../../_images/f6c33a83199eba5c2bd591a3e339880210fed1b1911c251beacedc17e2b2e3ab.png
x_val = np.linspace(0, l, 301)
u_numpy = sp.lambdify(x,u.subs(solutions).rewrite(sp.Piecewise).simplify()) #substitute full solution, make python function of formula
u_list = u_numpy(x_val)
fig = plt.figure(figsize=(10, 5))
ax = fig.add_subplot(1, 1, 1)
ax.set_xlim(0, 4.48)
ax.set_ylim(-6, 4)

ax.spines["left"].set_position("zero")
ax.spines["right"].set_visible(False)
ax.spines["bottom"].set_position("zero")
ax.spines["top"].set_visible(False)


ax.set_xlabel("$EA*u-lijn$")
ax.xaxis.set_label_coords(0.53, 1.04)
plt.gca()
ax.plot(x_val/sp.cos(theta),  np.array(u_list) , label='u-lijn')
plt.savefig('u_lijnvoorbeeld1', dpi=450);
../../_images/03cebfb02d5bfdc9a23839e2b14f854e7d16aed30c06fcd8e5291e85569f6e10.png

Voorbeeld 2#

Cv, Cm, Cphi, Cw, Av, MA, Ah, Cn, Cu = sp.symbols('Cv, Cm, Cphi, Cw, Av, MA, Ah, Cn, Cu')

# F, l en theta definiëren 
F = 10  ## KN
l = 4   ## m
theta = sp.atan(1/2) 

# qz en qx definiëren
qz = -Av * sf(x, 0, -1) + MA * sf(x, 0, -2) + F * sf(x, l, -1)
qx = Ah * sf(x, 0, -1) - F * sf(x, l, -1)
# V definiëren als een functie van x
V = sp.integrate(-qx * sp.sin(theta), x) + sp.integrate(-qz * sp.cos(theta), x) + Cv
# N definiëren als een functie van x
N = sp.integrate(-qx * sp.cos(theta), x) + sp.integrate(qz * sp.sin(theta), x) + Cn
# N definiëren als een functie van x
M = sp.integrate(V/sp.cos(theta), x) + Cm

# phi definiëren als een functie van x
phi = sp.integrate(M, x) + Cphi

# W definiëren als een functie van x
W = sp.integrate(-phi, x) + Cw
# u definiëren als een functie van x
u = sp.integrate(N, x) + Cu
display("V:", V)
display("M:", M)
display("phi:", phi)
display("W:", W)
display("N:", N)
display("u:", u)
'V:'
\[\displaystyle - 0.447213595499958 Ah {\left\langle x \right\rangle}^{0} + 0.894427190999916 Av {\left\langle x \right\rangle}^{0} + Cv - 0.894427190999916 MA {\left\langle x \right\rangle}^{-1} - 4.47213595499958 {\left\langle x - 4 \right\rangle}^{0}\]
'M:'
\[\displaystyle - 0.5 Ah {\left\langle x \right\rangle}^{1} + 1.0 Av {\left\langle x \right\rangle}^{1} + Cm + 1.11803398874989 Cv x - 1.0 MA {\left\langle x \right\rangle}^{0} - 5.0 {\left\langle x - 4 \right\rangle}^{1}\]
'phi:'
\[\displaystyle - 0.25 Ah {\left\langle x \right\rangle}^{2} + 0.5 Av {\left\langle x \right\rangle}^{2} + Cm x + Cphi + 0.559016994374947 Cv x^{2} - 1.0 MA {\left\langle x \right\rangle}^{1} - 2.5 {\left\langle x - 4 \right\rangle}^{2}\]
'W:'
\[\displaystyle 0.0833333333333333 Ah {\left\langle x \right\rangle}^{3} - 0.166666666666667 Av {\left\langle x \right\rangle}^{3} - \frac{Cm x^{2}}{2} - Cphi x - 0.186338998124982 Cv x^{3} + Cw + 0.5 MA {\left\langle x \right\rangle}^{2} + 0.833333333333333 {\left\langle x - 4 \right\rangle}^{3}\]
'N:'
\[\displaystyle - 0.894427190999916 Ah {\left\langle x \right\rangle}^{0} - 0.447213595499958 Av {\left\langle x \right\rangle}^{0} + Cn + 0.447213595499958 MA {\left\langle x \right\rangle}^{-1} + 13.4164078649987 {\left\langle x - 4 \right\rangle}^{0}\]
'u:'
\[\displaystyle - 0.894427190999916 Ah {\left\langle x \right\rangle}^{1} - 0.447213595499958 Av {\left\langle x \right\rangle}^{1} + Cn x + Cu + 0.447213595499958 MA {\left\langle x \right\rangle}^{0} + 13.4164078649987 {\left\langle x - 4 \right\rangle}^{1}\]
## Voorwarden

eq1 = V.subs(x, -1)
eq2 = V.subs(x, l+0.1) 

eq3 = M.subs(x, -1)
eq4 = M.subs(x, l)

eq5 = phi.subs(x, 0)
eq6 = W.subs(x, 0)

eq7 = N.subs(x, -1)
eq8 = N.subs(x, l+0.1)
eq9 = u.subs(x, 0)
equations = [eq1 -0, eq2-0,eq3-0,eq4-0,eq5-0,eq6-0, eq7-0, eq8 -0, eq9 -0]
solutions = sp.solve(equations, (Cv, Cm, Cphi, Cw, Av, MA, Ah, Cn, Cu))
print(solutions)
{Cv: 0.0, Cm: 0.0, Cphi: 0.0, Cw: 0.0, Av: 9.99999999999998, MA: 20.0000000000000, Ah: 9.99999999999996, Cn: 0.0, Cu: -8.94427190999916}

V-lijn

x_val = np.linspace(0, 4.47213595499958, 901)
V_numpy = sp.lambdify(x,V.subs(solutions).rewrite(sp.Piecewise).simplify()) #substitute full solution, make python function of formula
V_list = V_numpy(x_val)
#print(V_list)
fig = plt.figure(figsize=(10, 5))
ax = fig.add_subplot(1, 1, 1)
ax.set_xlim(0, 4.48)
ax.set_ylim(0, 6)

ax.spines["left"].set_position("zero")
ax.spines["right"].set_visible(False)
ax.spines["bottom"].set_position("zero")
ax.spines["top"].set_visible(False)


ax.set_xlabel("$V-lijn$")
ax.xaxis.set_label_coords(0.53, 1.04)
plt.text(2, 2.4, f'{V_list[100]:.2f}', fontsize=25, color='red')
plt.gca()
ax.plot(x_val/sp.cos(theta), np.array(V_list) , label='V-lijn')
plt.savefig('V_lijnvoorbeeld2', dpi=450);
../../_images/45530aacec594037f96753d822f45f3b4a1716074c3c394ebde13166b6866041.png
x_val = np.linspace(0, l, 901)
M_numpy = sp.lambdify(x,M.subs(solutions).rewrite(sp.Piecewise).simplify()) #substitute full solution, make python function of formula
M_list = M_numpy(x_val)
fig = plt.figure(figsize=(10, 5))
ax = fig.add_subplot(1, 1, 1)
ax.set_xlim(0, 4.48)
ax.set_ylim(-5, 20)

ax.spines["left"].set_position("zero")
ax.spines["right"].set_visible(False)
ax.spines["bottom"].set_position("zero")
ax.spines["top"].set_visible(False)


ax.set_xlabel("$M-lijn$")
ax.xaxis.set_label_coords(0.53, 1.04)
plt.gca()
ax.plot(x_val/sp.cos(theta), - np.array(M_list) , label='M-lijn');
plt.savefig('M_lijnvoorbeeld2', dpi=450);
../../_images/147b326f25d3b259b4c2a260ecb96949224a41edce8655fa4de593db90bf7ea4.png
x_val = np.linspace(0, l, 901)
phi_numpy = sp.lambdify(x,phi.subs(solutions).rewrite(sp.Piecewise).simplify()) #substitute full solution, make python function of formula
phi_list = phi_numpy(x_val)
fig = plt.figure(figsize=(10, 5))
ax = fig.add_subplot(1, 1, 1)
ax.set_xlim(0, 4.48)
ax.set_ylim(-40, 5)

ax.spines["left"].set_position("zero")
ax.spines["right"].set_visible(False)
ax.spines["bottom"].set_position("zero")
ax.spines["top"].set_visible(False)


ax.set_xlabel("$EI*phi-lijn$")
ax.xaxis.set_label_coords(0.53, 1.04)
plt.gca()
ax.plot(x_val/sp.cos(theta), np.array(phi_list) , label='phi-lijn')
plt.savefig('phi_lijnvoorbeeld2', dpi=450);
../../_images/5f4ed1b33f8a6264f2706dd2698f74b7d99f557baa684a272c04378163c78b9d.png

w-lijn

x_val = np.linspace(0, l, 901)
W_numpy = sp.lambdify(x,W.subs(solutions).rewrite(sp.Piecewise).simplify()) #substitute full solution, make python function of formula
W_list = W_numpy(x_val)
fig = plt.figure(figsize=(10, 5))
ax = fig.add_subplot(1, 1, 1)
ax.set_xlim(0, 4.48)
ax.set_ylim(-120, 2)

ax.spines["left"].set_position("zero")
ax.spines["right"].set_visible(False)
ax.spines["bottom"].set_position("zero")
ax.spines["top"].set_visible(False)


ax.set_xlabel("$EI*w-lijn$")
ax.xaxis.set_label_coords(0.53, 1.04)
plt.gca()
ax.plot(x_val/sp.cos(theta), - np.array(W_list) , label='w-lijn')
plt.savefig('w_lijnvoorbeeld2', dpi=450);
../../_images/fdf195433ad198955c557940fee702598d1557856921845765a5c21061a29d91.png

N-lijn

x_val = np.linspace(0, 4.47213595499958, 901)
N_numpy = sp.lambdify(x,N.subs(solutions).rewrite(sp.Piecewise).simplify()) #substitute full solution, make python function of formula
N_list = N_numpy(x_val)
fig = plt.figure(figsize=(10, 5))
ax = fig.add_subplot(1, 1, 1)
ax.set_xlim(0, 4.48)
ax.set_ylim(-15, 0)

ax.spines["left"].set_position("zero")
ax.spines["right"].set_visible(False)
ax.spines["bottom"].set_position("zero")
ax.spines["top"].set_visible(False)

ax.set_xlabel("$N-lijn$")
ax.xaxis.set_label_coords(0.53, 1.04)
plt.text(1.8, -6.3, f'{N_list[100]:.2f}', fontsize=25, color='red')
plt.gca()
ax.plot(x_val/sp.cos(theta),  np.array(N_list) , label='N-lijn')
plt.savefig('N_lijnvoorbeeld2', dpi=450);
../../_images/d44d0c2d1b10a6ba4ef4884b894d5f59b47daa481cfb935d667995d0d430251b.png
x_val = np.linspace(0, l, 901)
u_numpy = sp.lambdify(x,u.subs(solutions).rewrite(sp.Piecewise).simplify()) #substitute full solution, make python function of formula
u_list = u_numpy(x_val)
fig = plt.figure(figsize=(10, 5))
ax = fig.add_subplot(1, 1, 1)
ax.set_xlim(0, 5)
ax.set_ylim(-60, 4.48)

ax.spines["left"].set_position("zero")
ax.spines["right"].set_visible(False)
ax.spines["bottom"].set_position("zero")
ax.spines["top"].set_visible(False)


ax.set_xlabel("$EA*u-lijn$")
ax.xaxis.set_label_coords(0.53, 1.04)
plt.gca()
ax.plot(x_val/sp.cos(theta),  np.array(u_list) , label='u-lijn')
plt.savefig('u_lijnvoorbeeld2', dpi=450);
../../_images/95315df3b490b72c204c1cdba3fe77754bf61bb0bffd6cf4ba38437088b3dbf9.png

Voorbeeld 3#

Cv, Cm, Cphi, Cw, Av, Bv, Ah, Cn, MA = sp.symbols('Cv, Cm, Cphi, Cw, Av, Bv, Ah, Cn, MA')

# F, l en theta definiëren 
F = 10  ## KN
l = 4   ## m
T = 10
theta = sp.atan(1/2) 

# qz en qx definiëren
qz = -Av * sf(x, 0, -1) + MA*sf(x, 0, -2) - Bv * sf(x, l, -1) + T *sf(x, l/4, -2)
qx = Ah * sf(x, 0, -1) -F*sf(x, l/2, -1) 
# V definiëren als een functie van x
V = sp.integrate(-qx * sp.sin(theta), x) + sp.integrate(-qz * sp.cos(theta), x) + Cv
# N definiëren als een functie van x
N = sp.integrate(-qx * sp.cos(theta), x) + sp.integrate(qz * sp.sin(theta), x) + Cn
# N definiëren als een functie van x
M = sp.integrate(V/sp.cos(theta), x) + Cm

# phi definiëren als een functie van x
phi = sp.integrate(M, x) + Cphi

# W definiëren als een functie van x
W = sp.integrate(-phi, x) + Cw
# u definiëren als een functie van x
u = sp.integrate(N, x) + Cu
display("V:", V)
display("M:", M)
display("phi:", phi)
display("W:", W)
display("N:", N)
display("u:", u)
'V:'
\[\displaystyle - 0.447213595499958 Ah {\left\langle x \right\rangle}^{0} + 0.894427190999916 Av {\left\langle x \right\rangle}^{0} + 0.894427190999916 Bv {\left\langle x - 4 \right\rangle}^{0} + Cv - 0.894427190999916 MA {\left\langle x \right\rangle}^{-1} - 8.94427190999916 {\left\langle x - 1.0 \right\rangle}^{-1} + 4.47213595499958 {\left\langle x - 2.0 \right\rangle}^{0}\]
'M:'
\[\displaystyle - 0.5 Ah {\left\langle x \right\rangle}^{1} + 1.0 Av {\left\langle x \right\rangle}^{1} + 1.0 Bv {\left\langle x - 4 \right\rangle}^{1} + Cm + 1.11803398874989 Cv x - 1.0 MA {\left\langle x \right\rangle}^{0} - 10.0 {\left\langle x - 1.0 \right\rangle}^{0} + 5.0 {\left\langle x - 2.0 \right\rangle}^{1}\]
'phi:'
\[\displaystyle - 0.25 Ah {\left\langle x \right\rangle}^{2} + 0.5 Av {\left\langle x \right\rangle}^{2} + 0.5 Bv {\left\langle x - 4 \right\rangle}^{2} + Cm x + Cphi + 0.559016994374947 Cv x^{2} - 1.0 MA {\left\langle x \right\rangle}^{1} - 10.0 {\left\langle x - 1.0 \right\rangle}^{1} + 2.5 {\left\langle x - 2.0 \right\rangle}^{2}\]
'W:'
\[\displaystyle 0.0833333333333333 Ah {\left\langle x \right\rangle}^{3} - 0.166666666666667 Av {\left\langle x \right\rangle}^{3} - 0.166666666666667 Bv {\left\langle x - 4 \right\rangle}^{3} - \frac{Cm x^{2}}{2} - Cphi x - 0.186338998124982 Cv x^{3} + Cw + 0.5 MA {\left\langle x \right\rangle}^{2} + 5.0 {\left\langle x - 1.0 \right\rangle}^{2} - 0.833333333333333 {\left\langle x - 2.0 \right\rangle}^{3}\]
'N:'
\[\displaystyle - 0.894427190999916 Ah {\left\langle x \right\rangle}^{0} - 0.447213595499958 Av {\left\langle x \right\rangle}^{0} - 0.447213595499958 Bv {\left\langle x - 4 \right\rangle}^{0} + Cn + 0.447213595499958 MA {\left\langle x \right\rangle}^{-1} + 4.47213595499958 {\left\langle x - 1.0 \right\rangle}^{-1} + 8.94427190999916 {\left\langle x - 2.0 \right\rangle}^{0}\]
'u:'
\[\displaystyle - 0.894427190999916 Ah {\left\langle x \right\rangle}^{1} - 0.447213595499958 Av {\left\langle x \right\rangle}^{1} - 0.447213595499958 Bv {\left\langle x - 4 \right\rangle}^{1} + Cn x + Cu + 0.447213595499958 MA {\left\langle x \right\rangle}^{0} + 4.47213595499958 {\left\langle x - 1.0 \right\rangle}^{0} + 8.94427190999916 {\left\langle x - 2.0 \right\rangle}^{1}\]
eq1 = V.subs(x, -1)
eq2 = V.subs(x, l+1) 

eq3 = M.subs(x, -1)
eq4 = M.subs(x, l)

eq5 = W.subs(x, 0)
eq6 = phi.subs(x, 0)

eq7 = N.subs(x, -1)
eq8 = W.subs(x, l)
eq9 = N.subs(x, l+1)

eq10 = u.subs(x, 0)
equations = [eq1 - 0, eq2 - 0 , eq3 - 0, eq4 - 0, eq5 - 0, eq6 - 0, eq7 - 0, eq8 -0, eq9 - 0, eq10]
solutions = sp.solve(equations, (Cv, Cm, Cphi, Cw, Av, MA, Cn, Ah, Bv, Cu))
print(solutions)
{Cv: 0.0, Cm: 0.0, Cphi: 0.0, Cw: 0.0, Av: 3.20312500000000, MA: -7.18750000000000, Cn: 0.0, Ah: 10.0000000000000, Bv: -3.20312500000000, Cu: 3.21434771765595}
x_val = np.linspace(0, 4.4721359549995, 901)
V_numpy = sp.lambdify(x,V.subs(solutions).rewrite(sp.Piecewise).simplify()) #substitute full solution, make python function of formula
V_list = V_numpy(x_val)
fig = plt.figure(figsize=(10, 5))
ax = fig.add_subplot(1, 1, 1)
ax.set_xlim(0, 4.48)
ax.set_ylim(-3, 6)

ax.spines["left"].set_position("zero")
ax.spines["right"].set_visible(False)
ax.spines["bottom"].set_position("zero")
ax.spines["top"].set_visible(False)


ax.set_xlabel("$V-lijn$")
ax.xaxis.set_label_coords(0.53, 1.04)
plt.gca()
ax.plot(x_val/sp.cos(theta), np.array(V_list) , label='V-lijn')
plt.savefig('V_lijnvoorbeeld3', dpi=450);
../../_images/4c5edd3b93450ff49f3c95f8c270358fcbb2e1864365d34696cf62b4f668673f.png
x_val = np.linspace(0, l, 901)
M_numpy = sp.lambdify(x,M.subs(solutions).rewrite(sp.Piecewise).simplify()) 
M_list = M_numpy(x_val)
fig = plt.figure(figsize=(10, 5))
ax = fig.add_subplot(1, 1, 1)
ax.set_xlim(0, 4.48)
ax.set_ylim(-8, 8)

ax.spines["left"].set_position("zero")
ax.spines["right"].set_visible(False)
ax.spines["bottom"].set_position("zero")
ax.spines["top"].set_visible(False)


ax.set_xlabel("$M-lijn$")
ax.xaxis.set_label_coords(0.53, 1.04)
plt.gca()
ax.plot(x_val/sp.cos(theta),  -np.array(M_list) , label='M-lijn');
plt.savefig('M_lijnvoorbeeld3', dpi=450);
../../_images/7c091fd3b6217d622a99d4e37e42ed0226dbc2e7d187129c6d9a8ac29e1a682f.png
x_val = np.linspace(0, l, 901)
phi_numpy = sp.lambdify(x,phi.subs(solutions).rewrite(sp.Piecewise).simplify()) #substitute full solution, make python function of formula
phi_list = phi_numpy(x_val)
fig = plt.figure(figsize=(10, 5))
ax = fig.add_subplot(1, 1, 1)
ax.set_xlim(0, 4.48)
ax.set_ylim(-10, 15)

ax.spines["left"].set_position("zero")
ax.spines["right"].set_visible(False)
ax.spines["bottom"].set_position("zero")
ax.spines["top"].set_visible(False)


ax.set_xlabel("$phi*EI-lijn$")
ax.xaxis.set_label_coords(0.53, 1.04)
plt.gca()
ax.plot(x_val/sp.cos(theta), np.array(phi_list) , label='phi-lijn')
plt.savefig('phi_lijnvoorbeeld3', dpi=450);
../../_images/8039a943fe2437a2fcaed18633b9499c363440603714be4c9a4329da8204bb30.png
x_val = np.linspace(0, l, 901)
W_numpy = sp.lambdify(x,W.subs(solutions).rewrite(sp.Piecewise).simplify()) #substitute full solution, make python function of formula
W_list = W_numpy(x_val)
fig = plt.figure(figsize=(10, 5))
ax = fig.add_subplot(1, 1, 1)
ax.set_xlim(0, 4.48)
ax.set_ylim(2, -10)

ax.spines["left"].set_position("zero")
ax.spines["right"].set_visible(False)
ax.spines["bottom"].set_position("zero")
ax.spines["top"].set_visible(False)


ax.set_xlabel("$EI * w-lijn$")
ax.xaxis.set_label_coords(0.53, 1.04)
plt.gca()
ax.plot(x_val/sp.cos(theta),  np.array(W_list) , label='w-lijn')
plt.savefig('w_lijnvoorbeeld3', dpi=450);
../../_images/4dbbf8bd793dc5bfb3e315729eb193c571cc11b6c1efe493285b0d41f36615b9.png
x_val = np.linspace(0, 4.47213595499958, 901)
N_numpy = sp.lambdify(x,N.subs(solutions).rewrite(sp.Piecewise).simplify()) #substitute full solution, make python function of formula
N_list = N_numpy(x_val)
fig = plt.figure(figsize=(10, 5))
ax = fig.add_subplot(1, 1, 1)
ax.set_xlim(0, 4.48)
ax.set_ylim(-12, 0)

ax.spines["left"].set_position("zero")
ax.spines["right"].set_visible(False)
ax.spines["bottom"].set_position("zero")
ax.spines["top"].set_visible(False)

ax.set_xlabel("$N-lijn$")
ax.xaxis.set_label_coords(0.53, 1.04)
plt.gca()
ax.plot(x_val/sp.cos(theta),  np.array(N_list) , label='N-lijn')
plt.savefig('N_lijnvoorbeeld3', dpi=450);
../../_images/ccc13020fde5c2a2572424f6402f4fffdeaa6266d65c0da982d54786192a2194.png
x_val = np.linspace(0, l, 301)
u_numpy = sp.lambdify(x,u.subs(solutions).rewrite(sp.Piecewise).simplify()) #substitute full solution, make python function of formula
u_list = u_numpy(x_val)
fig = plt.figure(figsize=(10, 5))
ax = fig.add_subplot(1, 1, 1)
ax.set_xlim(0, 4.48)
ax.set_ylim(0, -25)

ax.spines["left"].set_position("zero")
ax.spines["right"].set_visible(False)
ax.spines["bottom"].set_position("zero")
ax.spines["top"].set_visible(False)

ax.set_xlabel("$EA*u-lijn$")
ax.xaxis.set_label_coords(0.53, 1.04)
plt.gca()
ax.plot(x_val/sp.cos(theta),  np.array(u_list) , label='N-lijn')
plt.savefig('u_lijnvoorbeeld3', dpi=450);
../../_images/1e0e05f557df0f30317d818d8658c1851183204d4f89236118d2817f94fec16c.png