BEP voorbeelden

BEP voorbeelden#

import sympy as sp
import numpy as np
from sympy import symbols
E, I = symbols('E, I')
x = symbols('x')
sf = sp.SingularityFunction
import matplotlib.pyplot as plt
#Voorbeeld 1
w = -1/12*sf(x, 0, 3) + 1/6*sf(x, 5, 3) - 1/12*sf(x, 10, 3) + 25/4*x
phi = sp.diff(w)*-1
M = sp.diff(phi)
V = sp.diff(M)
sp.plot(w, ylim=(30,0), xlim=(0, 10), size=(10,5))
sp.plot(phi, ylim=(10,-10), xlim=(0, 10), size=(10,5))
sp.plot(M, ylim=(5,-1), xlim=(0, 10), size=(10,5))
sp.plot(V, ylim=(1,-1), xlim=(0, 10), size=(10,5))
../../_images/22529bd6e5979613b41ffc468f1c609710c4537fbc497329b7e7e4b2b0fabb74.png ../../_images/7193082880ffa9251fdf87c61213d574d8d0d3355905e12b125312688431b3e1.png ../../_images/7b3edaff8b520fa05145e2fb7d2b3188f4edaf05e02bed5181e808e7a40a02f1.png ../../_images/121698e0c214ad8df6afb3dcf6d1b500150735797224103f7567027f68ca4283.png
<sympy.plotting.plot.Plot at 0x1f3c1113460>
#Voorbeeld 2
w = 99/20*sf(x, 0, 2) - 399/600*sf(x, 0, 3) + 1/24*sf(x, 2, 4) - 1/24*sf(x, 8, 4) - 201/600*sf(x, 10, 3)
phi = sp.diff(w)*-1
M = sp.diff(phi)
V = sp.diff(M)
sp.plot(w, ylim=(50,0), xlim=(0, 10), size=(10,5))
sp.plot(phi, ylim=(20,-20), xlim=(0, 10), size=(10,5))
sp.plot(M, ylim=(7,-12), xlim=(0, 10), size=(10,5))
sp.plot(V, ylim=(5,-3), xlim=(0, 10), size=(10,5))
../../_images/1147d07aa9762d79ee8ced7bb0f5354ba21263bf7e731abe523b6300115990d7.png ../../_images/3f93a3bc93456cb09a2b85edb671a63ee6022ca00127cb9ff451599fd0b7172f.png ../../_images/344228932c93f413b8304b791862cb15db088a305c639d902044efeb87f05e6e.png ../../_images/6d3715d813d5dbe042e9a4287c8d29c7221daaa354e13b11459d8f6dd280f8c9.png
<sympy.plotting.plot.Plot at 0x1f3c0ef02b0>
#Voorbeeld 3
w = 20/12*sf(x, 0, 2) - 5/36*sf(x, 0, 3) - 875/108*sf(x, 4, 1) + 1/6*sf(x, 5, 3) - 1/36*sf(x, 10, 3)
phi = sp.diff(w)*-1
M = sp.diff(phi)
V = sp.diff(M)
sp.plot(w, ylim=(30,0), xlim=(0, 10), size=(10,5))
sp.plot(phi, ylim=(10,-10), xlim=(0, 10), size=(10,5))
sp.plot(M, ylim=(2,-4), xlim=(0, 10), size=(10,5))
sp.plot(V, ylim=(1,-1), xlim=(0, 10), size=(10,5))
../../_images/1cfd5f0237c2c0ab2c76d6c89594c1f76d4b49824a35f58b899850038e73ac2a.png ../../_images/eaa27c6bca1fcaa9cee58bfefbdfa12bea7af8949dbd3fc9a59dffe4070cfce6.png ../../_images/97016e9742f9949b8b892c3a19e223d3ae8c982dec799269d54af7307267fc88.png ../../_images/da74b47592935f1ec7fb2c15d0efda5f83100ef7cd5c970be7a71ecd5896712e.png
<sympy.plotting.plot.Plot at 0x1f3c0e861c0>
#Voorbeeld 4
w = -89/1086*sf(x, 0, 3) + 1/6*sf(x, 2, 3) - 6/181*sf(x, 4, 1) - 558/362*sf(x, 6, 2) - 92/1086*sf(x, 10, 3) + 398/181*x
phi = sp.diff(w)*-1
M = sp.diff(phi)
V = sp.diff(M)
sp.plot(w, ylim=(10,0), xlim=(0, 10), size=(10,5))
sp.plot(phi, ylim=(3,-3), xlim=(0, 10), size=(10,5))
sp.plot(M, ylim=(3,-3), xlim=(0, 10), size=(10,5))
sp.plot(V, ylim=(1,-1), xlim=(0, 10), size=(10,5))
../../_images/64d19738e0318c1884fcfb91ac1e2cdfcc20a1d84e4d7a9838e6b6b56f7c594d.png ../../_images/56ada3407b9e91b52eeaf50f24b5027eac494eaaef87f2691840179186a47574.png ../../_images/0aa0ab968cbf2839a4764a83027ec62de51c9c9941851e93abde888ee18b190b.png ../../_images/30187411a925961373a5bbb6edcd6c898a0717e047260e491f7baf14cad04af1.png
<sympy.plotting.plot.Plot at 0x1f3c216d460>
#Voorbeeld 5
u = -1/2*sf(x, 0, 1) + 1*sf(x, 5, 1) - 1/2*sf(x, 10, 1)
N = sp.diff(u)
sp.plot(u, ylim=(0, -3), xlim=(0, 10), size=(10,5))
sp.plot(N, ylim=(1,-1), xlim=(0, 10), size=(10,5))
../../_images/feb982a5d4715b9b862da8d37ea0b0b586fb06436ed605306feab78e4fbc4ac5.png ../../_images/949f28b930385196268e2b546b7d0a6140fe41fa57f432544f485b42d895d36e.png
<sympy.plotting.plot.Plot at 0x1f3c1079130>
#Voorbeeld 6
u = -5/9*sf(x, 0, 1) + 5/9*sf(x, 3, 0) + 1*sf(x, 5, 1) - 4/9*sf(x, 10, 1)
N = sp.diff(u)
sp.plot(u, ylim=(0, -3), xlim=(0, 10), size=(10,5))
sp.plot(N, ylim=(1,-1), xlim=(0, 10), size=(10,5))
../../_images/fc42bdcbd01ffa0c3bafbe92ce0182c424cb4948b4b5e52a03073f35314af8fe.png ../../_images/01475fc03680cacd0a541140ef8e9ca5086b570bb48b29c9eea9d570c47dd1ae.png
<sympy.plotting.plot.Plot at 0x1f3c10c91c0>
#Voorbeeld 7
x = symbols('x')
w = 63/2*sf(x, 0, 2) - 4/6*sf(x, 0, 3) + 3/6*sf(x, 10, 3) - 7420/3*sf(x, 10, 0) + 1/6*sf(x, 13, 3) - 4/6*sf(x, 15, 3) + 226/3*sf(x, 15, 0) + 2/3*sf(x, 20, 3)
wV = 63/2*sf(x, 0, 2) - 4/6*sf(x, 0, 3) + 3/6*sf(x, 10, 3) + 1/6*sf(x, 13, 3) - 4/6*sf(x, 15, 3) + 2/3*sf(x, 20, 3)
phi = sp.diff(w)*-1
M = sp.diff(phi)
V = sp.diff(wV, x, 3)

