```python
# Header starts here.
from sympy.physics.units import *
from sympy import *

# Rounding:
import decimal
from decimal import Decimal as DX
def iso_round(obj, pv, rounding=decimal.ROUND_HALF_EVEN):
    import sympy
    """
    Rounding acc. to DIN EN ISO 80000-1:2013-08
    place value = Rundestellenwert
    """
    assert pv in set([
        # place value   #  round to:
        1,              #  1
        0.1,            #  1st digit after decimal
        0.01,           #  2nd
        0.001,          #  3rd
        0.0001,         #  4th
        0.00001,        #  5th
        0.000001,       #  6th
        0.0000001,      #  7th
        0.00000001,     #  8th
        0.000000001,    #  9th
        0.0000000001,   # 10th
        ])
    try:
        tmp = DX(str(float(obj)))
        obj = tmp.quantize(DX(str(pv)), rounding=rounding)
    except:
        for i in range(len(obj)):
            tmp = DX(str(float(obj[i])))
            obj[i] = tmp.quantize(DX(str(pv)), rounding=rounding)
    return obj

# LateX:
kwargs = {}
kwargs["mat_str"] = "bmatrix"
kwargs["mat_delim"] = ""
# kwargs["symbol_names"] = {FB: "F^{\mathsf B}", }

# Units:
(k, M, G ) = ( 10**3, 10**6, 10**9 )
(mm, cm, deg) = ( m/1000, m/100, pi/180)
Newton = kg*m/s**2
Pa     = Newton/m**2
MPa    = M*Pa
GPa    = G*Pa
kN     = k*Newton

half = S(1)/2

# Header ends here.
#
# https://colab.research.google.com/github/kassbohm/wb-snippets/blob/master/ipynb/TEM_11/Selbst/5.1_cc.ipynb

from numpy import linspace, full_like, array, arange
import matplotlib.pyplot as plt

# helper function:
def fill_array(f,x,xia):
    if f.is_constant(x):
        res = full_like(xia,f)
    else:
        res = lambdify(x,f,"numpy")
        res = array(res(xia))
    return res

xi = var("xi")
# f1 = Fcrit1 / (EI pi² / l²)
# f2 = Fcrit2 / (EI pi² / l²)
f1 = 4/xi**2
f2 = 1/(1-xi)**2

# xi = a/l
xia = linspace(0, 1, 100)
f1 = fill_array(f1,xi,xia)
f2 = fill_array(f2,xi,xia)

fig, ax = plt.subplots()

tmp = ax.plot(xia, f1, label=u"$f_1$")
tmp = ax.plot(xia, f2, label=u"$f_2$")
ax.legend()
ax.grid()
plt.xlabel(u"$\\xi$")
plt.ylim(0,20)
plt.savefig("5.1_plot.svg", transparent=True)
plt.show()


eq = Eq(4/xi**2, 1 /(1-xi)**2 * 2.0457)
pprint(eq)

sol = solve(eq, xi)
pprint("\n")
pprint(sol)

# 4      2.0457
# ── = ─────────
#  2           2
# ξ    (-ξ + 1)
#
# [0.58304283587246, 3.51049449207105]

```

d96258b7148d5daff77cb22a7d7b63b93ed9c3bd
ipynb
Jupyter Notebook
ipynb/TEM_11/Selbst/5.1_cc.ipynb
kassbohm/wb-snippets
f1ac5194e9f60a9260d096ba5ed1ce40b844a3fe
MIT
ipynb/TEM_11/Selbst/5.1_cc.ipynb
kassbohm/wb-snippets
f1ac5194e9f60a9260d096ba5ed1ce40b844a3fe
MIT
ipynb/TEM_11/Selbst/5.1_cc.ipynb
kassbohm/wb-snippets
f1ac5194e9f60a9260d096ba5ed1ce40b844a3fe
MIT
Qwen/Qwen-72B
1. YES
2. YES