diff --git a/Plot-Scripts/WoodBilayer_angle_r022.py b/Plot-Scripts/WoodBilayer_angle_r022.py new file mode 100644 index 0000000000000000000000000000000000000000..cd18e4ce20aaf50c59ab39058384eb26bfefcf4e --- /dev/null +++ b/Plot-Scripts/WoodBilayer_angle_r022.py @@ -0,0 +1,139 @@ +import numpy as np +import matplotlib.pyplot as plt +import math +import os +import subprocess +import fileinput +import re +import sys +import matplotlib as mpl +from mpl_toolkits.mplot3d import Axes3D +import matplotlib.cm as cm +import matplotlib.ticker as ticker +from matplotlib.ticker import MultipleLocator,FormatStrFormatter,MaxNLocator +import seaborn as sns +import matplotlib.colors as mcolors +# ---------------------------------------------------- +# --- Define Plot style: +# plt.style.use("seaborn-white") +# plt.style.use("seaborn-pastel") +# plt.style.use("seaborn-colorblind") +plt.style.use("seaborn") +mpl.rcParams['text.usetex'] = True +mpl.rcParams["font.family"] = "serif" +mpl.rcParams["font.size"] = "14" +mpl.rcParams['xtick.bottom'] = True +mpl.rcParams['xtick.major.size'] = 3 +mpl.rcParams['xtick.minor.size'] = 1.5 +mpl.rcParams['xtick.major.width'] = 0.75 +mpl.rcParams['ytick.left'] = True +mpl.rcParams['ytick.major.size'] = 3 +mpl.rcParams['ytick.minor.size'] = 1.5 +mpl.rcParams['ytick.major.width'] = 0.75 + +#Adjust grid: +mpl.rcParams.update({"axes.grid" : True}) # Add grid +mpl.rcParams['axes.labelpad'] = 3 +mpl.rcParams['grid.linewidth'] = 0.25 +mpl.rcParams['grid.alpha'] = 0.9 # 0.75 +mpl.rcParams['grid.linestyle'] = '-' +mpl.rcParams['grid.color'] = 'gray'#'black' +mpl.rcParams['text.latex.preamble'] = r'\usepackage{amsfonts}' # Makes Use of \mathbb possible. +# ---------------------------------------------------------------------------------------- +width = 5.79 +height = width / 1.618 # The golden ratio. + +# fig = plt.figure() #main +fig, ax = plt.subplots(figsize=(width,height)) + + + + + +# input = [15.30614414,14.49463867,13.46629742,12.78388234,12.23057715,10.21852839,9.341730605] #moisture-content (in %) + +# input = [0 , np.pi/4, np.pi/2] # rotation angle + + +# input = [0 , np.pi/6.0, np.pi/3.0, np.pi/2.0, 2.0*(np.pi/3.0), 5.0*(np.pi/6.0), np.pi] # rotation angle +# kappa_sim = [ 3.94388778, 5.53106212, 8.72945892, 10.22044088, 8.72945892, 5.53106212, 3.94388778] + +input = [0 , np.pi/12.0, np.pi/6.0, np.pi/4.0, np.pi/3.0, 5.0*(np.pi/12.0), np.pi/2.0] # rotation angle +kappa_sim = [ 3.94388778, 4.37675351, 5.53106212, 7.14228457, 8.72945892, 9.83567134, 10.22044088] + +# compute difference: +# relative_error = (np.array(kappa_sim) - np.array(kappa_exp)) / np.array(kappa_exp) +# print('relative_error:', relative_error) + + +# --------------- Plot Lines + Scatter ----------------------- +line_1 = ax.plot(input, kappa_sim, # data + # color='forestgreen', # linecolor + marker='D', # each marker will be rendered as a circle + markersize=5, # marker size + # markerfacecolor='darkorange', # marker facecolor + markeredgecolor='black', # marker edgecolor + markeredgewidth=0.75, # marker edge width + # linestyle='dashdot', # line style will be dash line + linewidth=1.5, # line width + zorder=3, + label = r"$\kappa_{sim}$") + +# line_2 = ax.plot(input, kappa_exp, # data +# # color='orangered', # linecolor +# marker='o', # each marker will be rendered as a circle +# markersize=5, # marker size +# # markerfacecolor='cornflowerblue', # marker facecolor +# markeredgecolor='black', # marker edgecolor +# markeredgewidth=0.75, # marker edge width +# # linestyle='--', # line style will be dash line +# linewidth=1.5, # line width +# zorder=3, +# alpha=0.8, # Change opacity +# label = r"$\kappa_{exp}$") + +# --- Plot order line +# x = np.linspace(0.01,1/2,100) +# y = CC_L2[0]*x**2 +# OrderLine = ax.plot(x,y,linestyle='--', label=r"$\mathcal{O}(h)$") + + + +# Fix_value = 7.674124 +# l3 = plt.axhline(y = Fix_value, color = 'black', linewidth=0.75, linestyle = 'dashed') +# --------------- Set Axes ----------------------- +ax.set_title(r"ratio $r = 0.22$") # Plot - Title +# plt.xscale('log') # Use Logarithmic-Scale +# plt.yscale('log') +ax.set_xlabel(r"Rotation angle $\varphi_2$ (active layer)", labelpad=4) +ax.set_ylabel(r"Curvature $\kappa$", labelpad=4) +plt.tight_layout() + +# # --- Set Line labels +# line_labels = [r"$CC_{L_2}$",r"$CC_{H_1}$", r"$\mathcal{O}(h)$"] + +# --- Set Legend +legend = ax.legend() +# legend = fig.legend([line_1 , line_2, OrderLine], +# labels = line_labels, +# bbox_to_anchor=[0.97, 0.50], +# # bbox_to_anchor=[0.97, 0.53], +# # loc='center', +# ncol=1, # Number of columns used for legend +# # borderaxespad=0.15, # Small spacing around legend box +# frameon=True, +# prop={'size': 10}) + + +frame = legend.get_frame() +frame.set_edgecolor('black') + + +# --- Adjust left/right spacing: +# plt.subplots_adjust(right=0.81) +# plt.subplots_adjust(left=0.11) + +# ---------- Output Figure as pdf: +fig.set_size_inches(width, height) +fig.savefig('WoodBilayer_angle_r022.pdf') +# plt.show() \ No newline at end of file diff --git a/experiment/wood-bilayer/wood_test.py b/experiment/wood-bilayer/wood_test.py index a82df9a1e7be8527e6f3c4a8109ce8e7a2a2004d..ad7610cb6e6adc8dc51c9bfc6a8b5c216a01ce47 100644 --- a/experiment/wood-bilayer/wood_test.py +++ b/experiment/wood-bilayer/wood_test.py @@ -136,23 +136,37 @@ gamma = 1.0 # ] # Ratio r = 0.49 -materialFunctionParameter=[ - [0.49, 0.008, 17.01520754, 15.30614414, 0, 0.357615902], - [0.49, 0.008, 17.01520754, 14.49463867, 0, 0.376287785], - [0.49, 0.008, 17.01520754, 13.46629742, 0, 0.851008627], - [0.49, 0.008, 17.01520754, 12.78388234, 0, 0.904475291], - [0.49, 0.008, 17.01520754, 12.23057715, 0, 1.039744708], - [0.49, 0.008, 17.01520754, 10.21852839, 0, 1.346405241], - [0.49, 0.008, 17.01520754, 9.341730605, 0, 1.566568558] -] +# materialFunctionParameter=[ +# [0.49, 0.008, 17.01520754, 15.30614414, 0, 0.357615902], +# [0.49, 0.008, 17.01520754, 14.49463867, 0, 0.376287785], +# [0.49, 0.008, 17.01520754, 13.46629742, 0, 0.851008627], +# [0.49, 0.008, 17.01520754, 12.78388234, 0, 0.904475291], +# [0.49, 0.008, 17.01520754, 12.23057715, 0, 1.039744708], +# [0.49, 0.008, 17.01520754, 10.21852839, 0, 1.346405241], +# [0.49, 0.008, 17.01520754, 9.341730605, 0, 1.566568558] +# ] #Second Experiment: Rotate "active" bilayer phase # materialFunctionParameter=[ # [0.22, 0.0053, 17.17547062, 8.959564147, 0, 4.262750825], -# [0.22, 0.0053, 17.17547062, 8.959564147, (np.pi/4.0), 4.262750825], -# [0.22, 0.0053, 17.17547062, 8.959564147, (np.pi/2.0), 4.262750825] +# [0.22, 0.0053, 17.17547062, 8.959564147, (np.pi/6.0), 4.262750825], +# [0.22, 0.0053, 17.17547062, 8.959564147, (np.pi/3.0), 4.262750825], +# [0.22, 0.0053, 17.17547062, 8.959564147, (np.pi/2.0), 4.262750825], +# [0.22, 0.0053, 17.17547062, 8.959564147, 2.0*(np.pi/3.0), 4.262750825], +# [0.22, 0.0053, 17.17547062, 8.959564147, 5.0*(np.pi/6.0), 4.262750825], +# [0.22, 0.0053, 17.17547062, 8.959564147, np.pi, 4.262750825] # ] +materialFunctionParameter=[ + [0.22, 0.0053, 17.17547062, 8.959564147, 0, 4.262750825], + [0.22, 0.0053, 17.17547062, 8.959564147, (np.pi/12.0), 4.262750825], + [0.22, 0.0053, 17.17547062, 8.959564147, (np.pi/6.0), 4.262750825], + [0.22, 0.0053, 17.17547062, 8.959564147, (np.pi/4.0), 4.262750825], + [0.22, 0.0053, 17.17547062, 8.959564147, (np.pi/3.0), 4.262750825], + [0.22, 0.0053, 17.17547062, 8.959564147, 5.0*(np.pi/12.0), 4.262750825], + [0.22, 0.0053, 17.17547062, 8.959564147, (np.pi/2.0), 4.262750825] +] + # ------ Loops through Parameters for Material Function ----------- for i in range(0,np.shape(materialFunctionParameter)[0]): print("------------------")