w_numpy = sp.lambdify(x, w.rewrite(sp.Piecewise))
phi_numpy = sp.lambdify(x, phi.rewrite(sp.Piecewise)) 
M_numpy = sp.lambdify(x, M.rewrite(sp.Piecewise))
V_numpy = sp.lambdify(x, V.rewrite(sp.Piecewise))

u = 1*sf(x, 0, 1) - 5*sf(x, 10, 1) - 7480/3*sf(x, 10, 0) + 4*sf(x, 15, 1) + 14794/3*sf(x, 15, 0)
N = sp.diff(u)

u_numpy = sp.lambdify(x, u.rewrite(sp.Piecewise))
N_numpy = sp.lambdify(x, N.rewrite(sp.Piecewise))
fig, ax = plt.subplots(figsize=(10,5))
ax.plot(np.linspace(0, 20, 1000), w_numpy(np.linspace(0, 20, 1000)))
plt.xlim([0, 20])
plt.ylim([6000, 0])
ax.spines['left'].set_position('zero')
ax.spines['right'].set_color('none')
ax.yaxis.tick_left()
ax.spines['bottom'].set_position('zero')
ax.spines['top'].set_color('none')
ax.xaxis.tick_bottom()
plt.title('w-lijn')

fig, ax = plt.subplots(figsize=(10,5))
ax.plot(np.linspace(0, 20, 1000), phi_numpy(np.linspace(0, 20, 1000)))
plt.xlim([0, 20])
plt.ylim([0, -750])
ax.spines['left'].set_position('zero')
ax.spines['right'].set_color('none')
ax.yaxis.tick_left()
ax.spines['bottom'].set_position('zero')
ax.spines['top'].set_color('none')
ax.xaxis.tick_bottom()
plt.title('phi-lijn')

