Open budschi opened 8 months ago
I had a short discussion on this use case with @JFRudzinski. We will exchange soon on how to populate NOMAD's results section. Thanks to pointing us to the SymPy package which can be used to create that generic function described above:
import sympy as sp
import matplotlib.pyplot as plt
import numpy as np
def plot_expression(expression_str, x_range=(-10, 10), num_points=100):
# Define the symbol
x = sp.symbols('x')
# Convert the expression string to a SymPy expression
expression = sp.sympify(expression_str)
# Convert the SymPy expression to a NumPy function
expression_np = sp.lambdify(x, expression, 'numpy')
# Generate x values
x_vals = np.linspace(x_range[0], x_range[1], num_points)
# Evaluate the expression at each x value
y_vals = expression_np(x_vals)
# Plot the expression
plt.plot(x_vals, y_vals, label=f'{expression_str}')
plt.title(f'Plot of the expression {expression_str}')
plt.xlabel('x')
plt.ylabel(f'{expression_str}')
plt.legend()
plt.grid(True)
plt.show()
# Example usage:
expression_string = "x**3"
plot_expression(expression_string)
in this issue, we list the tasks to develop the IKZ Crystal growth material database with @WolframMiller The custom yaml schema can be found here
After our discussion on Nov. 21st we decided to create an NOMAD app for this use case (see MOF or Solar Cell App in central NOMAD). Here are the next steps:
[ ] App
[ ] Schemas
[ ] Plugin: generate a plugin to plot temperature-dependent functions, if clear how
[ ] General Questions:
[ ] Populate NOMAD's result section: when above task are solved, we can make use of the Results section by populating the exisitn material properties.