diff --git a/README.md b/README.md index 02d90c9..06b1c98 100644 --- a/README.md +++ b/README.md @@ -1 +1,7 @@ -This reposetory is used for saving my calculations. Install Jupyter VS Code extension for interactive window \ No newline at end of file +This reposetory is used for saving my calculations. Install Jupyter VS Code extension for interactive window + +Python libraries needed. Use pip install ... +* numpy +* matplotlib +* sympy +* ipython \ No newline at end of file diff --git a/analysis/aufgabenblatt_5_2.py b/analysis/aufgabenblatt_5_2.py new file mode 100644 index 0000000..e835e2d --- /dev/null +++ b/analysis/aufgabenblatt_5_2.py @@ -0,0 +1,57 @@ +#%% +import numpy as np +import matplotlib.pyplot as plt + +# Parameter +x = np.arange(0, 7, 0.1) +y = np.sin(x) + +# Plot +plt.figure(1) +plt.plot(x, y, lw=3, label="sin(x)") +plt.xlabel("x") +plt.ylabel("y") +plt.legend("image") +plt.grid(visible=True) +plt.axis("image") + +#%% +import numpy as np +import matplotlib.pyplot as plt +import matplotlib as mpl + +# Konfigurieren +mpl.rcParams["font.size"] = 20 +mpl.rcParams["font.family"] = "serif" + +# Parameter +x_0 = 0 +x_E = 4 +N = 201 +lw = 3 +fig = 1 + +# Funktionen +def f(x): + y = 3 / (1 + x) + return y + +def g(x): + y = x / 2 + return y + +# Daten + +x_data = np.linspace(x_0, x_E, N) +f_data = f(x_data) +g_data = g(x_data) + +# Plot +plt.figure(fig) +plt.plot(x_data, f_data, linewidth = lw, label = r"$f = \frac{3} {1+x}$") +plt.plot(x_data, g_data, linewidth = lw, label = r"$g = \frac{x} {2}$") +plt.xlabel(r"$x$") +plt.ylabel(r"$y$") +plt.legend() +plt.grid(visible=True) +plt.axis("image") \ No newline at end of file