fig, ax = plt.subplots(figsize=(10,5))
ax.plot(np.linspace(0, 20, 1000), M_numpy(np.linspace(0, 20, 1000)))
plt.xlim([0, 20])
plt.ylim([0, -80])
ax.spines['left'].set_position('zero')
ax.spines['right'].set_color('none')
ax.yaxis.tick_left()
ax.spines['bottom'].set_position('zero')
ax.spines['top'].set_color('none')
ax.xaxis.tick_bottom()
plt.title('M-lijn')

fig, ax = plt.subplots(figsize=(10,5))
ax.plot(np.linspace(0, 20, 1000), V_numpy(np.linspace(0, 20, 1000)))
plt.xlim([0, 20])
plt.ylim([1, -5])
ax.spines['left'].set_position('zero')
ax.spines['right'].set_color('none')
ax.yaxis.tick_left()
ax.spines['bottom'].set_position('zero')
ax.spines['top'].set_color('none')
ax.xaxis.tick_bottom()
plt.title('V-lijn')

fig, ax = plt.subplots(figsize=(10,5))
ax.plot(np.linspace(0, 20, 1000), u_numpy(np.linspace(0, 20, 1000)))
plt.xlim([0, 20])
plt.ylim([4000, -4000])
ax.spines['left'].set_position('zero')
ax.spines['right'].set_color('none')
ax.yaxis.tick_left()
ax.spines['bottom'].set_position('zero')
ax.spines['top'].set_color('none')
ax.xaxis.tick_bottom()
plt.title('u-lijn')

fig, ax = plt.subplots(figsize=(10,5))
ax.plot(np.linspace(0, 20, 1000), N_numpy(np.linspace(0, 20, 1000)))
plt.xlim([0, 20])
plt.ylim([2, -6])
ax.spines['left'].set_position('zero')
ax.spines['right'].set_color('none')
ax.yaxis.tick_left()
ax.spines['bottom'].set_position('zero')
ax.spines['top'].set_color('none')
ax.xaxis.tick_bottom()
plt.title('N-lijn')
Text(0.5, 1.0, 'N-lijn')
../../_images/1944c174a60e424661173aee88f6b1a41183ef59c0a2834a2660255e03ec828b.png ../../_images/1226f94c15d6ed33f3751704387efde0f50cfa87e39822c363598ac16281cfb1.png ../../_images/b31d3449e722c42b93df64e08b928dcff9381755fc004b07da0743bbfc4951de.png ../../_images/0042099dd25a9beb5b72e9ce3b5002ea98176c7a7c32f29a8d3396faffa6059f.png ../../_images/0f95de46f35083cca453ee3868da7d6bb7ad47f4ebb945f32f15231dde2a598b.png ../../_images/246ddeed3af9cf0974b95f890cd47b5905a5f487e1e087950f2b7db908b58548.png
factor = sp.symbols('factor')
w = (63/2*sf(x, 0, 2) - 4/6*sf(x, 0, 3) + 3/6*sf(x, 10, 3) - 7420/3*sf(x, 10, 0) + 1/6*sf(x, 13, 3) - 4/6*sf(x, 15, 3) + 226/3*sf(x, 15, 0) + 2/3*sf(x, 20, 3))/(factor)
u = (1*sf(x, 0, 1) - 5*sf(x, 10, 1) - 7480/3*sf(x, 10, 0) + 4*sf(x, 15, 1) + 14794/3*sf(x, 15, 0))/(factor)

