Пример #1
0
from paraBEM.pan3d import src_3_0_vsaero, src_3_0_n0
from paraBEM.utils import check_path

pnt1 = paraBEM.PanelVector3(-0.5, -0.5, 0)
pnt2 = paraBEM.PanelVector3(0.5, -0.5, 0)
pnt3 = paraBEM.PanelVector3(0.5, 0.5, 0)
pnt4 = paraBEM.PanelVector3(-0.5, 0.5, 0)

source = paraBEM.Panel3([pnt1, pnt2, pnt3, pnt4])

x = np.linspace(0, 5, 500)
y = []
for xi in x:
    target = paraBEM.PanelVector3(xi, 0.0, 0.1)
    panel_infl = src_3_0_vsaero(target, source)
    point_infl = src_3_0_n0(target, source)
    y.append([panel_infl, point_infl, abs(panel_infl - point_infl)])

y = list(zip(*y))

plt.figure(figsize=(8, 3))
plt.gcf().subplots_adjust(bottom=0.15)
plt.plot(x, y[0], label=u"Exakte Lösung")
plt.plot(x, y[1], label=u"Näherungslösung")
plt.grid(True)
plt.legend()
plt.ylabel("Einfluss")
plt.xlabel("x")
plt.ylim(0., 0.6)

plt.savefig(check_path("results/3d/far_vs_near_source.png"))
Пример #2
0
from paraBEM.utils import check_path

pnt1 = paraBEM.PanelVector3(-0.5, -0.5, 0)
pnt2 = paraBEM.PanelVector3(0.5, -0.5, 0)
pnt3 = paraBEM.PanelVector3(0.5, 0.5, 0)
pnt4 = paraBEM.PanelVector3(-0.5, 0.5, 0)

source = paraBEM.Panel3([pnt1, pnt2, pnt3, pnt4])

x = np.arange(-4, 4, 0.01)
y = []
for xi in x:
    trg1 = paraBEM.Vector3(xi, 0, 0.0)
    trg2 = paraBEM.Vector3(xi, 0, 0.5)
    trg3 = paraBEM.Vector3(xi, 0, 1)
    val1 = src_3_0_n0(trg1, source)
    val2 = src_3_0_n0(trg2, source)
    val3 = src_3_0_n0(trg3, source)
    y.append([val1, val2, val3])

fig = plt.figure()
ax1 = fig.add_subplot(131)
fig.gca().set_ylim([-5, 1])
ax1.plot(x, y)

y = []
for xi in x:
    trg1 = paraBEM.Vector3(0, xi, 0.0)
    trg2 = paraBEM.Vector3(0, xi, 0.5)
    trg3 = paraBEM.Vector3(0, xi, 1)
    val1 = src_3_0_n0(trg1, source)
Пример #3
0
from paraBEM.pan3d import src_3_0_vsaero, src_3_0_n0
from paraBEM.utils import check_path

pnt1 = paraBEM.PanelVector3(-0.5, -0.5, 0)
pnt2 = paraBEM.PanelVector3(0.5, -0.5, 0)
pnt3 = paraBEM.PanelVector3(0.5, 0.5, 0)
pnt4 = paraBEM.PanelVector3(-0.5, 0.5, 0)

source = paraBEM.Panel3([pnt1, pnt2, pnt3, pnt4])

x = np.linspace(0, 5, 500)
y = []
for xi in x:
    target = paraBEM.PanelVector3(xi, 0.0, 0.1)
    panel_infl = src_3_0_vsaero(target, source)
    point_infl = src_3_0_n0(target, source)
    y.append([panel_infl, point_infl, abs(panel_infl - point_infl)])

y = list(zip(*y))

plt.figure(figsize=(8,3))
plt.gcf().subplots_adjust(bottom=0.15)
plt.plot(x, y[0], label=u"Exakte Lösung")
plt.plot(x, y[1], label=u"Näherungslösung")
plt.grid(True)
plt.legend()
plt.ylabel("Einfluss")
plt.xlabel("x")
plt.ylim(-0.1, 0.6)

plt.savefig(check_path("results/3d/far_vs_near_source.png"))