u_test = u.subs(factor, 1000)
w_test = w.subs(factor, 1000)

x_structure = ((sp.SingularityFunction(x,0,0) - sp.SingularityFunction(x,10,0)) * x
               + (sp.SingularityFunction(x,10,0) - sp.SingularityFunction(x,15,0)) * 10
                + (sp.SingularityFunction(x,15,0) - sp.SingularityFunction(x,20,0)) * (x-5)).expand().rewrite(sp.Piecewise)
z_structure = ((sp.SingularityFunction(x,0,0) - sp.SingularityFunction(x,10,0)) * 0
               + (sp.SingularityFunction(x,10,0) - sp.SingularityFunction(x,15,0)) * (-x+10)
                + (sp.SingularityFunction(x,15,0) - sp.SingularityFunction(x,20,0)) * (-5)).expand().rewrite(sp.Piecewise)
x_structure_numpy = sp.lambdify(x,x_structure)
z_structure_numpy = sp.lambdify(x,z_structure)
display(w_test.subs({x:20}))
display(u_test.subs({x:20}))
\[\displaystyle 5.3425\]
\[\displaystyle 2.428\]
x_res = ((sp.SingularityFunction(x,0,0) - sp.SingularityFunction(x,10,0)) * u_test
               + (sp.SingularityFunction(x,10,0) - sp.SingularityFunction(x,15,0)) * w_test
                + (sp.SingularityFunction(x,15,0) - sp.SingularityFunction(x,20,0)) * u_test).expand().rewrite(sp.Piecewise)
z_res = ((sp.SingularityFunction(x,0,0) - sp.SingularityFunction(x,10,0)) * w_test
               + (sp.SingularityFunction(x,10,0) - sp.SingularityFunction(x,15,0)) * -u_test
                + (sp.SingularityFunction(x,15,0) - sp.SingularityFunction(x,20,0)) * w_test).expand().rewrite(sp.Piecewise)
x_res_numpy = sp.lambdify(x,x_res)
z_res_numpy = sp.lambdify(x,z_res)
plt.figure(figsize=(10, 5))
plt.plot(x_structure_numpy(np.linspace(0,20,101)),z_structure_numpy(np.linspace(0,20,101)), label='Original structure')
plt.plot(x_res_numpy(np.linspace(0,20,2010))+x_structure_numpy(np.linspace(0,20,2010)),z_res_numpy(np.linspace(0,20,2010))+z_structure_numpy(np.linspace(0,20,2010)), label='Displaced structure')
plt.gca().invert_yaxis()
plt.gca().set_aspect('equal')
plt.axis('off')
plt.legend();
../../_images/2c5f6069005c8f625054d0c29652e80f2407971c131bc1d671b1c06d27b97ba4.png
#Voorbeeld 8
x = symbols('x')
w = -2/15*sf(x, 0, 3) + 1/3*sf(x, 3, 3) - 1/5*sf(x, 5, 3) - 119/2*sf(x, 5, 0) - 76/5*sf(x, 10, 1) + 3/6*sf(x, 13, 3) - 7/10*sf(x, 15, 3) - 125/2*sf(x, 15, 0) + 1/5*sf(x, 20, 3) + 147/10*x
wV = -2/15*sf(x, 0, 3) + 1/3*sf(x, 3, 3) - 1/5*sf(x, 5, 3) - 76/5*sf(x, 10, 1) + 3/6*sf(x, 13, 3) - 7/10*sf(x, 15, 3) + 1/5*sf(x, 20, 3) + 147/10*x
phi = sp.diff(w)*-1
M = sp.diff(phi)
V = sp.diff(wV, x, 3)

w_numpy = sp.lambdify(x, w.rewrite(sp.Piecewise))
phi_numpy = sp.lambdify(x, phi.rewrite(sp.Piecewise)) 
M_numpy = sp.lambdify(x, M.rewrite(sp.Piecewise))
V_numpy = sp.lambdify(x, V.rewrite(sp.Piecewise))

u = -6/5*sf(x, 5, 1) + 119/2*sf(x, 5, 0) - 9/5*sf(x, 15, 1) - 65/2*sf(x, 15, 0) + 3*sf(x, 20, 1)
N = sp.diff(u)

u_numpy = sp.lambdify(x, u.rewrite(sp.Piecewise))
N_numpy = sp.lambdify(x, N.rewrite(sp.Piecewise))
fig, ax = plt.subplots(figsize=(10,5))
ax.plot(np.linspace(0, 20, 1000), w_numpy(np.linspace(0, 20, 1000)))
plt.xlim([0, 20])
plt.ylim([60, -60])
ax.spines['left'].set_position('zero')
ax.spines['right'].set_color('none')
ax.yaxis.tick_left()
ax.spines['bottom'].set_position('zero')
ax.spines['top'].set_color('none')
ax.xaxis.tick_bottom()
plt.title('w-lijn')

fig, ax = plt.subplots(figsize=(10,5))
ax.plot(np.linspace(0, 20, 1000), phi_numpy(np.linspace(0, 20, 1000)))
plt.xlim([0, 20])
plt.ylim([20, -20])
ax.spines['left'].set_position('zero')
ax.spines['right'].set_color('none')
ax.yaxis.tick_left()
ax.spines['bottom'].set_position('zero')
ax.spines['top'].set_color('none')
ax.xaxis.tick_bottom()
plt.title('phi-lijn')

fig, ax = plt.subplots(figsize=(10,5))
ax.plot(np.linspace(0, 20, 1000), M_numpy(np.linspace(0, 20, 1000)))
plt.xlim([0, 20])
plt.ylim([4, -8])
ax.spines['left'].set_position('zero')
ax.spines['right'].set_color('none')
ax.yaxis.tick_left()
ax.spines['bottom'].set_position('zero')
ax.spines['top'].set_color('none')
ax.xaxis.tick_bottom()
plt.title('M-lijn')

fig, ax = plt.subplots(figsize=(10,5))
ax.plot(np.linspace(0, 20, 1000), V_numpy(np.linspace(0, 20, 1000)))
plt.xlim([0, 20])
plt.ylim([4, -2])
ax.spines['left'].set_position('zero')
ax.spines['right'].set_color('none')
ax.yaxis.tick_left()
ax.spines['bottom'].set_position('zero')
ax.spines['top'].set_color('none')
ax.xaxis.tick_bottom()
plt.title('V-lijn')

fig, ax = plt.subplots(figsize=(10,5))
ax.plot(np.linspace(0, 20, 1000), u_numpy(np.linspace(0, 20, 1000)))
plt.xlim([0, 20])
plt.ylim([100, -100])
ax.spines['left'].set_position('zero')
ax.spines['right'].set_color('none')
ax.yaxis.tick_left()
ax.spines['bottom'].set_position('zero')
ax.spines['top'].set_color('none')
ax.xaxis.tick_bottom()
plt.title('u-lijn')

fig, ax = plt.subplots(figsize=(10,5))
ax.plot(np.linspace(0, 20, 1000), N_numpy(np.linspace(0, 20, 1000)))
plt.xlim([0, 20])
plt.ylim([2, -6])
ax.spines['left'].set_position('zero')
ax.spines['right'].set_color('none')
ax.yaxis.tick_left()
ax.spines['bottom'].set_position('zero')
ax.spines['top'].set_color('none')
ax.xaxis.tick_bottom()
plt.title('N-lijn')
Text(0.5, 1.0, 'N-lijn')
../../_images/8fdbde5f80a287f5ae360810709c5aef77fa43f99da063af0166b0d4ee53eb5a.png ../../_images/6d84aafaf25877ea5006c8c77a31cf7eb2b6bffd668d1208dd316b3345288679.png ../../_images/083709945d5b38d6631cd94743907526d61bf4d9084b841eb5ff33417e4237dc.png ../../_images/8ec6fef404238e6865e5a5ed6c2862695d8d8a165a951eecc610cc8e87224622.png ../../_images/9a0d4cec4b3796f52a8cfaa6094f5888874a8f2590bc460b1a366bb828276502.png ../../_images/31670aa05eca79e670c465bd4b513712e67842e0d7d52891f2e5869288eb5afa.png
factor = sp.symbols('factor')
w = (-2/15*sf(x, 0, 3) + 1/3*sf(x, 3, 3) - 1/5*sf(x, 5, 3) - 119/2*sf(x, 5, 0) - 76/5*sf(x, 10, 1) + 3/6*sf(x, 13, 3) - 7/10*sf(x, 15, 3) - 125/2*sf(x, 15, 0) + 1/5*sf(x, 20, 3) + 147/10*x)/(factor)
u = (-6/5*sf(x, 5, 1) + 119/2*sf(x, 5, 0) - 9/5*sf(x, 15, 1) - 65/2*sf(x, 15, 0) + 3*sf(x, 20, 1))/(factor)

u_test = u.subs(factor, 100)
w_test = w.subs(factor, 100)

x_structure = ((sp.SingularityFunction(x,0,0) - sp.SingularityFunction(x,5,0)) * 0
               + (sp.SingularityFunction(x,5,0) - sp.SingularityFunction(x,15,0)) * (x-5)
                + (sp.SingularityFunction(x,15,0) - sp.SingularityFunction(x,20,0)) * (10)).expand().rewrite(sp.Piecewise)
z_structure = ((sp.SingularityFunction(x,0,0) - sp.SingularityFunction(x,5,0)) * -x
               + (sp.SingularityFunction(x,5,0) - sp.SingularityFunction(x,15,0)) * -5
                + (sp.SingularityFunction(x,15,0) - sp.SingularityFunction(x,20,0)) * (x-20)).expand().rewrite(sp.Piecewise)
x_structure_numpy = sp.lambdify(x,x_structure)
z_structure_numpy = sp.lambdify(x,z_structure)
display(w_test.subs({x:20}))
display(u_test.subs({x:20}))
\[\displaystyle 0\]
\[\displaystyle 0\]
x_res = ((sp.SingularityFunction(x,0,0) - sp.SingularityFunction(x,5,0)) * w_test
               + (sp.SingularityFunction(x,5,0) - sp.SingularityFunction(x,15,0)) * u_test
                + (sp.SingularityFunction(x,15,0) - sp.SingularityFunction(x,20,0)) * -w_test).expand().rewrite(sp.Piecewise)
z_res = ((sp.SingularityFunction(x,0,0) - sp.SingularityFunction(x,5,0)) * -u_test
               + (sp.SingularityFunction(x,5,0) - sp.SingularityFunction(x,15,0)) * w_test
                + (sp.SingularityFunction(x,15,0) - sp.SingularityFunction(x,20,0)) * u_test).expand().rewrite(sp.Piecewise)
x_res_numpy = sp.lambdify(x,x_res)
z_res_numpy = sp.lambdify(x,z_res)
plt.figure(figsize=(10, 5))
plt.plot(x_structure_numpy(np.linspace(0,20,101)),z_structure_numpy(np.linspace(0,20,101)), label='Original structure')
plt.plot(x_res_numpy(np.linspace(0,20,2010))+x_structure_numpy(np.linspace(0,20,2010)),z_res_numpy(np.linspace(0,20,2010))+z_structure_numpy(np.linspace(0,20,2010)), label='Displaced structure')
plt.gca().invert_yaxis()
plt.gca().set_aspect('equal')
plt.axis('off')
plt.legend();
../../_images/f9c0c9d3c9a1f4f6e1df66da6d09a06c223efaab9d01c71d80b1929c32b690b7.png